Skip to content
Part IA Michaelmas, Lent, Easter Term

Lagrange Multipliers

Problem Statement

Find the stationary points of f(x,y)f(x, y) subject to constraint g(x,y)=0g(x, y) = 0.

The constraint restricts us to a curve (or surface), so we seek constrained extrema rather than global ones.


Geometric Intuition

At a constrained stationary point:

  • f\nabla f is perpendicular to the level curve of ff passing through that point
  • g\nabla g is perpendicular to the constraint curve g=0g = 0
  • For an extremum, these level curves must be tangent

Level curves of f, constraint curve g=0, showing where ∇f and ∇g are parallel at optimum

Therefore: f\nabla f and g\nabla g are parallel at the extremum.

f=λg\nabla f = \lambda \nabla g

where λ\lambda is called the Lagrange multiplier.


Method

To find stationary points of f(x,y)f(x, y) subject to g(x,y)=0g(x, y) = 0:

  1. Form the Lagrangian: L(x,y,λ)=f(x,y)λg(x,y)\mathcal{L}(x, y, \lambda) = f(x, y) - \lambda g(x, y)

  2. Solve the system:

    • Lx=0\frac{\partial \mathcal{L}}{\partial x} = 0
    • Ly=0\frac{\partial \mathcal{L}}{\partial y} = 0
    • Lλ=0\frac{\partial \mathcal{L}}{\partial \lambda} = 0 (which is just g(x,y)=0g(x, y) = 0)
  3. Evaluate ff at each solution to classify.


Example

Maximise f(x,y)=xyf(x, y) = xy subject to x2+y2=1x^2 + y^2 = 1.

Setup: L=xyλ(x2+y21)\mathcal{L} = xy - \lambda(x^2 + y^2 - 1)

Equations:

  • Lx=y2λx=0\frac{\partial \mathcal{L}}{\partial x} = y - 2\lambda x = 0 …(i)
  • Ly=x2λy=0\frac{\partial \mathcal{L}}{\partial y} = x - 2\lambda y = 0 …(ii)
  • Lλ=(x2+y21)=0\frac{\partial \mathcal{L}}{\partial \lambda} = -(x^2 + y^2 - 1) = 0 …(iii)

Solve: From (i): y=2λxy = 2\lambda x

Substitute into (ii): x2λ(2λx)=x(14λ2)=0x - 2\lambda(2\lambda x) = x(1 - 4\lambda^2) = 0

So x=0x = 0 or λ=±12\lambda = \pm\frac{1}{2}.

If x=0x = 0: Then y=±1y = \pm 1 from (iii). f=0f = 0.

If λ=12\lambda = \frac{1}{2}: From (i), y=xy = x. From (iii), x2+x2=1x^2 + x^2 = 1, so x=±12x = \pm\frac{1}{\sqrt{2}}.

Points: (12,12)(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}) and (12,12)(-\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}) with f=12f = \frac{1}{2}.

If λ=12\lambda = -\frac{1}{2}: y=xy = -x. Points: (12,12)(\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}) and (12,12)(-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}) with f=12f = -\frac{1}{2}.

Maximum occurs when x=y=±12x = y = \pm\frac{1}{\sqrt{2}}, giving f=12f = \frac{1}{2}.


Multiple Constraints

For constraints g1(x,y)=0g_1(x, y) = 0 and g2(x,y)=0g_2(x, y) = 0:

f=λ1g1+λ2g2\nabla f = \lambda_1 \nabla g_1 + \lambda_2 \nabla g_2

The Lagrangian becomes:

L=fλ1g1λ2g2\mathcal{L} = f - \lambda_1 g_1 - \lambda_2 g_2


Interpretation of λ\lambda

Adding a small change ε\varepsilon to the constraint:

g(x,y)=εg(x, y) = \varepsilon

The optimal value f(ε)f^*(\varepsilon) satisfies:

dfdε=λ\frac{df^*}{d\varepsilon} = \lambda

λ\lambda measures the sensitivity: how much the optimal value changes per unit change in the constraint.

Example: In economics, if ff is profit and gg is a budget constraint, λ\lambda is the marginal value of relaxing the budget.


When Lagrange Multipliers are Needed

  • Constraints cannot be easily substituted into the objective
  • Multiple constraints interact
  • Need to understand the “cost” of constraints (via λ\lambda)
  • Generalising to higher dimensions (constrained on surfaces)

When a single constraint can be substituted, that’s often simpler. Lagrange multipliers are a systematic method for complex situations.


Why This Method Matters

  • Optimisation: Constraints arise naturally in real problems
  • Economics: Utility maximisation under budget constraints
  • Physics: Equilibrium under constraints (frictionless motion)
  • Machine learning: Regularisation as constrained optimisation