Compute the derivative of $\mbox{tr}(AXB)$ with respect to $X$ 
Given matrices $A, B \in \Bbb R^{2 \times 2}$, compute the derivative of $\mbox{tr}(AXB)$ with respect to $X \in \Bbb R^{2 \times 2}$.


I know that $\frac{\partial tr(AXB}{\partial X}$ is same like $tr(\frac{\partial,AXB}{\partial X})$
i am knot sure about the my understand how the derivative works wrt matrix but this is what i got at first and wanted to know if it is correct?


$$ \Large\frac{\partial}{\partial {\bf X}} \mbox{tr} \left( {\bf f} ({\bf X}) \right) = \mbox{tr} \left( \frac{\partial {\bf f} ({\bf X})}{\partial {\bf X}} \right) $$
My idea was to use this formula on $f(X) := AXB$. Then, I wanted to compute its derivative. However, I got a tensor, i.e., a $4$-dimensional matrix. If compute the trace of this tensor, it seems like something different?

In the following,
the colon operator denotes Frobenius
inner product
$$
\mathbf{U}:\mathbf{V}
= \mathrm{tr}(\mathbf{U}^T \mathbf{V})
$$
The cost function writes
$\phi(\mathbf{X})
= \mathrm{tr}(\mathbf{AXB})
= \mathrm{tr}(\mathbf{BAX})
= (\mathbf{BA})^T:\mathbf{X}
$
In denominator layout convention,
the gradient writes
$$
\frac{\partial \phi}{\partial \mathbf{X}}
=
(\mathbf{BA})^T
$$
