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 at the critical points of

          F(x,y)  =  f(x,y) - l g(x,y)

for some constant l.



Example:

Find the extrema of 

        f(x,y) = x2 - y2 

subject to the constraint 

        y - x2 = 0

Solution:  

We have 

        F(x,y)  =   (x2 - y2) - l (y - x2

Now take partial derivatives and set them equal to zero:

        Fx(x,y)  =  2x - l2x  =  0

        Fy(x,y)  =  -2y - l  =  0

This gives us the three equations:

        2x = -l2x,    -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 = 8

We have

        F(x,y)  =   ( x2 + y2 + z2) - l (xyz) 

Now take partial derivatives and set them equal to zero:

        Fx(x,y)  =  2x - lyz  =  0

        Fy(x,y)  =  2y - lxz  =  0

        Fz(x,y)  =  2z - lxy  =  0


Which give the four equations

        2x = l yz,        2y = lxz,        2z = lxy,    xyz  =  8

or

        l = 2x/yz = 2y/xz = 2z/xy        xyz  =  8

or 

        2x2 = 2y2 = 2z2        xyz  =  8

Hence 

        x = ± y = ± z

Plugging into the last equations gives 

        ±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:

When there are two constraints we use

        F(x,y,z)  =  f(x,y,z) - ag(x,y,z) + bh(x,y,z)

and find the critical points of F.  We get

        F(x,y,z)  =  (x2 + y2 + z2) - a(xyz) - b(x2 + y2 + 2z2)

and take partial derivatives

        Fx  =  2x - ayz - b2x   
        Fy  =  2y - axz - b2y   
        Fz  =  2z - axy - b4z   

which gives 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 to get

        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

Substituting and dividing by 2 gives

        (1 - z)(1 - b) = z2 (1 - 2b)

Using xyz  =  1 and substituting gives

        ±(1 - z)z  =  1

so

        z2 - z + 1  =  0    or    z2 + z - 1  =  0

The first has no solution and the second has solutions

        z  =  -1/2 ± 1/2

Now

       

and

       

 


Back to the Math 117 Home Page

Back to the Math Department Home

e-mail Questions and Suggestions