# Lagrange Multipliers with Two Constraints Examples 3

Recall that if we want to find the extrema of the function $w = f(x, y, z)$ subject to the constraint equations $g(x, y, z) = C$ and $h(x, y, z) = D$ (provided that extrema exist and assuming that $\nabla g(x_0, y_0, z_0) \neq (0, 0, 0)$ and $\nabla h(x_0, y_0, z_0) \neq (0, 0, 0)$ where $(x_0, y_0, z_0)$ produces an extrema in $f$) then we ultimately need to solve the following system of equations for $x$, $y$ and $z$ with $\lambda$ and $\mu$ as the Lagrange multipliers for this system:

(1)

Let’s look at some more examples of using the method of Lagrange multipliers to solve problems involving two constraints.

## Example 1

**Find the maximum and minimum distance from the origin to the curve of intersection of the surfaces $z^2 = x^2 + y^2$ and $x – 2z = 3$.**

Note that the distance from a point the origin to a point $(x, y, z)$ in $\mathbb{R}^3$ is:

(2)

We can minimize this function by minimizing the function underneath the radical, that is, minimizing $f(x, y, z) = x^2 + y^2 + z^2$ subject to the constraint that our point $(x, y, z)$ be on both the surfaces $g(x, y, z) = x^2 + y^2 – z^2 = 0$ and $h(x, y, z) = x – 2z = 3$. In computing the necessary partial derivatives we have that:

(3)

From the second equation we immediately have that $\lambda = 1$ or $y = 0$.

Suppose that $\lambda = 1$. In directly substituting this into the equations above and we have that:

(4)

The first equation implies that $\mu = 0$, and so we have that:

(5)

The first equation above implies that $z = 0$, and from the third equation, this implies that $x = 3$. Plugging these values into equation 2 and we have that $9 + x^2 = 0$, so $x^2 = -9$ which cannot happen.

Now consider the case where $y = 0$. Then we have that:

(6)

Now the third equation implies that $x^2 = z^2$ so $x = \pm z$.

Suppose that $x = z$. Plugging this into equation 4 yields $x – 2x = 3$ which implies that $-x = 3$, so $x = -3$. Therefore a point of interest is $(-3, 0, -3)$.

Now suppose that $x = -z$. Plugging this into equation 4 yields $x + 2x = 3$ so $3x = 3$ which implies that $x = 1$. Therefore $(1, 0, -1)$ is a point of interest.

Thus $f(-3, 0, -3) = 18$ is our maximum, and $f(1, 0, -1)$ is our minimum value. Recall that $d = \sqrt{f(x, y, z)}$ and so the maximum distance from the origin to the curve of intersection of $g$ and $h$ is $\sqrt{18} = 3 \sqrt{2}$. Meanwhile, the minimum distance from the origin to the curve of intersection of $g$ and $h$ is $\sqrt{2}$.