Steply

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

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

Step by step

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)

Your turn

Try this one yourself, then check:

Find the maximum of f(x, y) = 2xy, 3x + y = 18
Show the answer
max 54 at (3, 9)

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →