1
$\begingroup$

There's a good chance I got one or both of these wrong, so would anyone mind checking if I understood this correctly or not?

If $A$ is a $d\times d$ matrix and b,x $\epsilon R^{d}$ are two $d\times 1$ column vectors.

If $f(x)$ = b$^{T}$x and $g(x)$ = x$^{T}A$x

Is the following how I would represent $\nabla f(x)$ and $\nabla g(x)$?

$\nabla f(x) = (\frac{\partial f}{\partial x_{1}}(\mathbf x),...,\frac{\partial f}{\partial x_{d}}(\mathbf x))^{T} = (b_{1},...,b_{d})^{T}$

and

$\nabla g(x) = (\frac{\partial g}{\partial x_{1}}(\mathbf x),...,\frac{\partial g}{\partial x_{d}}(\mathbf x))^{T} = (2x_{1}A_{1,1}+...+x_{d}A_{d,1},...,x_{1}A_{1,d}+...+2x_{d}A_{d,d})^{T}$

On a side note, does anyone know of a computer program or website that may be useful in checking my own work for symbolic computations like this? I tried WolframAlpha, but I wasn't able to come close to getting it to interpret my input.

  • 1
    $\nabla g(x)=2Ax$2017-01-29
  • 0
    I guess that is a whole lot more simple, thanks.2017-01-29
  • 1
    Here is a nice proof through (vectorial form of) Taylor: $$g(x+h)=(x+h)^TA(x+h)=(x^TAx)+(x^TAh+h^TAx)+(h^Th)$$ that one identifies easily with $g(x)+g'(X)^Th+$ 2nd order terms, giving $g'(X)^Th=(2x^TA)h=2(x^TA^T)h=2(Ax)^Th$ proving that $g'(X)=2(Ax)$. Remark: as $x^TAh$ and $h^TAx$ are reals, they are equal to their transpose; in particular, they have the same values.2017-01-29
  • 0
    A little care must be taken because the matrix $A$ is not symmetric.2017-01-29
  • 0
    @Lythia Does this mean that the answer is not $2Ax$ because A is not symmetric?2017-01-29
  • 0
    @JeanMarie is that still true for nonsymmetric $A$?2017-01-29
  • 2
    In general, $\,\nabla g = (A+A^T)\,x\,\,$ or the transpose of that, depending on which conventions you use.2017-01-29
  • 0
    Thanks @greg that's what I ended up with once I simplified a bit, but I wasn't confident with my answer2017-01-29
  • 0
    @greg Thanks for your answer. One can add that this gradient can be written as $\nabla g = 2 \frac{A+A^T}{2}x=2 A_s x$ where $A_s$ is callled the symmetric component of $A$, with reference to the decomposition of $A$: $A=\frac{A+A^T}{2}+\frac{A-A^T}{2}$ as a sum of a symmetric and a skex'symmetric matrix.2017-01-29

0 Answers 0