Lagrange Multipliers
Optimizing a function subject to equality constraints. The method of Lagrange multipliers, derived via the implicit function theorem. Extends to multiple constraints with a full-rank Jacobian condition.
We now turn from unconstrained optimization (where the critical point condition is ) to constrained optimization, where we optimize subject to one or more constraints of the form . The method of Lagrange multipliers expresses the necessary condition for an interior constrained extremum as a geometric statement: at such a point, the gradient of must lie in the span of the gradients of the constraints. We derive the single-constraint theorem from the implicit function theorem, generalize to several constraints with a full-rank Jacobian hypothesis, and illustrate with worked examples.
Constrained Extrema
Let open, , and . We say is a constrained extremum for (subject to the constraint ) iff the restriction has a relative extremum at . That is, there is a neighbourhood of in such that (or ) for all .
Intuition: A constrained extremum need not be an unconstrained extremum. The constraint set is typically a level set of one or more functions ; the question is how behaves when we are forced to stay on . For example, the function has no unconstrained maximum on , but it has a constrained maximum on the unit circle .
Geometric Motivation
Suppose is a smooth curve in and has a constrained extremum at . Let be a smooth path with . Then has a relative extremum at , so by the chain rule and the single-variable Fermat theorem, Thus is orthogonal to the tangent direction to the curve at . On the other hand, is always orthogonal to the level curve at (assuming ). Since both and are orthogonal to the tangent line to at , and the tangent line is one-dimensional, the two gradients must be parallel: The scalar is called the Lagrange multiplier.
Maximize subject to the constraint .
Compute and . The Lagrange condition at an extremum on the circle reads Intersecting with the constraint gives the two candidate points and , where takes the values and respectively.
Global extrema. The constraint set is compact (closed and bounded in ) and is continuous, so by the extreme value theorem attains both a global max and a global min on . Any such global extremum must satisfy the Lagrange condition (since everywhere on ), so the candidates above include them. Therefore the maximum is at and the minimum is at .
Global versus local extrema. The Lagrange condition is necessary for a constrained extremum (given the regularity ), not sufficient. To confirm a candidate is a global max or min, we typically argue via compactness: if is compact and continuous, attains its extrema, and these extrema must appear among the Lagrange candidates. For non-compact constraint sets, additional reasoning (coercivity, asymptotic behaviour) is needed to decide global extrema.
Single-Constraint Lagrange Multiplier Theorem
We now prove this rigorously using the implicit function theorem.
Let open and be functions. Let with and . Set . If , subject to the constraint , has a relative extremum at , then there exists such that
Intuition: The hypothesis guarantees that the constraint set is a smooth -dimensional manifold near (by the implicit function theorem). When this fails, the geometric argument breaks down and the conclusion need not hold. The scalar measures the proportionality between and at .
The Lagrangian
It is often convenient to combine the necessary condition into a single system of equations via an auxiliary function.
Given , the Lagrangian is the function defined by
Intuition: Setting recovers . Setting recovers the constraint . So finding the constrained critical points reduces to finding the unconstrained critical points of .
Find the maximum and minimum of subject to .
Set . Form the Lagrangian and solve : The first-order conditions are:
Solving the first three for , , in terms of :
Substituting into the constraint:
The last equation gives , so . The corresponding points are (when ) and (when ). Evaluating, Since the sphere is compact and is continuous, the maximum and minimum are attained: the maximum is at and the minimum is at .
Multiple Constraints: The Rank Condition
We now generalize to constraints with . The key hypothesis is that the Jacobian of has full rank at the critical point.
Let open and of class . Let and let be . Set Suppose , subject to the constraints , has a constrained relative extremum at , and the Jacobian matrix has rank . Then there exist such that
Intuition: The full-rank hypothesis says the constraints are independent at : the gradient vectors are linearly independent, so the constraint set is locally a smooth -dimensional manifold. The conclusion asserts that lies in the span of these gradient vectors — equivalently, in the normal space to at .
Why the rank condition matters: If the Jacobian fails to have rank at , then the conclusion may fail even for smooth data. A classical example is with constraints and . The constraint set is , at which the Jacobian has rank (not ). The gradient of at the origin is , but the gradients of at the origin are and — neither direction contains in its span.
The Multi-Constraint Lagrangian
The Lagrangian for the problem of optimizing subject to is the function of variables
Intuition: Solving (in all variables) is equivalent to the system: together with the constraint equations . At solutions where has rank , these are the candidate constrained extrema.
Worked Example with Two Constraints
Consider the curve in defined as the intersection of the surfaces and . Find the distance from the origin to the closest point on .
Setup. Minimizing the distance is equivalent to minimizing its square. Let and set The Lagrangian is
The Lagrange system. Setting gives:
- (constraint 1)
- (constraint 2) The second equation gives , so either or .
Case . The first equation becomes , so . The third becomes , so . The constraint gives , and the constraint gives , which has no real solution. No solutions.
Case , . Rewrite the first and third equations as The fourth becomes , i.e. .
Subcase . Then , so and . The point is .
Subcase . Then , so and . The point is .
Rank check. At both points, At , this is , and the first and third columns give , so rank . At , the matrix is and the first/third columns have , so rank as well.
Values. The constrained maximum of is at (farthest point on ) and the constrained minimum is at . The distance from the origin to the closest point on is .
Intuition: The Lagrange system is typically nonlinear, and real-world problems require careful case analysis. The rank check is essential: without it, the Lagrange conditions are not guaranteed to hold at the extremum. Once the candidates are in hand, plug them into to identify which is the max and which is the min; use compactness of the constraint set (when available) or direct estimation to confirm that the extrema are attained.