Lagrange Multipliers
Find constrained extrema using proportional gradients at regular points. Compare objective values and check endpoints or singular points separately.
What a learner can do afterwards
- Set up and solve multiplier equations, checking regularity and exceptional feasible points
- Explain regular tangency and interpret a multiplier using the stated constraint scale
- Compare the multiplier method with substituting the constraint directly
1 · Read
You have solved gradient-zero equations to find unconstrained candidates. For smooth f and g, a local extremum on g=c with grad g nonzero satisfies grad f=lambda grad g. In two variables solve fx=lambda gx, fy=lambda gy and g=c together. These equations give candidates; they do not by themselves classify them.
At a regular constraint point, grad g is normal to the constraint. At an extremum, the derivative of f along the constraint's tangent is zero. If grad f is also nonzero, the two level curves share a tangent. Their gradients are parallel, possibly in opposite directions. If grad f=0, lambda=0 satisfies the equation even when f has no regular level curve there.
For positive rectangle sides, maximise f=xy with g=2x+2y=P. The equations y=2lambda and x=2lambda give x=y=P/4. At P=24, the sides are 6 and the area is 36. Substitution gives xy=P²/16-(x-P/4)². The square is nonnegative, proving the maximum area is P²/16. The area tends to 0 as either side tends to 0.
For f=ax+by on x²+y²=R², take R>0 and (a,b) nonzero. Solve a=2lambda x, b=2lambda y and the circle equation. Lambda cannot be zero. The two candidates are R(a,b)/sqrt(a²+b²) and its negative. Evaluate f at both. This smooth circle is closed and bounded, so its global maximum and minimum occur among these candidates.
On the line x+y=b, substitute y=b-x. For f=x²+y², this gives x²+(b-x)²=2(x-b/2)²+b²/2. The square term is nonnegative, so the minimum is b²/2 at x=y=b/2. Multipliers give 2x=lambda and 2y=lambda, hence the same candidate. Completing the square proves it is a global minimum.
On x²+y²=R², solving for y gives y=+sqrt(R²-x²) and y=-sqrt(R²-x²), with -R<=x<=R. A substitution solution must cover both branches and their endpoints. Multiplier equations can avoid this branch split. Neither method removes the need to check all feasible cases.
For f=x²+y²+z² on ax+by+cz=d, with (a,b,c) nonzero, solve 2x=lambda a, 2y=lambda b and 2z=lambda c. The candidate is p=d(a,b,c)/(a²+b²+c²). Its value is d²/(a²+b²+c²). For any feasible point, expanding the sum of squared differences from p gives f minus this value. That sum is nonnegative, proving a global minimum.
A smooth objective has global extrema on a closed, bounded constraint curve. If grad g is nonzero everywhere, each extremum satisfies the multiplier equations. Find every solution and compare objective values. Comparing lambda values does not classify them. The unconstrained Hessian test does not settle behaviour along the constraint. On an unbounded feasible set, also examine behaviour at infinity.
Check endpoints, nonsmooth points and points with grad g=0 separately. On x+y=b with x,y>=0 and b>0, f=x has its minimum at endpoint (0,b). For g=(x-1)²+(y+1)²=0, the only feasible point is (1,-1). There grad g=0 and f=x has both extrema, but no lambda satisfies (1,0)=lambda(0,0).
Fix g=c and use grad f=lambda grad g. If a regular optimal point varies smoothly with c, its value V(c) satisfies V'(c)=lambda. A small level change h changes V by about lambda h. Lambda can be negative, so this need not be an improvement. Rewriting the same constraint as 2g=2c doubles its gradient and halves its multiplier. State the constraint's scale when interpreting lambda.
Solve the gradient equations with the constraint. Compare objective values, check exceptional points, and interpret lambda using the stated constraint scale.
Lesson, questions, worked solutions and flashcards written for this dataset. External records were studied for mathematical facts and question design.
Readings, practice questions, worked solutions and flashcards written for this dataset. Linked videos: Khan Academy, "Lagrange multipliers, using tangency to solve constrained optimization", "Lagrange multiplier example, part 1", and "Meaning of the Lagrange multiplier". Video license terms have not been verified.
More to read
Check the constraint before using multipliers
Write an equality constraint as g=c. Suppose f and g are smooth near a feasible point and grad g is nonzero there. The constraint then has a tangent, with grad g normal to it.
At a constrained local extremum, f has zero derivative along that tangent. In two variables, grad f must therefore be a scalar multiple of grad g, including the possibility that grad f is zero. Write grad f=lambda grad g and include g=c when solving.
The picture of two tangent level curves needs both gradients to be nonzero. A zero objective gradient can still satisfy the multiplier equation with lambda=0, even when its level set has no regular tangent.
A zero constraint gradient is different. The theorem does not require the multiplier equation at that point. Check such feasible points separately, along with endpoints and places where the functions are not smooth.
Classify extrema on the allowed set
The allowed points determine whether a candidate is an extremum. In the full plane, f=x²-y² has a saddle at the origin. On the constraint y=0, the same function becomes x² and has a minimum there. An unconstrained classification does not settle a constrained problem.
For a smooth objective on a closed, bounded constraint curve, a global maximum and minimum exist. If the constraint gradient is nonzero everywhere, these extrema satisfy the multiplier equations. Find every candidate and compare objective values.
Extra restrictions can introduce endpoints. These need separate checks. So do feasible points with zero constraint gradient and points where smoothness fails.
An unbounded feasible set needs more work. A candidate can be a global minimum without there being any global maximum. Study the objective along the whole feasible set, including behaviour as points move arbitrarily far away.
Substitution and multipliers
A line constraint often makes substitution short. From x+y=b, obtain y=b-x. The objective x²+y² becomes 2(x-b/2)²+b²/2. This formula proves its least value because the square cannot be negative. Checking a few sample points would not provide that proof.
Solving a circle constraint for y produces two square-root branches. Cover both branches and check their endpoints. Multiplier equations can avoid this branch split, but either method is valid when all cases are included.
In three variables, write three component equations. For a sum of squares constrained by ax+by+cz=d, with (a,b,c) nonzero, they make the candidate coordinates proportional to (a,b,c). If d=0, the unique minimum is at (0,0,0), so the coordinates are equal even when the coefficients differ. If d is nonzero, all three minimizing coordinates are equal exactly when a=b=c.
To verify the resulting minimum, expand the sum of squared differences from the candidate. The plane equation cancels the linear terms. What remains is the objective minus its candidate value, expressed as a sum of nonnegative squares.
Interpret lambda using the stated equation
Use the convention grad f=lambda grad g with constraint g=c. Suppose a regular optimal point p(c) varies smoothly with c. Its objective value is V(c)=f(p(c)).
Differentiate the constraint: grad g dot p'(c)=1. The chain rule also gives V'(c)=grad f dot p'(c). Substituting the multiplier equation yields V'(c)=lambda.
This is an instantaneous rate. For a small level change h, the value changes by about lambda h. Lambda can be negative or zero. Increasing an equality level need not improve the objective.
The equation's scale matters. Rewriting g=c as 2g=2c keeps the same feasible points but doubles the constraint gradient. The multiplier then halves.
For a rectangle with perimeter P, the greatest area is P²/16. Its derivative with respect to P is P/8. A multiplier for half-perimeter describes a rate with respect to a different changing quantity. Always state which constraint level is varying.
Explore more
2 · Watch
Take it off screen
Where it sits
Optional connections
This opens up
Nothing builds on it yet.
14 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.