Set a matrix $X\in \mathbb{R}^{n\times n}$ and a symmrtric matrix $A\in\mathbb{R}^{n\times n}$. I'm trying to get $\frac{\partial\text{tr}\left(XAX\right)}{\partial X}$. If the matrix $X$ is asymmetric, I have that $\frac{\partial\text{tr}\left(XAX\right)}{\partial X}=X^\top A+AX^\top$; If the matrix $X$ is symmetric, I have that $\frac{\partial\text{tr}\left(XAX\right)}{\partial X}=2\left(XA+AX\right)$. But the matrixcalculus gives me a quite strange answer when $X$ is symmetric: $$ \frac{\partial\text{tr}\left(XAX\right)}{\partial X}=\frac{1}{2}\left(\left(T_0+T_1\right)^\top +T_0+T_1\right) $$ where $T_0 =XA$ and $T_1 =AX$.
I want to know how to get this result.