ConceptComplete

Lagrange Multipliers

Lagrange multipliers provide a method for finding extrema of a function subject to constraints. The key idea: at a constrained extremum, the gradient of the objective function is parallel to the gradient of the constraint. This reduces constrained optimization to solving a system of equations. Lagrange multipliers are ubiquitous in economics, physics, and machine learning.


Statement

Theorem10.1Lagrange Multipliers

To find the extrema of f(x)f(\mathbf{x}) subject to the constraint g(x)=0g(\mathbf{x}) = 0, solve the system

f=λg,g(x)=0\nabla f = \lambda \nabla g, \quad g(\mathbf{x}) = 0

for x\mathbf{x} and λ\lambda (the Lagrange multiplier). Solutions are candidates for constrained extrema.

RemarkGeometric interpretation

At a constrained extremum, f\nabla f must be perpendicular to the constraint manifold (otherwise, moving along the manifold would increase or decrease ff). Since g\nabla g is also perpendicular to the manifold, f\nabla f and g\nabla g are parallel: f=λg\nabla f = \lambda \nabla g.


Examples

ExampleMaximize xy subject to x² + y² = 1

Objective: f(x,y)=xyf(x, y) = xy. Constraint: g(x,y)=x2+y21=0g(x, y) = x^2 + y^2 - 1 = 0.

Lagrange condition: f=λg\nabla f = \lambda \nabla g gives (y,x)=λ(2x,2y)(y, x) = \lambda (2x, 2y), so y=2λxy = 2\lambda x and x=2λyx = 2\lambda y. Thus x=4λ2xx = 4\lambda^2 x, so either x=0x = 0 or λ2=1/4\lambda^2 = 1/4.

  • If λ=1/2\lambda = 1/2: y=xy = x, so 2x2=12x^2 = 1, giving (x,y)=(±1/2,±1/2)(x, y) = (\pm 1/\sqrt{2}, \pm 1/\sqrt{2}) with f=1/2f = 1/2 (maximum).
  • If λ=1/2\lambda = -1/2: y=xy = -x, giving f=1/2f = -1/2 (minimum).
ExampleDistance from origin to surface

Minimize f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2 subject to g(x,y,z)=x2+2y2+3z21=0g(x, y, z) = x^2 + 2y^2 + 3z^2 - 1 = 0 (ellipsoid). Lagrange: (2x,2y,2z)=λ(2x,4y,6z)(2x, 2y, 2z) = \lambda (2x, 4y, 6z). This gives x=λxx = \lambda x, y=2λyy = 2\lambda y, z=3λzz = 3\lambda z. Solutions occur when one variable is nonzero and others vanish, giving minimum distance along principal axes.


Multiple constraints

Theorem10.2Multiple constraints

To optimize ff subject to g1=0,,gk=0g_1 = 0, \ldots, g_k = 0, solve

f=λ1g1++λkgk,gi=0 for all i.\nabla f = \lambda_1 \nabla g_1 + \cdots + \lambda_k \nabla g_k, \quad g_i = 0 \text{ for all } i.

ExampleTwo constraints

Minimize f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2 subject to x+y+z=1x + y + z = 1 and x2+y2=1x^2 + y^2 = 1. Lagrange: f=λ1(1,1,1)+λ2(2x,2y,0)\nabla f = \lambda_1 (1, 1, 1) + \lambda_2 (2x, 2y, 0). Solving gives critical points.


Justification via Implicit Function Theorem

RemarkWhy Lagrange multipliers work

The Implicit Function Theorem guarantees that the constraint g(x)=0g(\mathbf{x}) = 0 locally defines a manifold MM. To optimize ff on MM, we need fM=0\nabla f|_M = 0 (the gradient restricted to MM). Since directions tangent to MM are perpendicular to g\nabla g, the condition f=λg\nabla f = \lambda \nabla g ensures fM=0\nabla f|_M = 0.


Summary

Lagrange multipliers for constrained optimization:

  • Solve f=λg\nabla f = \lambda \nabla g with g=0g = 0.
  • Geometric: f\nabla f parallel to g\nabla g at extrema.
  • Multiple constraints: f=λigi\nabla f = \sum \lambda_i \nabla g_i.
  • Justification: Implicit Function Theorem.

See Extrema and Implicit Function Theorem.