Solution (source code)

= Solution

Differentiate the column <gradient> $2e^{r^Tr}r$. The <Jacobian matrix> product rule gives one term from differentiating the scalar <exponential function> and one from differentiating $r$, whose <Jacobian matrix> is the <identity matrix>:
$$
\boxed{H_f(x)=e^{\|r\|^2}(4rr^T+2I).}
$$
In particular, for any nonzero <vector> $v$,
$$
v^TH_f(x)v=e^{\|r\|^2}\bigl(4(r^Tv)^2+2\|v\|^2\bigr)>0.
$$
Thus the <Hessian matrix> is positive definite everywhere. This calculation proves strict <convexity> and supplies the <derivatives> needed for sums of these terms.