# Second Order Matrix derivative $\frac{\partial Tr(XBX^TA)}{\partial X}$

Let $F(X) = Tr(XBX^TA)$, where A,B are matrix.

What is the derivative $\frac{\partial F(X)}{\partial X}$?

Is it something like $A(XB^T+XB)$?

-
Coming back to the definition of the differential, one looks for a linear functional $L$ such that $F(X+H)=F(X)+L(H)+o(\|H\|)$ when $H\to O$, and then one knows that $D_XF=L$. Here, $$F(X+H)=F(X)+\mathrm{tr}(HBX^TA)+\mathrm{tr}(XBH^TA)+\mathrm{tr}(HBH^TA),$$ hence $$D_XF:H\mapsto\mathrm{tr}(HBX^TA)+\mathrm{tr}(XBH^TA).$$ Since $\mathrm{tr}(U)=\mathrm{tr}(U^T)$ for every square matrix $U$ and $\mathrm{tr}(VW)=\mathrm{tr}(WV)$ for every matrices $V$ and $W$, this is also $$(D_XF)(H)=\mathrm{tr}(H^TC),\qquad C=AXB+A^TXB^T.$$ One sees that $C=AX(B+B^T)$ when $A$ is symmetric, but not in general.