Solution (source code)

= Solution

The <gradient> equations are $f_x=2x(1-y)=0$ and $f_y=4y-x^2=0$. The <critical points> are $(0,0)$ and $(\pm2,1)$. Their <Hessian matrix> is
$$
H=\begin{pmatrix}2-2y&-2x\\-2x&4\end{pmatrix}.
$$
At the origin $H=\operatorname{diag}(2,4)$ is positive definite. At either other point its <determinant> is $-16$, so its <eigenvalues> have opposite signs. Thus
$$
\boxed{(0,0)\text{ is a strict local minimum},\qquad (2,1),(-2,1)\text{ are saddle points}.}
$$
The minimum value is zero and both saddle values are two. The origin is not a global minimum: at any fixed $y>1$, the term $(1-y)x^2$ makes $f$ arbitrarily negative as $|x|$ increases.

For the <contour plot>, the local contours around the origin are approximately $x^2+2y^2=c$. The exact saddle contour factors as
$$
f-2=(y-1)(2y+2-x^2),
$$
so it is the union of $y=1$ and $y=x^2/2-1$, crossing at the two saddles. Other levels obey $x^2=(c-2y^2)/(1-y)$ where $y\ne1$; the right panel of the original figure in part 3(a) shows how these branches join around the minimum and pass through the saddle contour.