Finding local minima or maxima given a constraint. We find the minimum and maximum points of the function f(x, y) given g(x, y) = 0 (constant).

Let’s explain this by way of an example:

Given the function , we observe it has no absolute minimum or maximum

However, by introducing a constraint, such as (a circle), we may find the local minima and maxima on the curve (in red)

Observing the level curves, we’re interested in the contours that barely touch the constraint curve. These are the local minima and maxima we’re interested in.

This means the local minima and maxima are points at which both the constraint curve and level curve have the same tangent line, but also normals in the same direction

The gradient vector is normal to the level curves such that and are scalar multiples. We introduce the Lagrange Multiplier to represent this relationship

We can solve the two equations simultaneously:

Alternatively, we can introduce a auxiliary function, called the Lagrangian to combine these conditions:

and solve for

For the example we’ve been concerned with

This yields three equations for 3 unknowns, which when solved simultaneously will give the four local minimums and maximums: