Multivariable-Calculus · Unit 12 · Video 1 · Interactive Practice

Lagrange Multipliers: Tangent Level Curves and ∇f = λ∇g

IKey Formulas

FormulaNameClosest point of xy=3xy = 3 to the origin
min / max f(x,y)f(x, y) subject to g(x,y)=cg(x, y) = cConstrained optimizationf=x2+y2f = x^2 + y^2,  g=xy=3\ g = xy = 3
∇f=λ∇g\nabla f = \lambda \nabla gLagrange condition (parallel gradients)⟨2x,2y⟩=λ⟨y,x⟩\langle 2x, 2y \rangle = \lambda \langle y, x \rangle
fx=λgxf_x = \lambda g_x,  fy=λgy\ f_y = \lambda g_y,  g=c\ g = cLagrange system: 3 equations, 3 unknowns x,y,λx, y, \lambda2x=λy2x = \lambda y,  2y=λx\ 2y = \lambda x,  xy=3\ xy = 3

Key Insight: At a constrained minimum or maximum the level curve of ff is tangent to the constraint curve g=cg = c. Tangent curves share their normal direction, and the gradients are normals, so ∇f\nabla f and ∇g\nabla g are parallel there. What ff and gg share is a direction, not a value.

IIVisualization 1 — Shrinking the Level Circle

Lowering the level cc of f=x2+y2f = x^2 + y^2 shrinks its circle until it can no longer reach xy=3xy = 3.

IIIVisualization 2 — Where the Gradients Line Up

On xy=3xy = 3, ∇f=⟨2x,2y⟩\nabla f = \langle 2x, 2y \rangle and ∇g=⟨y,x⟩\nabla g = \langle y, x \rangle are parallel only where the level circle is tangent.

IVVisualization 3 — Elimination Finds the Same Point

Substituting y=3/xy = 3/x turns ff into x2+9/x2x^2 + 9/x^2, whose minimum sits exactly at the point of tangency.

💡 Elimination needed xy=3xy = 3 to be solvable for yy; the system ∇f=λ∇g\nabla f = \lambda \nabla g, g=cg = c needs no such step, so it still works when the constraint cannot be solved for any variable.

VQuiz Questions

Problem 1 · Write the Lagrange System

Given: maximize f(x,y)=xyf(x, y) = xy subject to x2+4y2=8x^2 + 4y^2 = 8 — which system do Lagrange multipliers give?

✅ Correct! ∇f=⟨y,x⟩\nabla f = \langle y, x \rangle and ∇g=⟨2x,8y⟩\nabla g = \langle 2x, 8y \rangle; matching components and adding the constraint gives three equations in x,y,λx, y, \lambda.
❌ Not quite. This sets ∇f=∇g\nabla f = \nabla g. The gradients only need to be parallel, so one is a multiple λ\lambda of the other — their lengths can differ.
❌ Missing an equation. These two equations only say the gradients are parallel: two equations in three unknowns x,y,λx, y, \lambda. The point must also lie on the constraint x2+4y2=8x^2 + 4y^2 = 8.
❌ Check ∇f\nabla f. For f=xyf = xy, fx=yf_x = y (differentiate with yy held fixed) and fy=xf_y = x — not xx and yy.
❌ Not quite. Compute ∇f\nabla f and ∇g\nabla g, match components in ∇f=λ∇g\nabla f = \lambda \nabla g, then add g=cg = c.
Show solution

Partial derivatives:

f=xy:fx=y,  fy=xg=x2+4y2:gx=2x,  gy=8yf = xy:\quad f_x = y,\ \ f_y = x \qquad g = x^2 + 4y^2:\quad g_x = 2x,\ \ g_y = 8y

Matching components of ∇f=λ∇g\nabla f = \lambda \nabla g and adding the constraint:

