Consider the problem of maximizing or minimizing some function , subject to some constraint

Graph with Matplotlib

Python
Output

Important

is a contour/level curve of some unknown constraint surface .


Solving This Problem

  1. We parameterize the constraint curve by

By the Key Formula from Sec. 14.6,

for all t in the parameter domain.

  1. The curve C whose optimal value we seek is obtained by lifting to the surface .

This means we can parameterize C by

Observe

The max/min values along may occur when the z-component of tangent vector equals 0.

Why?

In complete analogy with Calc 1, we want to look where has a horizontal tangent line. In

, this means we are looking for points where the tangent vector is horizontal.

A tangent vector is horizontal if its z-component is zero. Let’s compute the tangent vector :

For this vector to be horizontal, we must have:

By the Chain Rule for paths, we know:

This can be written compactly as a dot product:


The Geometric Conclusion

Let’s summarize what we know about an optimal point on the constraint curve. Let this point correspond to ​ in our parameterization.

  1. Because the point is on a level curve of g, the gradient of g is orthogonal to the direction of the curve:

  2. Because the point is a local max or min of f along the curve, the gradient of is also orthogonal to the direction of the curve:

Both gradients, and , are orthogonal to the very same tangent vector at that point. In , this means that the two gradient vectors must be parallel.

The Lagrange Multiplier

If two vectors are parallel, then one must be a scalar multiple of the other. We call this scalar multiplier Ξ» (lambda), the Lagrange Multiplier.

This single vector equation gives us the theoretical foundation for solving constrained optimization problems.


The Method of Lagrange Multipliers

To find the maximum and minimum values of subject to the constraint :

  1. Find all values of , , and such that

and

  1. The first equation, , provides a system of two component equations:
  2. Evaluate f at all points you obtain from step 1. The largest of these values is the maximum value, and the smallest is the minimum value.

Summary: The System to Solve

In total, you are solving a system of three equations with three unknowns :