= Solution
The <Lagrange multiplier> equations are $2x=2\lambda x$, $-2y=2\lambda y$, together with $x^2+y^2=1$. If $x\ne0$, then $\lambda=1$ and $y=0$; if $y\ne0$, then $\lambda=-1$ and $x=0$. Thus
$$
\boxed{z_{\max}=1\text{ at }(\pm1,0),\qquad z_{\min}=-1\text{ at }(0,\pm1).}
$$
The constraint is compact and its gradient never vanishes, so these exhaust the possible global extrema. Equivalently, substituting $x=\cos\theta$, $y=\sin\theta$ gives $z=\cos2\theta$ along the boundary.
Back to article page