I'm having difficulty figuring out how to derive the following from Andrew Ng's CS229 lecture notes.
$$\nabla_A \textrm{Tr } ABA^{T}C = CAB + C^TAB^T $$
where $\textrm{Tr }$ is the trace operator of a matrix. This is from his section on matrix derivatives in his lecture notes.
Instead of a quadratic function of a single variable $(A)$, consider a function that is linear in two variables $(X,Y)$ and find its differential $$\eqalign{ \phi &= {\rm tr}(XBYC) \cr d\phi &= {\rm tr}(BYC\,dX + CXB\,dY)) \cr &= C^TY^TB^T:dX + CXB:dY^T \cr }$$ Now make the substitutions $(X,Y)\rightarrow(A,A^T)$ $$\eqalign{ \phi &= {\rm tr}(ABA^TC) \cr d\phi &= C^TAB^T:dA + CAB:dA \cr \nabla_A\phi &= C^TAB^T + CAB \cr }$$