Steply

Max of f(x, y) = xy with x + 4y = 16

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 x + 4y = 16.

f(x, y) = xy, x + 4y = 16

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

g(x, y) = x + 4y

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 4.

② x = λ × 4

And ③: stay on the curve.

③ x + 4y = 16

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/4.

λ = x4

Both are λ, so they are equal.

y = x4

Tidy it up: y = x/4.

y = x4

Put it into ③.

x + 4(x4) = 16

Open the bracket and add the like terms.

2x = 16

Divide by 2: x = 8.

x = 8

Then y = x/4 gives y = 2.

y = 2

3 Compare the values

At (8, 2), f is 16.

f(8, 2) = 16

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

= max 16 at (8, 2)

4 Check

Let's check on the xy grid.

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

The blue curve is where f is 16.

It just touches the line at the point.

Another point on the line, (10, 3/2), gives 15.

That is smaller, as a maximum needs.

Right!

another point on the line: f(10, 3/2) = 15

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 16 at (8, 2)

Your turn

Try this one yourself, then check:

Find the maximum of f(x, y) = 2xy, x + 4y = 16
Show the answer
max 32 at (8, 2)

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →