How is the derivative of $\textrm{Trace}\left\{ X^T A X B\right\}$ with respect to $X$ equal to $AXB + A^TXB^T$? How is the derivative of $\mbox{Trace}\left\{ X^T A X B\right\}$ with respect to matrix $X$ equal to $AXB + A^TXB^T$?
\begin{align}  
\nabla_X \ \textrm{Trace}\left\{ X^T A X B\right\} = AXB + A^TXB^T
\end{align}
where $A$ and $B$ matrices are given.

With implicit summation over repeated indices,
$$\frac{\partial\operatorname{tr}X^T AXB}{\partial X_{ij}}=A_{lm}B_{nk}\frac{\partial}{\partial X_{ij}}(X_{lk}X_{mn})=A_{lm}B_{nk}(\delta_{il}\delta_{jk}X_{mn}+X_{lk}\delta_{im}\delta_{jn}),$$where $\delta_{rs}$ is the Kronecker delta ($1$ if $r=s$, $0$ is $r\neq s$). The right-hand side is $$A_{im}X_{mn}B_{nj}+A_{li}X_{lk}B_{jk}=(AXB+A^T XB^T)_{ij}.$$
