I have not taken calculus for while so I need some help with the following partial derivative. If I am shown how to do this one I should be able to figure out the rest of them.
So I have
$$f(A,B,C) = ||P - AB^T||^2 + ||Q - AC^T||^2$$
where A,B,C,Q,P are matrices and $|| ||$ is the frobenius norm.
and I want partial derivative: $$\frac{\partial{f}}{\partial B}$$
Let's use a colon to denote the trace/Frobenius product $$A:B = {\rm tr}(A^TB)$$ and define new variables $$\eqalign{ X &= BA^T-P^T \cr Y &= CA^T-Q^T \cr }$$ Write the function in terms of these new symbols. Then find its differential and gradient $$\eqalign{ f &= X:X + Y:Y \cr df &=2X:dX + 2Y:dY \cr &= 2X:dB\,A^T + 0 \cr &= 2XA:dB \cr &= 2(BA^TA - P^TA):dB \cr \frac{\partial f}{\partial B} &= 2(BA^TA - P^TA) \cr\cr }$$ There are lots of rules for rearranging the terms in a Frobenius product, which follow from the properties of the underlying trace function.
For example, all of the following are equivalent $$\eqalign{ A:BC &= B^TA:C\cr &= AC^T:B\cr &= A^T:(BC)^T\cr &= BC:A \cr }$$