{y=2λxx=8λyx2+4y2=8\begin{cases} y = 2\lambda x \\ x = 8\lambda y \\ x^2 + 4y^2 = 8 \end{cases}

The first two equations say the gradients are parallel; the third keeps the point on the ellipse. That is three equations in the three unknowns xx, yy, λ\lambda.

Problem 2 · What the Two Functions Share

Given: PP is the point where the smallest level circle of f=x2+y2f = x^2 + y^2 touches the hyperbola g=xy=3g = xy = 3 — which statement holds at PP?

✅ Correct! The circle is tangent to the hyperbola at PP, so their normals — the two gradients — are parallel.
❌ That is an unconstrained critical point. ∇f=⟨2x,2y⟩\nabla f = \langle 2x, 2y \rangle vanishes only at the origin, which is not on xy=3xy = 3. Critical points of ff ignore the constraint.
❌ Values are not shared. g(P)=3g(P) = 3 because PP is on the hyperbola, but f(P)f(P) is the squared distance to the origin — the unknown we are looking for. It turns out to be 66, not 33.
❌ Parallel, not equal. The gradients need not have the same length: at P=(3,3)P = (\sqrt{3}, \sqrt{3}), ∇f=⟨23,23⟩\nabla f = \langle 2\sqrt{3}, 2\sqrt{3} \rangle is twice ∇g=⟨3,3⟩\nabla g = \langle \sqrt{3}, \sqrt{3} \rangle.
Show solution

At the limiting level the circle touches the hyperbola without crossing it, so the two curves are tangent at PP. Tangent curves have the same normal direction, and ∇f\nabla f is normal to the circle while ∇g\nabla g is normal to the hyperbola g=3g = 3. Hence the gradients are parallel:

∇f(P)=λ ∇g(P).\nabla f(P) = \lambda\, \nabla g(P).

Neither (a), (b) nor (d) is forced: ∇f=0⃗\nabla f = \vec 0 only at the origin; f(P)f(P) is not known in advance (it is 66); and at P=(3,3)P = (\sqrt3, \sqrt3) the gradients differ in length by the factor λ=2\lambda = 2.

Problem 3 · Test a Candidate Point

Given: f(x,y)=xyf(x, y) = xy on the constraint x2+4y2=8x^2 + 4y^2 = 8 and the point P=(2,1)P = (2, 1), which lies on it since 4+4=84 + 4 = 8 — find ∇g(P)\nabla g(P) and the multiplier λ\lambda with ∇f(P)=λ∇g(P)\nabla f(P) = \lambda \nabla g(P).

What is ∇g(P)?

What is λ?

✅ Correct! ∇f(P)=⟨1,2⟩=14⟨4,8⟩\nabla f(P) = \langle 1, 2 \rangle = \tfrac14 \langle 4, 8 \rangle, so the gradients are parallel at PP and (2,1)(2, 1) satisfies the Lagrange system with λ=14\lambda = \tfrac14.
❌ Check ∇g\nabla g. g=x2+4y2g = x^2 + 4y^2 has gx=2xg_x = 2x and gy=8yg_y = 8y; evaluate both at (2,1)(2, 1).
❌ Upside down. ⟨4,8⟩=4⟨1,2⟩\langle 4, 8 \rangle = 4 \langle 1, 2 \rangle says ∇g=4∇f\nabla g = 4\nabla f. The multiplier goes on ∇g\nabla g: ∇f=λ∇g\nabla f = \lambda \nabla g.
❌ Check the sign. ⟨1,2⟩\langle 1, 2 \rangle and ⟨4,8⟩\langle 4, 8 \rangle point the same way, so λ\lambda is positive.
❌ Not quite. Find the number that multiplies ∇g(P)=⟨4,8⟩\nabla g(P) = \langle 4, 8 \rangle to give ∇f(P)=⟨1,2⟩\nabla f(P) = \langle 1, 2 \rangle.
Show solution

Gradients at P=(2,1)P = (2, 1):

∇f=⟨y,x⟩=⟨1,2⟩,∇g=⟨2x,8y⟩=⟨4,8⟩\nabla f = \langle y, x \rangle = \langle 1, 2 \rangle, \qquad \nabla g = \langle 2x, 8y \rangle = \langle 4, 8 \rangle

Multiplier: both components must give the same λ\lambda:

1=λ⋅4,2=λ⋅8⟹λ=141 = \lambda \cdot 4,\quad 2 = \lambda \cdot 8 \quad\Longrightarrow\quad \lambda = \tfrac{1}{4}

Together with 22+4⋅12=82^2 + 4 \cdot 1^2 = 8, all three Lagrange equations hold, so (2,1)(2, 1) is a solution of the system (here f=2f = 2, the maximum of xyxy on the ellipse).

Problem 4 · Three Variables: Closest Point of a Plane

Given: minimize f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2 subject to g(x,y,z)=x+y+z=3g(x, y, z) = x + y + z = 3 — count the Lagrange equations and unknowns, and find λ\lambda at the closest point (1,1,1)(1, 1, 1).

How many equations in how many unknowns?

What is λ at (1, 1, 1)?

✅ Correct! fx=λgxf_x = \lambda g_x, fy=λgyf_y = \lambda g_y, fz=λgzf_z = \lambda g_z and g=3g = 3 make four equations in x,y,z,λx, y, z, \lambda; at (1,1,1)(1, 1, 1), ∇f=⟨2,2,2⟩=2⟨1,1,1⟩\nabla f = \langle 2, 2, 2 \rangle = 2 \langle 1, 1, 1 \rangle.
❌ The multiplier is an unknown too. λ\lambda is not given in advance, so the unknowns are x,y,z,λx, y, z, \lambda — and the constraint adds a fourth equation.
❌ Missing the constraint. The three component equations of ∇f=λ∇g\nabla f = \lambda \nabla g say only "parallel"; the point must also satisfy x+y+z=3x + y + z = 3.
❌ Not quite. One equation per component of ∇f=λ∇g\nabla f = \lambda \nabla g, plus the constraint; unknowns are the coordinates plus λ\lambda.
❌ Upside down. ∇g=12∇f\nabla g = \tfrac12 \nabla f, but the condition is ∇f=λ∇g\nabla f = \lambda \nabla g.
❌ Check the direction. ∇f\nabla f points away from the origin and ∇g=⟨1,1,1⟩\nabla g = \langle 1, 1, 1 \rangle points toward larger x+y+zx + y + z — at (1,1,1)(1, 1, 1) these are the same direction, so λ>0\lambda > 0.
❌ That is the constraint value cc. λ\lambda compares gradients, not values: ⟨2,2,2⟩=λ⟨1,1,1⟩\langle 2, 2, 2 \rangle = \lambda \langle 1, 1, 1 \rangle.
❌ Not quite. Evaluate ∇f=⟨2x,2y,2z⟩\nabla f = \langle 2x, 2y, 2z \rangle at (1,1,1)(1, 1, 1) and compare with ∇g=⟨1,1,1⟩\nabla g = \langle 1, 1, 1 \rangle.
Show solution

The system. ∇f=⟨2x,2y,2z⟩\nabla f = \langle 2x, 2y, 2z \rangle and ∇g=⟨1,1,1⟩\nabla g = \langle 1, 1, 1 \rangle, so

{2x=λ2y=λ2z=λx+y+z=3\begin{cases} 2x = \lambda \\ 2y = \lambda \\ 2z = \lambda \\ x + y + z = 3 \end{cases}

Four equations in the four unknowns xx, yy, zz, λ\lambda.

The multiplier. At (1,1,1)(1, 1, 1) (which satisfies 1+1+1=31 + 1 + 1 = 3): ∇f=⟨2,2,2⟩=2⟨1,1,1⟩=2∇g\nabla f = \langle 2, 2, 2 \rangle = 2\langle 1, 1, 1 \rangle = 2\nabla g, so λ=2\lambda = 2. It is positive because both gradients point the same way — away from the origin, toward larger x+y+zx + y + z.

Solved: 0 / 4