The Lagrange Method

Econ 50: Section 2

Constrained Optimization

The Lagrange Procedure

  • Set up a "Lagrangian" which is a single expression combining the objective function and the constraint.
  • The Lagrangian is a function of the \(n\) choice variables and a constant called the Lagrange multiplier, written \(\lambda\)
  • Take the partial derivatives with respect to each of these variables and set them equal to zero; this gives you a system of \(n+1\) equations with \(n+1\) unknowns.
  • Solving these gives you both the optimal choice and a value of \(\lambda\) which gives a measure of the relationship between the objective function and the constraint.

Canonical Constrained Optimization Problem

f(x_1,x_2)
\text{s.t. }
g(x_1,x_2) = k
k - g(x_1,x_2) = 0
\mathcal{L}(x_1,x_2,\lambda)=
\displaystyle{\max_{x_1,x_2}}
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)

Suppose \(g(x_1,x_2)\) is monotonic (increasing in both \(x_1\) and \(x_2\)).

Then \(k - g(x_1,x_2)\) is negative if you're outside of the constraint,
positive if you're inside the constraint,
and zero if you're along the constraint.

OBJECTIVE

FUNCTION

CONSTRAINT

\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

3 equations, 3 unknowns

 

Solve for \(x_1\), \(x_2\), and \(\lambda\)

\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

3 equations, 3 unknowns

 

Solve for \(x_1\), \(x_2\), and \(\lambda\)

x^{1 \over 2}y
\text{s.t. }
2x+y=12
\displaystyle{\max_{x,y}}
\mathcal{L}(x,y,\lambda)=
12-2x-y
+ \lambda\ (
)
x^{1 \over 2}y
\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

3 equations, 3 unknowns

 

Solve for \(x_1\), \(x_2\), and \(\lambda\)

x^2y^2
\text{s.t. }
x^2 + y^2 = 4
\displaystyle{\max_{x,y}}
\mathcal{L}(x,y,\lambda)=
4-x^2-y^2
+ \lambda\ (
)
x^2y^2
\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

3 equations, 3 unknowns

 

Solve for \(x_1\), \(x_2\), and \(\lambda\)

WL
\text{s.t. }
2W + L = F
\displaystyle{\max_{W,L}}
\mathcal{L}(W,L,\lambda)=
F - 2W - L
+ \lambda\ (
)
WL
\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

3 equations, 3 unknowns

 

Solve for \(x_1\), \(x_2\), and \(\lambda\)

2x_1^{1\over} + x_2^{1 \over 2}
\text{s.t. }
2x_1 + {3\over2}x_2 = 12
\displaystyle{\max_{x_1,x_2}}
\mathcal{L}(x_1,x_2,\lambda)=
12 - 2x_1 - {3 \over 2}x_2
+ \lambda\ (
)
2x_1^{1\over} + x_2^{1 \over 2}

How does the Lagrange method work?

It finds the point along the constraint where the
level set of the objective function passing through that point
is tangent to the constraint

\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0
\displaystyle{\Rightarrow \lambda\ = {{\partial f /\partial x_1} \over {\partial g/\partial x_1}}}
\displaystyle{\Rightarrow \lambda\ = {{\partial f /\partial x_2} \over {\partial g/\partial x_2}}}
\displaystyle{\Rightarrow {{\partial f /\partial x_1} \over {\partial f/\partial x_2}} = {{\partial g /\partial x_1} \over {\partial g/\partial x_2}}}

TANGENCY
CONDITION

CONSTRAINT

Example: Fence Problem

You have 40 feet of fence and want to enclose the maximum possible area.

Example: Fence Problem

You have 40 feet of fence and want to enclose the maximum possible area.

f(x_1,x_2)
\text{s.t. }
g(x_1,x_2) = k
k - g(x_1,x_2) = 0
\mathcal{L}(L,W,\lambda)=
\displaystyle{\max_{x_1,x_2}}
L \times W
40 - 2L - 2W
+ \lambda\ (
)

OBJECTIVE

FUNCTION

CONSTRAINT

L \times W
40 - 2L - 2W = 0
2L + 2W = 40
\mathcal{L}(L,W,\lambda)=
L \times W
40 - 2L - 2W
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial L} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial W} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
W
L
40 - 2L - 2W
=0
- \lambda\ \times
2
2
- \lambda\ \times
=0
=0
\displaystyle{\Rightarrow \lambda\ = {W \over 2}}
\displaystyle{\Rightarrow \lambda\ = {L \over 2}}
W = L

TANGENCY
CONDITION

CONSTRAINT

2L + 2W = 40
W = L

TANGENCY
CONDITION

CONSTRAINT

2L + 2W = 40

Meaning of the Lagrange multiplier

Suppose you have \(F\) feet of fence instead of 40.

\displaystyle{\partial \mathcal{L} \over \partial L} =
\displaystyle{\partial \mathcal{L} \over \partial W} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
W
L
F - 2L - 2W
=0
- \lambda\ \times
2
2
- \lambda\ \times
=0
=0
\displaystyle{\Rightarrow \lambda\ = {W \over 2}}
\displaystyle{\Rightarrow \lambda\ = {L \over 2}}
W = L

TANGENCY
CONDITION

CONSTRAINT

2L + 2W = F

SOLUTIONS

L^* = {F \over 4}
W^* = {F \over 4}
\lambda^* = {F \over 8}

Meaning of the Lagrange multiplier

Suppose you have \(F\) feet of fence instead of 40.

SOLUTIONS

L^* = {F \over 4}
W^* = {F \over 4}
\lambda^* = {F \over 8}

Maximum enclosable area as a function of F:

A^*(F) = L^*(F) \times W^*(F) = {F \over 4} \times {F \over 4} = {F^2 \over 16}

Econ 50 | Fall 25 | Section 2

By Chris Makler

Econ 50 | Fall 25 | Section 2

The Mathematics of Optimization

  • 112