I have the following exercise:
Given: $f(x)= < x,w>$ show that $\nabla f(x)=w$ and
given $f(x)=\|Bx-c\|^2_2$ show that $\nabla f(x)=2B^T(Bx-c)$, where $f:\mathbb{R}^d \rightarrow \mathbb{R}, w \in \mathbb{R}^d, B=(b_{ij}) \in \mathbb{R}^{m \times d}$
How exactly do I solve this type of exercise? Usually when I have the gradient vector $\nabla$ I just compute the partial derivaties, make a system in which I make all of them equal to 0, find the solutions (which are the critical points) and then compute the Hessian matrix by replacing these points in the partial derivatives. But here I have vectors and matrices instead of "normal" variables.
How shall I proceed in this case?
Hint for the first case: $$f(x)=x_1w_1+\cdots x_nw_n.$$ The second case also can be written using coordinates but is much worse.