Steply

Min of f(x, y) = x^2 + y^2 with 3x + 4y = 25

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

Step by step

The question

Question: find the minimum of f(x, y) = x² + y² with 3x + 4y = 25.

f(x, y) = x2 + y2, 3x + 4y = 25

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

g(x, y) = 3x + 4y

The x parts: f_x = λ g_x.

f_x is 2x, g_x is 3.

① 2x = λ × 3

The y parts: f_y = λ g_y.

f_y is 2y, g_y is 4.

② 2y = λ × 4

And ③: stay on the curve.

③ 3x + 4y = 25

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 2x/3.

λ = 2x3

From ②: λ is 2y/4.

λ = 2y4

Both are λ, so they are equal.

2x3 = 2y4

Tidy it up: y = 4x/3.

y = 4x3

Put it into ③.

3x + 4(4x3) = 25

Open the bracket and add the like terms.

25x3 = 25

Divide by 25/3: x = 3.

x = 3

Then y = 4x/3 gives y = 4.

y = 4

3 Compare the values

At (3, 4), f is 25.

f(3, 4) = 25

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

= min 25 at (3, 4)

4 Check

Let's check on the xy grid.

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

The blue curve is where f is 25.

It just touches the line at the point.

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

That is bigger, as a minimum needs.

Right!

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

Let's look back.

First: set up the equations.

Then: solve the equations.

Then: compare the values.

Last: check.

Answer
= min 25 at (3, 4)

Your turn

Try this one yourself, then check:

Find the minimum of f(x, y) = 2x2 + 2y2, 3x + 4y = 25
Show the answer
min 50 at (3, 4)

More from Lagrange multipliers

The whole lesson: Lagrange multipliers →