Find the greatest and smallest values that the function \(f(x,y) = xy\) takes over the ellipse
\begin{equation}
\frac{x^2}{8} + \frac{y^2}{2} = 1.\tag{10.7}
\end{equation}
Solution.
If we picture the graph of \(f(x,y) = xy\text{,}\) a saddle-shaped surface, then restricting the inputs \((x,y)\) to the ellipse traces a curve on that surface, and we are after the highest and lowest points of this curve. We wish to find the extrema of \(f(x,y) = xy\) subject to the constraint
\begin{equation}
g(x,y) = \frac{x^2}{8} + \frac{y^2}{2} - 1 = 0.\tag{10.8}
\end{equation}
We begin by computing the gradients of both functions:
\begin{align*}
\nabla f \amp= y\,\mathbf i + x\,\mathbf j\\
\nabla g \amp= \frac{x}{4}\,\mathbf i + y\,\mathbf j.
\end{align*}
The Lagrange multiplier equation gives
\begin{align*}
\nabla f \amp= \lambda\,\nabla g\\
\amp\;\Rightarrow\; y\,\mathbf i + x\,\mathbf j = \lambda\frac{x}{4}\,\mathbf i + \lambda y\,\mathbf j\\
\amp\;\Rightarrow\; y = \lambda\frac{x}{4}, \quad x = \lambda y.
\end{align*}
After substituting \(x = \lambda y\) into \(y = \lambda\frac{x}{4}\text{,}\) we get
\begin{align*}
y = \frac{\lambda^2}{4}\, y \amp\;\Rightarrow\; \lambda = \pm 2
\;\Rightarrow\; x = \pm 2y.
\end{align*}
After plugging \(x = \pm 2y\) into the constraint equation we get
\begin{align*}
g(\pm 2y, y) \amp= \frac{y^2}{2} + \frac{y^2}{2} - 1 = 0\\
\amp\;\Rightarrow\; y^2 = 1
\;\Rightarrow\; y = \pm 1.
\end{align*}
Note that \(y = 0\) is another solution of \(y = \frac{\lambda^2}{4}y\text{;}\) however, when \(y = 0\text{,}\) from \(x = \lambda y\) we know that \(x = 0\text{,}\) and the point \((0,0)\) does not satisfy the constraint equation, i.e. \(g(0,0) = -1 \neq 0\text{.}\)
Therefore there are four local extrema:
\begin{align*}
(\pm 2, 1)\colon \amp\quad f(2,1) = 2, \quad f(-2,1) = -2\\
(\pm 2, -1)\colon \amp\quad f(2,-1) = -2, \quad f(-2,-1) = 2.
\end{align*}
Since the ellipse is a closed and bounded curve and \(f\) is continuous, \(f\) attains its absolute extrema over the ellipse, and they are among these four values. The absolute maximum of \(f(x,y) = xy\) over the ellipse \(\frac{x^2}{8} + \frac{y^2}{2} = 1\) is \(2\) and its absolute minimum is \(-2\text{.}\)
FigureΒ 10.5 shows the constraint ellipse together with several level curves of \(f\text{:}\) the hyperbolas \(xy = c\text{,}\) with \(|c|\) increasing as the curves move away from the origin. Exactly as promised by (10.5), the level curves \(xy = 2\) and \(xy = -2\) are tangent to the ellipse at the four extremal points, and at each of them \(\nabla f\) and \(\nabla g\) are collinear. For instance, at \((2,1)\) we have \(\nabla f = \mathbf i + 2\,\mathbf j\) and \(\nabla g = \frac{1}{2}\,\mathbf i + \mathbf j\text{,}\) so \(\nabla f = 2\,\nabla g\text{,}\) matching the multiplier \(\lambda = 2\text{.}\)
