Gradient of Matrix Functions Suppose there is a matrix function $$f(w)=w^\top Rw.$$ Where $R∈ℝ^{mxm}$ is an arbitrary matrix, and $w∈ℝ^m$. The gradient of this function with respect to $w$comes out to be $Rw$. 
I have looked at different formulas and none of them give me this answer. What is the procedure of solving such matrix gradients?

Write $f(w)=\sum_{i,j=1}^{m}r_{ij}w_{i}w_{j}$, then
$$ \partial_{k}f(w)=2\sum_{j=1}^{m}r_{kj}w_{j}
$$
which is the $k$-th component of $2Rw$
