Applications of Multivariable Differential Calculus

Notation for Partial derivatives

Linearization

Extrema

Taylor series

Exercise: generalize the formulas above for Taylor series expansion to functions of three variables f(x,y,z).

Constrained optimization.

For a nice visual explanation of Lagrange multipliers (including multiple constraints), you can look at Steuard Jensen's tutorial.

In a constrained optimization problem you try to maximize a function on the solution set of an equation. For example, you might wish to maximize the function f(x,y) = 3*x + 4*y subject to the constraint that g(x,y) = x2 + y2=25.

The old-fashioned way to solve this problem would be to solve the constraint equation for y to get a function y(x), and then try to maximize the function h(x)=f(x,y(x)). This works for this problem, but it is ugly because you have to deal with derivatives of square roots. And if g were more complicated you might not be able to solve for y analytically at all.

The new-fangled, elegant way is to use Lagrange multipliers. The recipe is simple: to maximize (or minimize) the function f(x,y) subject to the contraint g(x,y)=g(P), you set the gradient of f equal to an (unknown) multiple λ of the gradient of g. So you solve the system


   fx = λ gx ,
   fy = λ gy ,
   g(x,y) = g(P)
 
for the unknowns x, y, and λ.

For the example above, this system is:


   3 = λ2x ,
   4 = λ2y ,
   x2 + y2=25.
 
This system has two solutions: (x=3, y=4, λ=1/2) and (x=-3, y=-4, λ=-1/2). These are the only points where a minimum or maximum can exist. So if the maximum and minimum exist, all we have to do to find them is to evaluate the function at these critical points and compare the values. How can we know if the maximum and minimum exist? The following theorem is the most generic way to guarantee it:

Theorem (existence of extrema of a continuous function on a closed, bounded set). Let S be a set of points (e.g. the solution set of a constraint equation). If S is closed (i.e. contains all its boundary points) and is bounded (i.e. the points in S have a maximum distance from the origin), then any continuous function f has both a maximum and a minimum on the set S.

In our example, the solution set of the constraint equation is a circle, which is closed and bounded. So f must have a max and a min on this set. The only possible points where f can have an extremum are the two critical points. The values of the function at the two critical points are f(3,4)=25 and f(-3,-4)=-25. So these values must be the max and the min. The point (or set of points) where the global maximum occurs (in this case the point (3,4)) is called the argument of the maximum, or argmax for short, and the point (or set of points) where the global minimum occurs (in this case the point (-3,-4)) is called the argument of the minimum, or argmin for short.

Remark: Many people prefer to write the constraint equation in the form g(x,y)=0, rather than leaving a constant on one side, g(x,y)=g(P). To see why, define the auxiliary function h(x,y,λ) := f(x,y) - λ*g(x,y). Now look for (unconstrained) extrema of h. Setting the gradient equal to zero gives


   0 = hx = fx - λ gx,
   0 = hy = fy - λ gy,
   0 = hλ = -g(x,y),
 
which is precisely the system of equations that you have to solve to find extrema of f subject to the constraint g=0. So the unconstrained extrema of h are the extrema of f on the zero level-set of the constraint function g.

Below are two (basically equivalent) ways to see why Lagrange's recipe works. I recommend that you draw pictures and sketches of gradient vectors and level sets and try to understand what I write in terms of these diagrams.

Exercise: generalize one of the arguments for Lagrange multipliers to work for multiple constraint functions.