Recommended resources
The freely available resources this lesson will direct you to.
- Calculus 3 Lecture 13.9: Constrained Optimization with LaGrange Multiplierswww.youtube.com
- Lec 13: Lagrange multipliers | MIT 18.02 Multivariable Calculus, Fall 2007www.youtube.com
- RES.18-001 Calculus (f17), Chapter 13: Partial Derivativesocw.mit.edu
- 4.8 Lagrange Multipliers - Calculus Volume 3openstax.org
Hello! Last lesson, you classified stationary points by examining the Hessian in every direction. A constraint changes which directions matter: a point can minimize a function among allowed positions even when its gradient is not zero. This lesson develops Lagrange multipliers to find those points, then shows how to decide which candidates are minima or maxima.
Extremes when movement is restricted
Suppose you want to optimize , but only at points satisfying
The equation describes the feasible curve. At a constrained extremum, moving a little along that curve cannot change to first order. Moving away from the curve is irrelevant, however steeply changes there.
The diagram shows the idea. The orange constraint line touches one of the blue level curves of . A level curve that crosses the line would not generally mark an extremum: you could move along the line to reach values on either side of it.

Watch the indicated parts of Lec 13: Lagrange multipliers from MIT OpenCourseWare. The lecturer uses a distance-to-the-origin problem to turn this picture into equations. Notice that the objective’s level curves and the constraint are different objects, even though both are drawn as curves in the same plane.
Lec 13: Lagrange multipliers | MIT 18.02 Multivariable Calculus, Fall 2007
Watch Lec 13: Lagrange multipliers from MIT OpenCourseWare for the geometric reason gradients become proportional and for the resulting system of equations.
In level-curve geometry, follow the shrinking circles until one touches the feasible hyperbola. Then watch the multiplier equations; pay particular attention to why the original constraint must remain an equation in the system.
At a tangency, the two curves have the same tangent line. Gradients are perpendicular to their respective level curves, so the gradients must be parallel. We express that condition with a scalar , called a Lagrange multiplier:
In components, these are three equations for , , and :
Parallel includes the possibility that the gradients point in opposite directions, so need not be positive. It can also be zero if at a feasible point.
Why the equation works
The geometric picture has a useful chain-rule interpretation. Parametrize a smooth portion of the constraint by . Because every point on this path is feasible, , and therefore
Thus the path’s tangent is perpendicular to . At a local maximum or minimum of along the same path,
Both gradients are consequently perpendicular to the feasible tangent. In two dimensions, if , they must be scalar multiples. The same reasoning works on a smooth constraint surface in three dimensions: at an extremum, is perpendicular to every feasible tangent direction.
For another presentation of this argument, watch the later portion of the MIT lecture. The important phrase is unchanged to first order: need not remain constant as you walk along the constraint away from an extremum.
Lec 13: Lagrange multipliers | MIT 18.02 Multivariable Calculus, Fall 2007
Return to the MIT OpenCourseWare lecture for its directional-derivative justification of the multiplier condition.
Watch feasible directions. Focus on why the derivative of f vanishes along every allowed tangent at an extremum, rather than in every direction in the surrounding space.
A compact way to organize the equations is to define the Lagrangian
Setting its three first partial derivatives to zero reproduces the two gradient equations and the constraint. This is an equation-generating device: making stationary does not, by itself, prove that has a constrained minimum or maximum.
Solving a constrained minimum
Consider the quadratic energy-like function
subject to . Without the restriction, is smallest at , but that point is infeasible. Put . The multiplier equations are
The first two components give and , so . The constraint then gives , hence
We have found a candidate. Here we can prove it is the global constrained minimum by substituting :
This check also shows why there is no maximum: the feasible line extends without bound, and the energy grows without bound along it. The multiplier equations locate stationary behavior on the constraint; they do not promise that both kinds of extremum exist.
The multiplier has one more interpretation when the constraint value varies. Replacing by gives the minimum . Its derivative at is , exactly the multiplier found above. With our sign convention , this sensitivity relation holds when the optimum varies smoothly:
Finding all candidates before comparing them
On a closed feasible curve, there may be several multiplier solutions. To see why keeping every algebraic branch matters, find the extrema of
With , the equations are
Neither nor can be zero in a solution: if one were zero, the gradient equations would force the other to be zero, contradicting the constraint. Substituting one gradient equation into the other therefore gives .
For , we have , yielding and , both with . For , we have , yielding and , both with . Thus the constrained maximum is and the constrained minimum is .
Why is comparing these four values enough here? The feasible circle is closed and bounded, is continuous, and its constraint gradient never vanishes on the circle. Global extrema therefore exist and must appear among the multiplier candidates. On a noncompact constraint such as a line, existence needs a separate argument—as the preceding example showed.
Two constraints and the boundaries of the method
For a function of three variables restricted by two equations, a feasible tangent must respect both. At a regular constrained extremum, the objective gradient can be a combination of the two constraint gradients:
There is one multiplier per equality constraint. Read the selected passages from Gilbert Strang’s Calculus, Chapter 13, Section 13.7, for the Lagrangian formulation and the geometry of two constraints. Its worked three-dimensional example finds the closest point to the origin on the intersection of two planes.
RES.18-001 Calculus (f17), Chapter 13: Partial Derivatives
Read the selected parts of Section 13.7 from Gilbert Strang’s Calculus to connect the equations used above with their Lagrangian form, then see how a second equality constraint changes them.
On p. 593, in “13.7 Constraints and Lagrange Multipliers,” find the paragraph beginning “We have lost fx D 0 and fy D 0.” Read the Lagrangian passage from there through the explanation that the change in f is zero in an allowed direction. Then, under “MAXIMUM AND MINIMUM WITH TWO CONSTRAINTS” on pp. 593–594, read the two-constraint method through the solution of Example 3. Focus on why two constraint gradients span the directions normal to their intersection.
For a short calculation with two constraints, minimize subject to and . The equations become
The constraint , together with the first two components, gives . The remaining components then imply ; their sum is , so the candidate is , where . It is a global minimum: for any feasible displacement from , the constraint requires , and
Finally, remember what the multiplier equations assume. The usual one-constraint condition requires a regular feasible curve or surface, with at the candidate. If that gradient vanishes, inspect the point separately; the parallel-gradient argument may fail. Likewise, if a problem restricts you to only part of a curve, check its endpoints as well. These are reasons to treat the equations as a systematic way to find candidates, not as a substitute for checking the feasible set.
Looking ahead
For an equality-constrained extremum, write down the objective and every constraint, solve the gradient equations together with those constraints, and then evaluate and justify the resulting candidates. The central change from last lesson is that first-order change must vanish only in feasible directions; the ordinary unconstrained Hessian test does not settle what happens along a constraint.
Next, you will turn from restricting variables to changing them in double and triple integrals, where the Jacobian determinant accounts for how a coordinate transformation scales area and volume.