Given the matrices $A \in \mathbb{R}^{n \times n}$ and $B \in \mathbb{R}^{m \times m}$, let the scalar field $f : \mathbb{R}^{m \times n} \to \mathbb{R}$ be defined by
$$ f(C) := \frac{1}{2}\left\lVert CA - BC \right\rVert_F^2 $$
What is the gradient $\nabla f$?
I am trying to differentiate this function w.r.t. to $C$ but I cannot find a way to manipulate the expression that would enable me to do so. I've also tried a definition of derivative adapted in this case but I don't endup with something useful at first glance. I endup with a linear map $df(C)$ defined by the expression
$$ df(C)E = \text{trace} \left\{ (CA -BC)^T (EA - BE)\right\} = \left\langle CA -BC,EA-BE\right\rangle $$
which then leads to me to
$$ df(C) = \left\langle AA^TC^T - AC^TB^T - A^TC^TB + C^TB^TB, \cdot \right\rangle $$
Is this expression correct?