Steply

Lagrange multipliers

Calculus 3 · 20 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Set up the equations
  2. Solve the equations
  3. Compare the values
  4. Check

The steps for Max of f(x, y) = xy with x + y = 10. Every solution names its steps, so you always know what comes next.

Worked examples

Max of f(x, y) = xy with x + y = 10 Easy

The question

Question: find the maximum of f(x, y) = xy with x + y = 10.

f(x, y) = xy, x + y = 10

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 = 10, with g(x, y) = x + y.

g(x, y) = x + y

The x parts: f_x = λ g_x.

f_x is y, g_x is 1.

① y = λ

The y parts: f_y = λ g_y.

f_y is x, g_y is 1.

② x = λ

And ③: stay on the curve.

③ x + y = 10

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 ①: λ is y.

λ = y

From ②: λ is x.

λ = x

Both are λ, so they are equal.

y = x

Tidy it up: y = x.

y = x

Put it into ③.

x + (x) = 10

Open the bracket and add the like terms.

2x = 10

Divide by 2: x = 5.

x = 5

Then y = x gives y = 5.

y = 5

3 Compare the values

At (5, 5), f is 25.

f(5, 5) = 25

There is one point, so it gives the maximum: 25.

= max 25 at (5, 5)

4 Check

Let's check on the xy grid.

The orange line is the curve ③: x + y = 10.

The blue curve is where f is 25.

It just touches the line at the point.

Another point on the line, (7, 3), gives 21.

That is smaller, as a maximum needs.

Right!

another point on the line: f(7, 3) = 21

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 25 at (5, 5)

▶ Watch it solved

Max of f(x, y) = xy with 3x + y = 18 Medium

The question

Question: find the maximum of f(x, y) = xy with 3x + y = 18.

f(x, y) = xy, 3x + y = 18

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 = 18, with g(x, y) = 3x + y.

g(x, y) = 3x + y

The x parts: f_x = λ g_x.

f_x is y, g_x is 3.

① y = λ × 3

The y parts: f_y = λ g_y.

f_y is x, g_y is 1.

② x = λ

And ③: stay on the curve.

③ 3x + y = 18

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 ①: λ is y/3.

λ = y3

From ②: λ is x.

λ = x

Both are λ, so they are equal.

y3 = x

Tidy it up: y = 3x.

y = 3x

Put it into ③.

3x + (3x) = 18

Open the bracket and add the like terms.

6x = 18

Divide by 6: x = 3.

x = 3

Then y = 3x gives y = 9.

y = 9

3 Compare the values

At (3, 9), f is 27.

f(3, 9) = 27

There is one point, so it gives the maximum: 27.

= max 27 at (3, 9)

4 Check

Let's check on the xy grid.

The orange line is the curve ③: 3x + y = 18.

The blue curve is where f is 27.

It just touches the line at the point.

Another point on the line, (5, 3), gives 15.

That is smaller, as a maximum needs.

Right!

another point on the line: f(5, 3) = 15

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 27 at (3, 9)

▶ Watch it solved

Max and min of f(x, y) = 2x - y on x^2 + y^2 = 20 Harder

The question

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

f(x, y) = 2x − y, x2 + y2 = 20

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 = 20, with g(x, y) = x² + y².

g(x, y) = x2 + y2

The x parts: f_x = λ g_x.

f_x is 2, g_x is 2x.

① 2 = λ × 2x

The y parts: f_y = λ g_y.

f_y is −1, g_y is 2y.

② −1 = λ × 2y

And ③: stay on the curve.

③ x2 + y2 = 20

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 ①: 2 = λ × 2x, so λ is 2/2x.

λ = 22x

From ②: λ is −1/2y.

λ = −12y

Both are λ, so they are equal.

22x = −12y

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

y = −12x

Put it into ③.

x² + (−1/2x)² = 20

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

x² = 16

Two numbers: x = 4 or −4.

Then y follows: two points.

x = 4 or −4

3 Compare the values

At (4, −2), f is 10.

f(4, −2) = 10

At (−4, 2), f is −10.

f(−4, 2) = −10

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

= max 10 at (4, −2), min −10 at (−4, 2)

4 Check

Let's check on the xy grid.

The orange circle is the curve ③.

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

Each just touches the circle.

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

Right!

f(0, 4.47) = −4.47

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 10 at (4, −2), min −10 at (−4, 2)

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. max of f(x, y) = xy with x + y = 10
    Answer
    = max 25 at (5, 5)
  2. max of f(x, y) = xy with x + y = 8
    Answer
    = max 16 at (4, 4)
  3. min of f(x, y) = x^2 + y^2 with x + y = 4
    Answer
    = min 8 at (2, 2)
  4. min of f(x, y) = x^2 + y^2 subject to x + 2y = 10
    Answer
    = min 20 at (2, 4)
  5. max of f(x, y) = xy with 2x + y = 12
    Answer
    = max 18 at (3, 6)
  6. Lagrange: max xy with x + y = 6
    Answer
    = max 9 at (3, 3)

Medium

  1. max of f(x, y) = xy with 3x + y = 18
    Answer
    = max 27 at (3, 9)
  2. min of f(x, y) = x^2 + y^2 with 2x + y = 10
    Answer
    = min 20 at (4, 2)
  3. max and min of f(x, y) = 4x + 3y on x^2 + y^2 = 100
    Answer
    = max 50 at (8, 6), min −50 at (−8, −6)
  4. min of f(x, y) = x^2 + 2y^2 with x + y = 6
    Answer
    = min 24 at (4, 2)
  5. min of f(x, y) = 2x^2 + y^2 with 2x + y = 6
    Answer
    = min 12 at (2, 2)
  6. max of f(x, y) = 2xy with x + 3y = 12
    Answer
    = max 24 at (6, 2)
  7. min of f(x, y) = x^2 + y^2 with 3x + 4y = 25
    Answer
    = min 25 at (3, 4)
  8. max and min of f(x, y) = x + 2y on x^2 + y^2 = 5
    Answer
    = max 5 at (1, 2), min −5 at (−1, −2)
  9. max and min of f(x, y) = 3x + 4y on x^2 + y^2 = 25
    Answer
    = max 25 at (3, 4), min −25 at (−3, −4)
  10. max and min of f(x, y) = x + y on x^2 + y^2 = 8
    Answer
    = max 4 at (2, 2), min −4 at (−2, −2)

Harder

  1. max and min of f(x, y) = 2x - y on x^2 + y^2 = 20
    Answer
    = max 10 at (4, −2), min −10 at (−4, 2)
  2. max and min of f(x, y) = 6x + 8y on x^2 + y^2 = 1
    Answer
    = max 10 at (3/5, 4/5), min −10 at (−3/5, −4/5)
  3. min of f(x, y) = x^2 + y^2 with x - y = 4
    Answer
    = min 8 at (2, −2)
  4. max of f(x, y) = xy with x + 4y = 16
    Answer
    = max 16 at (8, 2)