Math 241: Multivariable , Lecture 15 Lagrange Multipliers.

go.illinois.edu/math241fa17

Wednesday, October 4th, 2017

go.illinois.edu/math241fa17. Math 241: Problem of the day

Problem: Find the absolute maximum and minimum value of the f (x, y) = x3 − x + y 2x + y + 2 on the unit disk D = {(x, y) | x2 + y 2 ≤ 1}. What guarantees that the max and min exist?

go.illinois.edu/math241fa17. ∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the vector is

go.illinois.edu/math241fa17. −1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

go.illinois.edu/math241fa17. (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x .

go.illinois.edu/math241fa17. Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.)

go.illinois.edu/math241fa17. 2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

go.illinois.edu/math241fa17. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0.

go.illinois.edu/math241fa17. So we need to look at the boundary!

Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points.

go.illinois.edu/math241fa17. Solution Part 1: Critical points

If f (x, y) = x3 − x + y 2x + y + 2 the gradient vector is

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

−1 If this is the zero vector we get 2xy + 1 = 0, or y = 2x . (Note that x nor y can be zero, so dividing by x or y is no problem.) Substitute in the first component to get 1 1 3x2 − 1 + = 0 =⇒ 3x4 − x2 + = 0. 4x2 4

2 2 1 Put z = x , get 3z − z + 4 = 0. The discriminant b2 − 4ac = 1 − 3 = −2, so there are NO critical points. So we need to look at the boundary!

go.illinois.edu/math241fa17. Look on the boundary for points where Du~f (a, b) = 0, for u~ to the boundary. In other words we want ∇f (a, b) · u~ = 0. But we know that u~ satisfies ∇g(a, b) · u~ = 0. So we want

∇f (a, b) = λ∇g(a, b) (*)

for some constant λ, called the Lagrange multiplier. At such points where (∗) holds, the level curves of f and of g are tangent.

Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary.

go.illinois.edu/math241fa17. In other words we want ∇f (a, b) · u~ = 0. But we know that u~ satisfies ∇g(a, b) · u~ = 0. So we want

∇f (a, b) = λ∇g(a, b) (*)

for some constant λ, called the Lagrange multiplier. At such points where (∗) holds, the level curves of f and of g are tangent.

Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary. Look on the boundary for points where Du~f (a, b) = 0, for u~ tangent to the boundary.

go.illinois.edu/math241fa17. But we know that u~ satisfies ∇g(a, b) · u~ = 0. So we want

∇f (a, b) = λ∇g(a, b) (*)

for some constant λ, called the Lagrange multiplier. At such points where (∗) holds, the level curves of f and of g are tangent.

Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary. Look on the boundary for points where Du~f (a, b) = 0, for u~ tangent to the boundary. In other words we want ∇f (a, b) · u~ = 0.

go.illinois.edu/math241fa17. So we want

∇f (a, b) = λ∇g(a, b) (*)

for some constant λ, called the Lagrange multiplier. At such points where (∗) holds, the level curves of f and of g are tangent.

Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary. Look on the boundary for points where Du~f (a, b) = 0, for u~ tangent to the boundary. In other words we want ∇f (a, b) · u~ = 0. But we know that u~ satisfies ∇g(a, b) · u~ = 0.

go.illinois.edu/math241fa17. At such points where (∗) holds, the level curves of f and of g are tangent.

Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary. Look on the boundary for points where Du~f (a, b) = 0, for u~ tangent to the boundary. In other words we want ∇f (a, b) · u~ = 0. But we know that u~ satisfies ∇g(a, b) · u~ = 0. So we want

∇f (a, b) = λ∇g(a, b) (*) for some constant λ, called the Lagrange multiplier.

go.illinois.edu/math241fa17. Lagrange multipliers Idea

IDEA: Function f (x, y) is defined on a domain with boundary given by g(x, y) = 0. Want: absolute max/min of f on boundary. Look on the boundary for points where Du~f (a, b) = 0, for u~ tangent to the boundary. In other words we want ∇f (a, b) · u~ = 0. But we know that u~ satisfies ∇g(a, b) · u~ = 0. So we want

∇f (a, b) = λ∇g(a, b) (*) for some constant λ, called the Lagrange multiplier. At such points where (∗) holds, the level curves of f and of g are tangent.

go.illinois.edu/math241fa17. ∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

Solution (0, 1) or (0, −1).Max: f (0, 1) = 3, Min: f (0, −1) = 1.

Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

go.illinois.edu/math241fa17. Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

Solution (0, 1) or (0, −1).Max: f (0, 1) = 3, Min: f (0, −1) = 1.

Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

go.illinois.edu/math241fa17. Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

Solution (0, 1) or (0, −1).Max: f (0, 1) = 3, Min: f (0, −1) = 1.

Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

go.illinois.edu/math241fa17. Solution (0, 1) or (0, −1).Max: f (0, 1) = 3, Min: f (0, −1) = 1.

Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

go.illinois.edu/math241fa17. Max: f (0, 1) = 3, Min: f (0, −1) = 1.

Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

Solution (0, 1) or (0, −1).

go.illinois.edu/math241fa17. Solution Part 2: Boundary

f (x, y) = x3 − x + y 2x + y + 2 with gradient vector

∇f (x, y) = h3x2 − 1 + y 2, 2yx + 1i

Boundary g(x, y) = x2 + y 2 = 1

∇g = h2x, 2yi

Then ∇f = λ∇g gives

3x2 − 1 + y 2 = λ2x, 2yx + 1 = λ2y

Solution (0, 1) or (0, −1).Max: f (0, 1) = 3, Min: f (0, −1) = 1.

go.illinois.edu/math241fa17. Find absolute max/min of f (x, y) = x2 − y 2 on D = {(x, y) | x2 + y 2 ≤ 1}. Critical points on D: ∇f = h2x, −2yi = h0, 0i ⇒ (x, y) = (0, 0), and f (0, 0) = 0.

We can parameterize the boundary, and solve... in general this can be hard....

Finding max/min on boundary.

go.illinois.edu/math241fa17. Critical points on D: ∇f = h2x, −2yi = h0, 0i ⇒ (x, y) = (0, 0), and f (0, 0) = 0.

We can parameterize the boundary, and solve... in general this can be hard....

Finding max/min on boundary.

Find absolute max/min of f (x, y) = x2 − y 2 on D = {(x, y) | x2 + y 2 ≤ 1}.

go.illinois.edu/math241fa17. ⇒ (x, y) = (0, 0), and f (0, 0) = 0.

We can parameterize the boundary, and solve... in general this can be hard....

Finding max/min on boundary.

Find absolute max/min of f (x, y) = x2 − y 2 on D = {(x, y) | x2 + y 2 ≤ 1}. Critical points on D: ∇f = h2x, −2yi = h0, 0i

go.illinois.edu/math241fa17. We can parameterize the boundary, and solve... in general this can be hard....

Finding max/min on boundary.

Find absolute max/min of f (x, y) = x2 − y 2 on D = {(x, y) | x2 + y 2 ≤ 1}. Critical points on D: ∇f = h2x, −2yi = h0, 0i ⇒ (x, y) = (0, 0), and f (0, 0) = 0.

go.illinois.edu/math241fa17. Finding max/min on boundary.

Find absolute max/min of f (x, y) = x2 − y 2 on D = {(x, y) | x2 + y 2 ≤ 1}. Critical points on D: ∇f = h2x, −2yi = h0, 0i ⇒ (x, y) = (0, 0), and f (0, 0) = 0.

We can parameterize the boundary, and solve... in general this can be hard....

go.illinois.edu/math241fa17. Level curves of f (x, y) = x2 − y 2 and boundary circle of disk.

Look for points of tangency between circle and level curves:

Tangent level curves

go.illinois.edu/math241fa17. Look for points of tangency between circle and level curves:

Tangent level curves

Level curves of f (x, y) = x2 − y 2 and boundary circle of disk.

go.illinois.edu/math241fa17. Tangent level curves

Level curves of f (x, y) = x2 − y 2 and boundary circle of disk.

Look for points of tangency between circle and level curves:

go.illinois.edu/math241fa17. Max/min of f (x, y) constrained to g(x, y) = 0.

Question: How do we find tangencies without picture?

Answer: Find solutions to system:

 ∇f (x, y) = λ∇g(x, y) g(x, y) = 0

Call a solution (x, y) of this system a critical point of f constrained by g = 0. (we don’t typically care what λ is...)

Finding tangencies

go.illinois.edu/math241fa17. Question: How do we find tangencies without picture?

Answer: Find solutions to system:

 ∇f (x, y) = λ∇g(x, y) g(x, y) = 0

Call a solution (x, y) of this system a critical point of f constrained by g = 0. (we don’t typically care what λ is...)

Finding tangencies

Max/min of f (x, y) constrained to g(x, y) = 0.

go.illinois.edu/math241fa17. Answer: Find solutions to system:

 ∇f (x, y) = λ∇g(x, y) g(x, y) = 0

Call a solution (x, y) of this system a critical point of f constrained by g = 0. (we don’t typically care what λ is...)

Finding tangencies

Max/min of f (x, y) constrained to g(x, y) = 0.

Question: How do we find tangencies without picture?

go.illinois.edu/math241fa17. Call a solution (x, y) of this system a critical point of f constrained by g = 0. (we don’t typically care what λ is...)

Finding tangencies

Max/min of f (x, y) constrained to g(x, y) = 0.

Question: How do we find tangencies without picture?

Answer: Find solutions to system:

 ∇f (x, y) = λ∇g(x, y) g(x, y) = 0

go.illinois.edu/math241fa17. Finding tangencies

Max/min of f (x, y) constrained to g(x, y) = 0.

Question: How do we find tangencies without picture?

Answer: Find solutions to system:

 ∇f (x, y) = λ∇g(x, y) g(x, y) = 0

Call a solution (x, y) of this system a critical point of f constrained by g = 0. (we don’t typically care what λ is...)

go.illinois.edu/math241fa17. Method of Lagrange multipliers

Theorem. Suppose ∇g 6= 0 on the set

n C = {(x1,..., xn) ∈ R | g(x1,..., xn) = 0} and suppose f (x1,..., xn) is differentiable. Then if f attains a max/min value on C, these must occur at critical points of f constrained to C; that is, points (x1,..., xn) such that  ∇f (x1,..., xn) = λ∇g(x1,..., xn) g(x1,..., xn) = 0 for some real number λ.

go.illinois.edu/math241fa17.