Steply

Max of f(x, y) = xy with 2x + y = 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) = xy with 2x + y = 12.

f(x, y) = xy, 2x + y = 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) = 2x + y.

g(x, y) = 2x + y

The x parts: f_x = λ g_x.

f_x is y, g_x is 2.

① y = λ × 2

The y parts: f_y = λ g_y.

f_y is x, g_y is 1.

② x = λ

And ③: stay on the curve.

③ 2x + y = 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 y/2.

λ = y2

From ②: λ is x.

λ = x

Both are λ, so they are equal.

y2 = x

Tidy it up: y = 2x.

y = 2x

Put it into ③.

2x + (2x) = 12

Open the bracket and add the like terms.

4x = 12

Divide by 4: x = 3.

x = 3

Then y = 2x gives y = 6.

y = 6

3 Compare the values

At (3, 6), f is 18.

f(3, 6) = 18

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

= max 18 at (3, 6)

4 Check

Let's check on the xy grid.

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

The blue curve is where f is 18.

It just touches the line at the point.

Another point on the line, (5, 2), gives 10.

That is smaller, as a maximum needs.

Right!

another point on the line: f(5, 2) = 10

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= max 18 at (3, 6)

Your turn

Try this one yourself, then check:

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

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →