Lagrange with Two Constraints
Textbook Reference
| Primary source | OpenStax Calculus Volume 3, Section 4.8: “Lagrange Multipliers” |
| Direct link | https://openstax.org/books/calculus-volume-3/pages/4-8-lagrange-multipliers |
| Textbook used in class | Stewart, Calculus, Section 14.8: “Lagrange Multipliers” (Example 5) |
Quick Reference
Problem: Optimize $f(x,y,z)$ subject to $g(x,y,z) = c_1$ AND $h(x,y,z) = c_2$.
Method: Solve: $$\nabla f = \lambda \nabla g + \mu \nabla h, \quad g = c_1, \quad h = c_2.$$
This gives 5 equations in 5 unknowns: $x, y, z, \lambda, \mu$.
Motivation
Two constraints in three variables define a curve (the intersection of two surfaces). Optimizing a function along this curve requires two multipliers: one for each constraint. The condition $\nabla f = \lambda \nabla g + \mu \nabla h$ says that at a constrained extremum, $\nabla f$ lies in the plane spanned by $\nabla g$ and $\nabla h$ (the normals to the two constraint surfaces). Moving along the constraint curve (perpendicular to both normals) cannot improve $f$.
Key Concept
The system $\nabla f = \lambda \nabla g + \mu \nabla h$ expands to three scalar equations (one per component), plus the two constraints, for a total of five equations in five unknowns. The algebra is often substantial; careful organization is essential.
Worked Example
Find the maximum and minimum values of $f(x,y,z) = x + 2y$ on the intersection of the plane $x + y + z = 1$ and the cylinder $x^2 + y^2 = 1$. (Stewart 14.8, Example 5.)
Constraints: $g(x,y,z) = x+y+z = 1$, $h(x,y,z) = x^2+y^2 = 1$.
$\nabla f = \langle 1, 2, 0\rangle$, $\nabla g = \langle 1,1,1\rangle$, $\nabla h = \langle 2x, 2y, 0\rangle$.
Equations:
- $1 = \lambda + 2\lambda\mu x \to $ (more carefully) $1 = \lambda(1) + \mu(2x)$
- $2 = \lambda(1) + \mu(2y)$
- $0 = \lambda(1) + \mu(0) \implies \lambda = 0$
From $\lambda = 0$: equations become $1 = 2\mu x$ and $2 = 2\mu y$.
So $\mu x = 1/2$ and $\mu y = 1$, giving $y = 2x$.
From $h$: $x^2 + (2x)^2 = 1 \implies 5x^2 = 1 \implies x = \pm 1/\sqrt{5}$.
If $x = 1/\sqrt{5}$, $y = 2/\sqrt{5}$, $z = 1 - 3/\sqrt{5}$. $f = 1/\sqrt{5} + 4/\sqrt{5} = 5/\sqrt{5} = \sqrt{5}$.
If $x = -1/\sqrt{5}$, $y = -2/\sqrt{5}$, $z = 1 + 3/\sqrt{5}$. $f = -1/\sqrt{5} - 4/\sqrt{5} = -\sqrt{5}$.
Maximum: $\sqrt{5}$. Minimum: $-\sqrt{5}$.
with two constraints, you only need one multiplier. Each constraint requires its own multiplier. With constraints $g = c_1$ and $h = c_2$, the condition is $\nabla f = \lambda \nabla g + \mu \nabla h$, with BOTH $\lambda$ and $\mu$. Using only one multiplier (like $\nabla f = \lambda(\nabla g + \nabla h)$) is incorrect: it imposes the extra assumption $\lambda = \mu$, which is not generally true and will miss solutions.
Leveled Practice
Problem 1. Find the minimum of $f(x,y,z) = x^2+y^2+z^2$ subject to $x+y+z = 1$ and $x + 2y + 3z = 6$.
Show answer
$\nabla f = \langle 2x,2y,2z\rangle$, $\nabla g = \langle 1,1,1\rangle$, $\nabla h = \langle 1,2,3\rangle$.
System: $2x = \lambda+\mu$, $2y = \lambda+2\mu$, $2z = \lambda+3\mu$.
Subtract successive pairs: $2(y-x) = \mu \implies \mu = 2(y-x)$; $2(z-y) = \mu \implies y-x = z-y$, so $x, y, z$ form an arithmetic sequence: $y-x = z-y = d$ for some $d$.
Let $x = a$, $y = a+d$, $z = a+2d$. Constraints:
- $3a+3d = 1$
- $3a+8d = 6 \implies 5d = 5 \implies d = 1$, $a = -2/3$.
$x = -2/3$, $y = 1/3$, $z = 4/3$.
$f_{\min} = 4/9 + 1/9 + 16/9 = 21/9 = 7/3$.