how to prove $\nabla_AtrABA^T=AB+AB^T$

39 Views Asked by At

how do we prove $\nabla_Atr(ABA^T)=AB+AB^T$? where B is square, and $\nabla_A$ is the derivative according to every element in A. I'm getting lost with all the matrix indices... is there a neat way to show this? even an intuitive explanation of why this is true will do for me

1

There are 1 best solutions below

2
On BEST ANSWER

$\def\p{\partial}$ First note the behavior of the trace function under transposition $$\eqalign{ f = {\rm Tr}(XBY^T) &= {\rm Tr}\Big((XBY^T)^T\Big) = {\rm Tr}(YB^TX^T) \\ }$$ Next calculate the gradient of the function with respect to $X$ and $Y$ $$\eqalign{ \frac{\p f}{\p X} &= YB^T,\qquad \frac{\p f}{\p Y} &= XB \\ }$$ Finally, set $\,X=Y=A\,$ and use the chain rule $$\eqalign{ \frac{df}{dA} &= \left(\frac{\p f}{\p X}\right)\left(\frac{\p X}{\p A}\right) + \left(\frac{\p f}{\p Y}\right)\left(\frac{\p Y}{\p A}\right) \\ &= AB^T + AB \\ }$$


The above derivation assumes the following result is already known $$\eqalign{ \frac{\p \,{\rm Tr}(BY^T)}{\p Y} &= B \\ }$$