Steply

Max and min of f(x, y) = x + 2y on x^2 + y^2 = 5

Step by step, with the reason for every step · Lagrange multipliers · Calculus 3

Step by step

The question

Question: find the maximum and minimum of f(x, y) = x + 2y with x² + y² = 5.

f(x, y) = x + 2y, x2 + y2 = 5

1 Set up the equations

At the best point, the level curve of f just touches the curve.

So the two gradients point the same way.

The rule: ∇f = λ∇g.

λ is the Greek letter lambda.

It is just a number.

∇f = λ ∇g

The curve is g = 5, with g(x, y) = x² + y².

g(x, y) = x2 + y2

The x parts: f_x = λ g_x.

f_x is 1, g_x is 2x.

① 1 = λ × 2x

The y parts: f_y = λ g_y.

f_y is 2, g_y is 2y.

② 2 = λ × 2y

And ③: stay on the curve.

③ x2 + y2 = 5

Careful!

The curve's own equation is part of the system.

Without it, we cannot find x and y.

Careful: three equations: never forget ③

2 Solve the equations

From ①: 1 = λ × 2x, so λ is 1/2x.

λ = 12x

From ②: λ is 2/2y.

λ = 22y

Both are λ, so they are equal.

12x = 22y

Cross-multiply and tidy up: y = 2x.

y = 2x

Put it into ③.

x² + (2x)² = 5

Add the x² terms and divide: x² = 1.

x² = 1

Two numbers: x = 1 or −1.

Then y follows: two points.

x = 1 or −1

3 Compare the values

At (1, 2), f is 5.

f(1, 2) = 5

At (−1, −2), f is −5.

f(−1, −2) = −5

The bigger value is the maximum, the smaller one the minimum.

= max 5 at (1, 2), min −5 at (−1, −2)

4 Check

Let's check on the xy grid.

The orange circle is the curve ③.

The blue lines are where f is 5 and −5.

Each just touches the circle.

Another point on the circle gives 4.47: between the two.

Right!

f(0, 2.24) = 4.47

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 5 at (1, 2), min −5 at (−1, −2)

Your turn

Try this one yourself, then check:

Find the maximum and minimum of f(x, y) = 2x + y, x2 + y2 = 5
Show the answer
max 5 at (2, 1), min −5 at (−2, −1)

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →