Steply

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

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) = 2xy with x + 3y = 12.

f(x, y) = 2xy, x + 3y = 12

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

g(x, y) = x + 3y

The x parts: f_x = λ g_x.

f_x is 2y, g_x is 1.

① 2y = λ

The y parts: f_y = λ g_y.

f_y is 2x, g_y is 3.

② 2x = λ × 3

And ③: stay on the curve.

③ x + 3y = 12

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 2y.

λ = 2y

From ②: λ is 2x/3.

λ = 2x3

Both are λ, so they are equal.

2y = 2x3

Tidy it up: y = x/3.

y = x3

Put it into ③.

x + 3(x3) = 12

Open the bracket and add the like terms.

2x = 12

Divide by 2: x = 6.

x = 6

Then y = x/3 gives y = 2.

y = 2

3 Compare the values

At (6, 2), f is 24.

f(6, 2) = 24

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

= max 24 at (6, 2)

4 Check

Let's check on the xy grid.

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

The blue curve is where f is 24.

It just touches the line at the point.

Another point on the line, (8, 133/100), gives 21.33.

That is smaller, as a maximum needs.

Right!

another point on the line: f(8, 133/100) = 21.33

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 24 at (6, 2)

Your turn

Try this one yourself, then check:

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

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →