Lagrange Multipliers with One Constraint

# Lagrange Multipliers with One Constraint

Recall from The Method of Lagrange Multipliers page that with the Method of Lagrange Multipliers that if we have a function $z = f(x, y)$ subject to the constraint $g(x, y) = C$, then if extreme values exist and $\nabla g (x, y) \neq (0, 0)$ on the level curve $g(x, y) = C$ then we can obtain the critical points subject to the constraint by solving the system of equations below and then comparing the values of $f$ at these critical points.

(1)
\begin{align} \quad \nabla f(x, y) = \lambda \nabla g(x, y) \\ \quad g(x, y) = C \end{align}

Furthermore, if we have a function $w = f(x, y, z)$ subject to the constraint $g(x, y, z) = C$, then if extreme values exist and $\nabla g(x, y, z) \neq (0,0,0)$ on the level surface $g(x, y, z) = C$, then we can find these extreme values by solving the system of equations below and then comparing the values of $f$ at these critical points.

(2)
\begin{align} \quad \nabla f(x, y, z) = \lambda g(x, y, z) \\ \quad g(x, y, z) = C \end{align}

Let's now look at some examples of problems involving Lagrange multipliers.

## Example 1

Find the maximum and minimum values of the function $f(x, y) = y^2 - x^2$ subject to the constraint $\frac{1}{4}x^2 + y^2 = 1$.

Let $g(x, y) = \frac{1}{4}x^2 + y^2 = 1$. Computing the necessary partial derivatives and we have that:

(3)
\begin{align} \quad -2x = \lambda \left ( \frac{1}{2} x \right ) \\ \quad 2y = \lambda \left ( 2y \right ) \\ \quad \frac{1}{4}x^2 + y^2 = 1 \end{align}

Now from the first equation, we have that $-2x = \lambda \frac{1}{2} x$ and so $-4x = \lambda x$, so $0 = \lambda x + 4x$ and $0 = x(\lambda + 4)$. Therefore, $x = 0$ or $\lambda = -4$.

If $x = 0$, then we have that from the third equation $y^2 = 1$, so $y = \pm 1$. Thus $(0, 1)$ and $(0, -1)$ are points of interest.

If $\lambda = -4$, then from the second equation we have that $2y = -8y$ which implies that $y = 0$. If $y = 0$, then we have that from the third equation $\frac{1}{4}x^2 = 1$, so $x^2 = 4$ and $x = \pm 2$. Thus $(2, 0)$ and $(-2, 0)$ are also points of interest.

Now let's compute the function at these points of interest:

(4)
\begin{align} \quad f(0, 1) = 1 \\ \quad f(0, -1) = 1 \\ \quad f(2, 0) = -4 \\ \quad f(-2, 0) = -4 \end{align}

Thus the maximum/minimum values of $f(x, y) = y^2 - x^2$ are $1$ and $-4$ respectively subject to the constraint $\frac{1}{4}x^2 + y^2 = 1$.

## Example 2

Find the maximum and minimum values of the function $f(x,y) = x^2 + y^2$ subject to the constraint $2xy = 1$.

Let $g(x, y) = 2xy = 1$. Computing the necessary partial derivatives and we have that:

(5)
\begin{align} \quad 2x = \lambda (2y) \\ \quad 2y = \lambda (2x) \\ \quad 2xy = 1 \end{align}

Note that from the third equation, since $2xy = 1$, then $x \neq 0$ and $y \neq 0$ (otherwise we would have a contradiction that $0 = 1$). Thus we can divide by $x$ and $y$.

From the first equation, we have that $\lambda = \frac{2x}{2y} = \frac{x}{y}$. Plugging this into the second equation and we completely eliminate $\lambda$ and get that:

(6)
\begin{align} \quad 2y = \lambda (2x) = \frac{x}{y} (2x) = \frac{2x^2}{y} \end{align}

Thus $2y^2 = 2x^2$, so $y^2 = x^2$, and $y = \pm x$.

If $y = x$, then from the third equation we have that $2x^2 = 1$, so $x^2 = \frac{1}{2}$ and $x = \pm \frac{1}{\sqrt{2}}$, so the corresponding points of interest are $\left ( \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \right )$ and $\left ( - \frac{1}{\sqrt{2}}, - \frac{1}{\sqrt{2}} \right )$.

If $y = -x$, then from the third equation we have that $-2x^2 = 1$, so $x^2 = -\frac{1}{2}$ which cannot happen.

Now let's compute the values of $f$ at these points of interest:

(7)
\begin{align} \quad f \left ( \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}} \right ) = 1\\ \quad f \left ( -\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}} \right ) = 1 \end{align}

Notice that our constraint $2xy = 1$ allows for one of $x$ or $y$ to get arbitrarily large as the other variable gets arbitrarily close to zero. Thus, $1$ is a local minimum value.

The following image is a graph of the paraboloid $f(x, y) = x^2 + y^2$. The blue curve represents the points for which our maximum/minimum problem is constrained, that is the set of $(x, y, z) \in \mathbb{R}^2$ such that $2xy = 1$. The blue dots represent the minimums of $f$ subject to the constraint $g$: Furthermore, the following image is a graph of some of the level curves of $f$ alongside the curve $g(x, y) = 1$. The blue points represent our points of interest, $\left ( \frac{1}{\sqrt{2}} , \frac{1}{\sqrt{2}} \right )$ and $\left ( -\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}} \right )$ that are contained in the domain of our function $f$: 