Frobenius norm differentiation $X\in R^n$
\begin{align} f(x) &= \tfrac12\|X^TX-A\|^2_F=\tfrac12\langle X^TX-A,X^TX-A \rangle \\[1ex] df(x) &= \tfrac12d\bigl(\langle X^TX-A,X^TX-A \rangle\bigl)=\tfrac12\langle d(X^TX-A),d(X^TX-A) \rangle\\ & = \tfrac 42\bigl(\bigl\langle \langle X,dX\rangle \langle X,dX \rangle\bigr\rangle\bigr) =2(X^Tdx)^TX^Tdx=2dxXX^Tdx=2(X^TXdx)^Tdx \end{align}
Where $\langle x,y \rangle$ is the scalar multiplication.
I don't actually know how to do matrix/vector/norm differentiation. What I come up with is the above. Please, can you help me to differentiate the expression?