I have the equation $$ R_{\text{emp}}(w) = \frac{1}{2N} \lVert \Phi w -y \rVert ^2 = \frac{1}{2N} \sum_{i=1}^N \left( w^T \phi(x_i)- y_i \right)^2 $$ and am supposed to derive the least squares solution $\hat{w}=(\Phi^T\Phi)^{-2}\Phi^Ty$ (assume $\Phi^T\Phi$ is invertible).
I know that I have to take the gradient of the empirical risk and equate it to zero. The trouble I am having is in differentiating the formula with the summation in it. Appreciate any help in this matter.