Since it easy to google every task please please please try to undestand what's going on. The "just answer" thing will be not counted, make sure to present derivation of your solution. It is absolutely OK if you found an answer on web then just exercise in $\LaTeX$ copying it into here.
Hint for the latter (one of the ways): use ex. 2 result and the fact $$ tr(ABC) = tr (CAB) $$
Classic matrix factorization example. Given matrix $X$ you need to find $A$, $S$ to approximate $X$. This can be done by simple gradient descent iteratively alternating $A$ and $S$ updates. $$ J = || X - AS ||_2^2 , \quad A\in \mathbb{R}^{N \times R} , \quad S\in \mathbb{R}^{R \times M} $$ $$ \frac{dJ}{dS} = \frac{d(tr(XX^T - ASX^T - XS^TA^T + ASS^TA^T))}{dS} = \left(-2A^TX + \frac{d(tr(SS^TA^TA))}{dS}\right) = -2A^TX + \frac{d\sum_i\sum_j\sum_k\sum_l s_{ij}s_{kj}a_{lk}a_{ki}}{dS} = \\ = 2A^T(AS - X) $$
You can use slightly different techniques if they suits you. Take a look at this derivation: