Constrained
Optimization
Learn to find extreme values of multivariable functions subject to constraints using Lagrange multipliers.
What Is Constrained Optimization?
In many real-world problems, we want to maximize or minimize a function \( f(x, y) \) but we aren't free to choose any \( (x, y) \). We must satisfy a constraint \( g(x, y) = k \).
The Geometric Intuition
The constraint \( g(x,y) = k \) defines a curve in the \( xy \)-plane. The objective \( f(x,y) = c \) defines level curves. We seek the level curve of \( f \) that just touches the constraint curve: they are tangent.
Why Gradients Must Be Parallel
If \( \nabla f \) had any component along the constraint curve, you could move along the constraint to increase (or decrease) \( f \). At an extremum, the only way \( f \) stops changing along the constraint is if \( \nabla f \) is perpendicular to the constraint curve.
But \( \nabla g \) is also perpendicular to the constraint curve (gradients are normal to level curves). So at the extremum:
The Method of Lagrange Multipliers
To find extrema of \( f(x,y) \) subject to \( g(x,y) = k \), solve the system:
In component form for two variables:
The Lagrangian Function
An equivalent (and elegant) way to state the method is to define the Lagrangian:
Then the necessary conditions are simply that all partial derivatives of \( \mathcal{L} \) vanish:
Unconstrained vs. Constrained
| Unconstrained | Constrained (Lagrange) | |
|---|---|---|
| Condition | \( \nabla f = \mathbf{0} \) | \( \nabla f = \lambda \nabla g \) |
| Search domain | All of \( \mathbb{R}^n \) | The level set \( g = k \) |
| Unknowns | \( n \) variables | \( n + 1 \) (includes \( \lambda \)) |
| Second-order test | Hessian of \( f \) | Bordered Hessian |
| Typical result | Interior critical point | Point on the constraint curve |
Interpreting \( \lambda \): the Multiplier
The value \( \lambda \) is not just an algebraic trick. It has a powerful economic interpretation:
Step-by-Step Method
Example 1: Rectangle on a Circle
Problem: Maximize \( f(x,y) = xy \) subject to \( g(x,y) = x^2 + y^2 = 1 \).
Example 1: Solution
Example 2: Cost Minimization
Problem: Minimize \( f(x,y) = x^2 + 2y^2 \) subject to \( g(x,y) = x + y = 3 \).
Example 2: Solution
Example 3: Three Variables
Problem: Find the point on the plane \( x + 2y + 3z = 6 \) closest to the origin. Equivalently, minimize \( f = x^2 + y^2 + z^2 \) subject to \( g = x + 2y + 3z = 6 \).
Common Mistakes
Summary and Quick Reference
| Concept | Key Formula / Idea |
|---|---|
| Lagrange Condition | \( \nabla f = \lambda \nabla g \) |
| Lagrangian | \( \mathcal{L} = f - \lambda(g - k) \) |
| Number of Equations | \( n + 1 \) (for \( n \) variables, 1 constraint) |
| Meaning of \( \lambda \) | Sensitivity: \( \Delta f^* \approx \lambda \Delta k \) |
| Max or Min? | Compare \( f \) at all candidates |
| Multiple Constraints | \( \nabla f = \lambda_1 \nabla g_1 + \lambda_2 \nabla g_2 + \cdots \) |
Question 1 of 5
To find extrema of \( f(x,y) \) subject to \( g(x,y) = k \) using Lagrange multipliers, which condition must hold at the optimum?
Question 2 of 5
Maximize \( f(x,y) = 3x + 4y \) subject to \( x^2 + y^2 = 1 \). What is the maximum value?
Question 3 of 5
If the Lagrange multiplier is \( \lambda = 4 \) and the constraint \( g(x,y) = k \) is changed from \( k = 10 \) to \( k = 10.5 \), approximately how much does the optimal value of \( f \) change?
Question 4 of 5
When minimizing \( f(x,y) = x^2 + y^2 \) subject to \( x + y = 4 \), what are the values of \( x \) and \( y \) at the minimum?
Question 5 of 5
The Lagrangian for optimizing \( f(x,y) \) subject to \( g(x,y) = k \) is defined as: