Constraints and Lagrange Multipliers
Constraints and Lagrange Multipliers is the method for finding extrema (maxima/minima) of a function subject to one or more constraints . Key result: at a constrained extremum, the gradient of the objective is a linear combination of the constraint gradients, . Applies to optimization in economics, physics, engineering, machine learning, and any problem where variables are not free but tied together. Who/when: Joseph-Louis Lagrange, 1788, in Mécanique analytique.
At a constrained extremum, you cannot improve by moving along the constraint surface. This means the directional derivative of vanishes in every direction tangent to the surface. Equivalently, has no component along the surface — it must point entirely perpendicular to it. Since the constraint gradients span exactly that perpendicular (normal) space, must be a linear combination of them. The coefficients are the Lagrange multipliers.
Formal Statement
Given a smooth objective and constraint functions (with ), the problem is to find the extrema of subject to
Derivation hint: Each equation carves out an -dimensional hypersurface; their intersection is the -dimensional feasible set on which is optimized. Here , is the objective function, each is a constraint, and the feasible set is .
The Lagrangian is the auxiliary function of variables
Derivation hint: Subtracting encodes the constraints; differentiating in recovers , and in recovers the gradient condition. where the scalars are the Lagrange multipliers. The sign convention ( vs ) is arbitrary and only flips the sign of .
Let and be continuously differentiable near a point that is a local extremum of on . Suppose the constraint qualification holds: the gradients are linearly independent. Then there exist unique multipliers such that
Derivation hint: must be orthogonal to the tangent space ; this orthogonal complement is spanned by the . Equivalently, is a stationary point of the Lagrangian: and , giving the system
Derivation hint: The -equations give [3] component-wise; the -equations restore the original constraints [1].
Why It Holds
We prove the single-constraint case (); the general case follows by the same argument applied to the tangent space.
Step 1 — Parametrize the constraint surface. Near , let be any smooth curve lying in with . Since , we have for all .
Step 2 — Differentiate the constraint. Apply the chain rule at :
Derivation hint: , so its derivative is zero; chain rule turns this into a dot product. Hence every tangent vector. So is orthogonal to every tangent direction — i.e. orthogonal to the tangent space .
Step 3 — Use that is an extremum. The function has a local extremum at , so :
Derivation hint: A differentiable function at an interior extremum has zero derivative; chain rule converts to the gradient dotted with the tangent. So is also orthogonal to every tangent direction.
Step 4 — Conclude collinearity. Both and lie in the one-dimensional orthogonal complement of (since the surface is -dimensional, its normal space is one-dimensional). Two vectors in a 1-D space are parallel: there exists a scalar with
Derivation hint: by the constraint qualification spans the normal line; lies on that line, so it is a scalar multiple. provided , which is exactly the constraint qualification.
∎Born in Turin as Giuseppe Lodovico Lagrangia, Lagrange reformulated all of mechanics in Mécanique analytique (1788) with the boast that the book contained not a single diagram — everything followed from the calculus of variations and his multipliers. He introduced the multiplier technique precisely to handle constraints in mechanical systems (rigid rods, surfaces of contact) without solving for the constraint forces explicitly. The multipliers, it turned out, are the constraint forces. Lagrange succeeded Euler at the Berlin Academy and later became a founding professor at the École Polytechnique in Paris.
Building Intuition
Picture standing on a hillside ( = altitude) but confined to a winding path (). To find the highest point of your path, walk along it: whenever the path still climbs or descends, you are not at the top. You stop where the path is momentarily level — where the slope of the terrain has no component along the path. At that instant the steepest-ascent direction points straight across the path, perpendicular to it. Since also points perpendicular to the path (it's the normal to the constraint curve), the two arrows line up. The multiplier is just the ratio of their lengths. A second picture: tangent level curves. The constrained extremum occurs where a level curve of is tangent to the constraint curve. If they crossed transversally, you could slide along the constraint into a higher level curve. Tangency forces the gradients (both normal to their respective curves) to be parallel.
Worked Examples
Given: Maximize the area of a rectangle with corners inscribed in the circle of radius , so the constraint is , with .
Step 1 — Gradients. , and .
Step 2 — Lagrange equations :
Step 3 — Eliminate . From the first, ; from the second, . Setting equal: (positive root).
Step 4 — Apply the constraint. .
Step 5 — Evaluate. Area . (It's a square — as expected.)
Given: Find the point on the plane nearest the origin. Minimize squared distance subject to .
Step 1 — Gradients. , .
Step 2 — Lagrange equations :
Step 3 — Substitute into the constraint.
Step 4 — Recover the point. .
Step 5 — Distance. .
(Note: the answer is — consistent with the point-to-plane formula.)
Common Misconceptions
The method finds critical points, not maxima. Equation [3] is a necessary condition for an interior extremum, not sufficient. Solving the Lagrange system gives candidates; you must then compare -values among them (and check boundaries/non-smooth points) or use a bordered Hessian second-order test to classify each as max, min, or saddle. On a compact feasible set, the extreme value theorem guarantees the global max and min occur among the critical points, so comparison alone suffices.
The sign and size of are meaningful. is not arbitrary slack. By the envelope theorem, where the constraint is : it is the rate at which the optimal value improves as the constraint is loosened — the shadow price.
Failure when the constraint qualification breaks. Minimize subject to (a cusp curve). The minimum of on the curve is at the origin , since . But there — the constraint gradient vanishes. The Lagrange equation becomes , which has no solution for any . The genuine constrained minimum is invisible to the method because the constraint qualification (nonvanishing, linearly independent ) fails at the cusp. Lesson: always check that the constraint gradients are independent at candidate points, and inspect singular points of the feasible set separately.
Connections
The method is the equality-constrained special case of the <span class="wiki-link-missing">Karush-Kuhn-Tucker Conditions</span>, which add inequality constraints with sign-restricted multipliers and complementary slackness. It is the finite-dimensional shadow of the <a class="wiki-link" href="/wiki/euler-lagrange-equation">Euler-Lagrange Equation</a> in the Calculus of Variations, where one extremizes a functional subject to integral or pointwise constraints (here becomes a function). Geometrically it rests on <span class="wiki-link-missing">Gradient and Directional Derivative</span> (the gradient is normal to level sets) and the <span class="wiki-link-missing">Tangent Space</span> of a manifold. In mechanics, the multipliers reappear as constraint forces in Lagrangian Mechanics, and in convex optimization they generate the <span class="wiki-link-missing">Lagrangian Duality</span> that underpins linear and quadratic programming.
Real-World Applications
Historical Development
Subtleties & Limits
When does the method guarantee a global optimum? For general nonconvex or nonconvex feasible sets, the Lagrange conditions only locate stationary points, and there may be exponentially many; certifying global optimality is NP-hard in general. Convexity rescues us: if is convex and the feasible set convex, any KKT point is a global minimizer, and strong duality holds under a constraint qualification (e.g. Slater's condition). Open and active areas include: tight duality gaps for nonconvex problems (e.g. when does the semidefinite relaxation match the true optimum?), multiplier theory on non-smooth or stratified feasible sets (where constraint qualification fails on a measure-zero singular set, as in the cusp counterexample), and robust/distributionally-robust optimization where the multipliers themselves become uncertain objects. In infinite dimensions, the existence and regularity of multipliers (Lagrange multiplier rules in Banach spaces) require subtle hypotheses and remain a fertile research domain.
See Also
Gradient and Directional Derivative · Karush-Kuhn-Tucker Conditions · Lagrangian Duality · Calculus of Variations · Euler-Lagrange Equation · Convex Optimization · Lagrangian Mechanics · Bordered Hessian Test