Lagrange
Multipliers
Master the technique for optimizing \( f(x,y) \) subject to equality constraints \( g(x,y) = c \): where gradients align and extrema live.
Why Constrained Optimization?
In many real problems you cannot freely choose every variable: you have a budget, a resource limit, or a geometric boundary. You want to maximize or minimize some objective \( f(x,y) \) while staying on a curve \( g(x,y) = c \).
The Geometric Idea
Level curves of \( f \) are contours where \( f(x,y) = k \). The constraint \( g(x,y) = c \) is another curve. At an extremum on the constraint, a level curve of \( f \) is tangent to the constraint curve: their gradients are parallel.
Gradients Parallel Means What?
Two vectors are parallel when one is a scalar multiple of the other. If \(\nabla f\) is parallel to \(\nabla g\), then there exists a scalar \(\lambda\) such that:
If \(\nabla f\) were not parallel to \(\nabla g\), then \(\nabla f\) would have a component along the constraint curve, meaning you could move along the constraint and increase \( f \): not an extremum.
The Lagrange Condition
\(\nabla f(x_0,y_0) = \lambda\,\nabla g(x_0,y_0)\)
Extension to Three Variables
The method extends naturally. To optimize \( f(x,y,z) \) subject to \( g(x,y,z)=c \), solve the system:
Constrained vs Unconstrained
| Unconstrained | Lagrange (Constrained) | |
|---|---|---|
| Condition | \(\nabla f = \mathbf{0}\) | \(\nabla f = \lambda\,\nabla g\) |
| Variables | \(x, y\) (or \(x,y,z\)) | \(x, y, \lambda\) (or \(x,y,z,\lambda\)) |
| Domain | All of \(\mathbb{R}^n\) | On the surface \(g = c\) |
| Test for min/max | Second-derivative test (Hessian) | Bordered Hessian or compare values |
| Typical uses | Free optimization | Budget, boundary, resource constraints |
Step-by-Step Method
Example 1: Rectangle Area
Problem: Maximize \( f(x,y) = xy \) subject to \( g(x,y) = 2x + 2y = 40 \).
Example 1: Visualized
Example 2: Extrema on a Circle
Problem: Find the extrema of \( f(x,y) = x^2 + 2y^2 \) on the circle \( x^2 + y^2 = 1 \).
Example 2: Visualized
Example 3: Three Variables
Problem: Find the minimum of \( f(x,y,z)=x^2+y^2+z^2 \) subject to \( x+y+z=3 \).
What Does \(\lambda\) Mean?
The multiplier \(\lambda\) has a powerful interpretation: it measures the sensitivity of the optimal value to changes in the constraint.
Common Mistakes
Summary Checklist
| Step | Action | Result |
|---|---|---|
| 1 | Compute \(\nabla f\) and \(\nabla g\) | Gradient vectors |
| 2 | Set \(\nabla f = \lambda \nabla g\) | \(n\) component equations |
| 3 | Include \(g = c\) | \(n+1\) equations total |
| 4 | Solve (factor, substitute) | Candidate points + \(\lambda\) |
| 5 | Evaluate \(f\) at all candidates | Identify max and min |
Question 1 of 5
At a constrained extremum using Lagrange multipliers, which condition must hold?
Question 2 of 5
To optimize \( f(x,y) \) subject to \( g(x,y) = c \) using Lagrange multipliers, how many equations do you solve?
Question 3 of 5
Find the maximum of \( f(x,y) = xy \) subject to \( x + y = 10 \).
Question 4 of 5
The Lagrange multiplier \(\lambda\) can be interpreted as:
Question 5 of 5
Find the minimum of \( f(x,y,z) = x^2 + y^2 + z^2 \) subject to \( x + y + z = 6 \).