Lagrange Multipliers

Lagrange Multipliers

Suppose that we have a function f(x,y) that we want to maximize in the restricted domain g(x,y) = c for some constant c.  Then we can look at the level curves of f and seek the largest level curve that intersects the curve g(x,y) = c.  It is not hard to see that these curves will be tangent.  Hence the gradient vectors will be parallel.

                    Theorem

Let f(x,y) be differentiable and g(x,y) = c define a smooth curve.  Then the maximum and minimum of f subject to the constraint g occur when

          grad f  =  l grad g

for some constant l.



Example

Find the extrema of 

        f(x,y)  =  x2 - y2 

subject to the constraint 

        y - x2  =  0

Solution:  

We have 

        <2x, -2y>  =  l<-2x, 1>

This gives us the three equations:

        2x  =  -l 2x         -2y  =  l (1)          and         y - x2  =  0

the first equation gives us (for x nonzero)

        l
  =  -1

Hence the second equation becomes

        -2y  =  -1 

so that 

        y  =  1/2

the third equation gives us

        1/2 - x2  =  0

Hence

        x  = / 2

For x = 0, we see that y = 0.  Hence the two possible local extrema are 

        (  / 2, 1/2)        and        (0,0)

Plugging into f(x,y), we see that

        f (/2, 1/2)  =  1/4

and 

        f(0,0)  =  0

Hence 1/4 is the local maximum and 0 is the local minimum.

Example 2

Find the distance from the origin to the surface 

        xyz  =  8

Solution

We minimize 

        D  =  x2 + y2 + z2  

subject to the constraint

        xyz  =  1

We have

        <2x, 2y, 2z> = l <yz, xz, xy>

        2x  =  l yz        2y  =  l xz,        2z  =  l xy

or

                    2x             2y               2z
        l  =              =                 =            
                    yz             xz                xy

Multiply all three by xyz to get 

        2x2  =  2y2  =  2z2

Hence 

        x  =  ± y  =  ± z

so that 

        ±x3  =   8    or    x  =  ±2

We get the points 

        (2, 2, 2), (2, -2, -2), (-2, -2, 2), (-2, 2, -2)

these all have distance from the origin.


Two constraints

Example

Maximize 

        x2 + y2 + z2   

on the intersection of the two surfaces:

        xyz  =  1       and        x2 + y2 + 2z2  =  4

Solution

Now we set

        grad f  =  a grad g + b grad h

which gives

        <2x, 2y, 2z>  =  a <yz, xz, xy> + b <2x, 2y, 4z>

we have the five equations:

        2x  =  ayz + 2bx,     2y  =  axz + 2by,     2z  =  axy + 4bz,    

        xyz  =  1,   and     x2 + z  =  1

Multiply the first equation by x, the second by y and the third by z gives

        2x2  =  axyz + 2bx2,     2y2  =  axyz + 2by2,     2z2  =  axyz + 4bz2,

Solving each for axyz gives

        axyz  =  2x2  - 2bx2  =  2y2  - 2by2  =  2z2  - 4bz2

This gives that 

        2x2(1 - b)  =  2y2(1 - b)  =  2z2 (1 - 2b)

This first equality gives

        x  =  ±y

Using the last of the original equations to solve for x2 gives

        x2   =  1 - z

The equation

        xyz  =  1

becomes

        (1 - z)z  =  1

or

        z2 - z + 1  =  0

Using the quadratic formula gives

        z  = 1/2 ± /2

Now we leave it to the reader to use

        x2 + z  =  1      and      x  =  ±y
       
To find x and y.

 



Back to the Functions of Several Variables Page

Back to the Math 107 Home Page

Back to the Math Department Home Page

e-mail Questions and Suggestions