Stuck on Jacobian matrix of $xx'Ax$

713 Views Asked by At

Let the $x$'s be vectors and $A$ be a matrix

\begin{align} \nabla xx'Ax &= \partial(xx')Ax + xx'\partial(Ax)\\ &= \partial(xx')Ax + xx'A\textbf{1} \tag{i} \\ &= \partial xx'Ax + x\partial x'Ax + xx'A\\ &= \textbf{1}x'Ax + x\partial x'Ax + xx'A \tag{ii} \\ \end{align}

Questions:

1) Does $A1$ become $A$?

2) Is the $1$ (identity matrix) necessary? I tried inputting the following into matrixcalculus.org and they left the identity in there even though it's not present for other equations I put in?

(y * x' * A * x), with regards to y
x vector, y vector, A matrix

3) What rules or properties would I apply to do $x\partial x'Ax$?


Thanks for taking the time to read this far! I know my notation is sloppy and if you have any comments please let me know

2

There are 2 best solutions below

4
On BEST ANSWER

Let vector field $\mathrm f : \mathbb R^n \to \mathbb R^n$ be defined by

$$\mathrm f (\mathrm x) := \left( \mathrm x^\top \mathrm A \,\mathrm x \right) \mathrm x$$

Hence,

$$\begin{aligned} \lim_{h \to 0} \frac{\mathrm f (\mathrm x + h \mathrm v) - \mathrm f (\mathrm x)}{h} &= \big( \left( \mathrm v^\top \mathrm A \,\mathrm x \right) \mathrm x + \left( \mathrm x^\top \mathrm A \,\mathrm v \right) \mathrm x + \left( \mathrm x^\top \mathrm A \,\mathrm x \right) \mathrm v \big)\\ &= \big( \mathrm x \, \mathrm x^\top \mathrm A^\top + \mathrm x \,\mathrm x^\top \mathrm A + \left( \mathrm x^\top \mathrm A \,\mathrm x \right) \mathrm I_n \big) \mathrm v\\ &= \big( \color{blue}{\mathrm x \, \mathrm x^\top \left( \mathrm A^\top + \mathrm A \right) + \left( \mathrm x^\top \mathrm A \,\mathrm x \right) \mathrm I_n} \big) \mathrm v\end{aligned}$$

where the expression in $\color{blue}{\text{blue}}$ gives us the Jacobian of $\rm f$.

2
On

I'm assuming

  1. $\nabla = \partial = \frac{\partial}{\partial x}$
  2. $x' = x^{T}$
  3. Numerator layout

Then

(i) Does A1 become A?

Yes it does, you can see that in the next line.

(ii) Is the 1 (identity matrix) necessary?

Yes it is, since $x'Ax$ is a scalar, hence $Ix'Ax$ is the matrix with $x'Ax$ in every diagonal entry and zeroes everywhere else.

(iii) What rules or properties would I apply to do $$x∂x′Ax$$?

$\partial x' = \frac{\partial x'}{\partial x}$ is an operator that transposes the next column vector into a row vector. You can see this doing

$$\frac{\partial x'}{\partial x}v = \frac{\partial x'v}{\partial x} = \frac{\partial v'x}{\partial x} = v'\frac{\partial x}{\partial x} = v'$$

The case when $v=Ax$ is a little bit more complicated, but you can check that it works as well. $$\frac{\partial x'}{\partial x}Ax = (Ax)'$$

Hence $x\partial x'Ax = x(Ax)' = xx'A'$ and your final expression is $Ix'Ax + xx'(A'+A)$