Step by step
The question
Question: find the minimum of f(x, y) = x² + y² with x − y = 4.
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.
The curve is g = 4, with g(x, y) = x − y.
The x parts: f_x = λ g_x.
f_x is 2x, g_x is 1.
The y parts: f_y = λ g_y.
f_y is 2y, g_y is −1.
And ③: stay on the curve.
Careful!
The curve's own equation is part of the system.
Without it, we cannot find x and y.
2 Solve the equations
From ①: λ is 2x.
From ②: λ is −2y.
Both are λ, so they are equal.
Tidy it up: y = −x.
Put it into ③.
Open the bracket and add the like terms.
Divide by 2: x = 2.
Then y = −x gives y = −2.
3 Compare the values
At (2, −2), f is 8.
There is one point, so it gives the minimum: 8.
4 Check
Let's check on the xy grid.
The orange line is the curve ③: x − y = 4.
The blue curve is where f is 8.
It just touches the line at the point.
Another point on the line, (4, 0), gives 16.
That is bigger, as a minimum needs.
Right!
Let's look back.
First: set up the equations.
Then: solve the equations.
Then: compare the values.
Last: check.