Solution (source code)

= Solution

The global optimality conditions for a quadratic <trust-region subproblem> with Hessian $B$ are: for some $\lambda\geq0$,
$$
(B+\lambda I)s=-g,\qquad B+\lambda I\succeq0,\qquad\|s\|_2\leq\Delta,\qquad\lambda(\|s\|_2-\Delta)=0.
$$
Here $B=I$, so the shifted matrix is positive definite. If $\|g\|_2\leq\Delta$, choose $\lambda=0$ and $s=-g$. If $\|g\|_2>\Delta$, the active boundary gives $s=-g/(1+\lambda)$ and $1+\lambda=\|g\|_2/\Delta$. Hence
$$
\boxed{s_*=-g\quad(\|g\|_2\leq\Delta),\qquad s_*=-\Delta g/\|g\|_2\quad(\|g\|_2>\Delta).}
$$
This is exactly the <Cauchy point>. Because the model is strictly convex, it is the unique global minimizer, including $s_*=0$ when $g=0$.