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.

A constrained optimization problem asks for the extreme values of a smooth function when is restricted to a surface (or curve) defined by equations . The method of Lagrange multipliers transforms this into an unconstrained problem by introducing auxiliary scalars (the multipliers) and solving a system in which the objective's gradient is balanced against the constraint gradients. It matters because almost every real optimization — minimizing cost subject to a budget, finding the shape of a hanging chain, maximizing entropy subject to fixed energy — is constrained, not free. The surprising fact: the multiplier is not mere bookkeeping; it equals the sensitivity of the optimal value to a relaxation of the constraint (the "shadow price"), giving it deep physical and economic meaning.

The Core Insight

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

Constrained Optimization Problem

Given a smooth objective and constraint functions (with ), the problem is to find the extrema of subject to

1
⟳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

The Lagrangian is the auxiliary function of variables

2
⟳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 .

Method of Lagrange Multipliers

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

3
⟳ 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

4
⟳The -equations give [3] component-wise; the -equations restore the original constraints [1].

Why It Holds

Gradient Orthogonality at a Constrained Extremum

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 :
5
⟳, 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 :
6
⟳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
7
⟳ 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.

Joseph-Louis Lagrange | 1736–1813

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.

At a constrained maximum, the level curve of $f$ kisses the constraint curve; the gradients align.

level sets of f g(x)=0 x* ∇f ∇g ∇f = λ∇g at the tangency point x*

Worked Examples

Rectangle of Maximum Area Inscribed in a Circle

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.)

Closest Point on a Plane to the Origin

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 Karush-Kuhn-Tucker Conditions, which add inequality constraints with sign-restricted multipliers and complementary slackness. It is the finite-dimensional shadow of the Euler-Lagrange Equation in the Calculus of Variations, where one extremizes a functional subject to integral or pointwise constraints (here becomes a function). Geometrically it rests on Gradient and Directional Derivative (the gradient is normal to level sets) and the Tangent Space of a manifold. In mechanics, the multipliers reappear as constraint forces in Lagrangian Mechanics, and in convex optimization they generate the Lagrangian Duality that underpins linear and quadratic programming.

Real-World Applications

  1. Economics — Utility maximization. A consumer maximizes utility subject to the budget line . The multiplier is the marginal utility of income (extra happiness per extra dollar).
  2. Thermodynamics — Maximum entropy. Deriving the Boltzmann distribution: maximize entropy subject to and . The multiplier on the energy constraint is — inverse temperature.
  3. Machine learning — SVMs and regularization. Support vector machines solve a constrained quadratic program; the multipliers identify the support vectors. Penalized regression (ridge/LASSO) is dual to a constrained least-squares problem.
  4. Engineering — Structural design. Minimizing material/weight subject to stress or deflection constraints; multipliers give sensitivity of optimal weight to each constraint (used in topology optimization).
  5. Physics — The catenary. A hanging chain minimizes potential energy subject to fixed length; the multiplier sets the curve's tension scale, yielding .
  6. Operations research — Resource allocation. Maximizing output subject to limited labor and capital; multipliers are shadow prices guiding where to invest the marginal resource.
  7. Statistics — Method of maximum likelihood with constraints, and deriving estimators (e.g. the constrained MLE for multinomial probabilities) via the normalization constraint .

Historical Development

  • 1755 — At age 19, Lagrange writes to Euler outlining the analytic () calculus of variations, the seedbed of the multiplier idea.
  • 1760s — Euler and Lagrange develop variational methods; constraints handled ad hoc.
  • 1788 — Lagrange publishes Mécanique analytique, systematically introducing multipliers to enforce mechanical constraints, identifying them with constraint forces.
  • 1797 — Lagrange's Théorie des fonctions analytiques refines the analytic foundations of the differential calculus he uses.
  • 1813 — Lagrange dies in Paris; his methods are by now standard in continental mechanics.
  • 1870s–1900s — The geometric reformulation (gradients normal to level surfaces, tangent spaces) is sharpened with the rise of vector analysis (Gibbs, Heaviside).
  • 1939 — William Karush, in his master's thesis, derives optimality conditions with inequality constraints — generalizing Lagrange.
  • 1951 — Harold Kuhn and Albert Tucker independently rediscover and popularize these conditions; the modern KKT framework is born.
  • 1950s–60s — Linear/nonlinear programming and duality theory (Dantzig, von Neumann, Kuhn–Tucker) place multipliers at the center of optimization.

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

Before this

Where this leads