You are on page 1of 8

Chapter 12: MultivariableFunctionsand partial Derivatives

|.' LagrangeMultipliers
i'
As we saw in section 12.8, we sometimesneed to find the extreme values
of
a function whose domain is constrained to lie within some particular subset of
the plane-a disk, for example, or a closed triangular region. But, as Fig. 12.5g
suggests,a function may be subjectto other kinds of constraintsas well.
Free maximum
In this section, we explore a powerful method for finding extreme values of
z=4 9-* 2 -y2 Constrained constrained functions: the method of ktgrange multipliers. Lagrange developed
maximum
the method in 1755 to solve max-min problems in geometry. Today the method is
x + 3 y -1 0 = important in economics, in engineering (where it is used in designing multistage
constraint on rockets, for example), and in mathematics.
x andy

Constrained
Maximaand Minima
EXAMPLE 1 Find the point p (x, y, z) closest to the origin on rhe plane 2x a
y-z-5:0.

solution The problem asks us to find the minimum value of the function

lo F l:W
x : J x 2 + v 2 + it
subject to the constraint that
12.58 The function f (x, y) : 49 - x2 - y2,
subject to the constraint g(x,y) : 2x* j -z-5:0.
x+3y-10 :0.
Since lOFl has a minimum value wherever the tunction

f(x,y;Z):x2+ y' + z'


has a minimum value, we may solve the problem by finding the minimum value
of f (x,y, z) subjectto the constraint2x * y - z -5 : 0. If we regardx and y as
the independentvariables in this equation and write z as

z:2x* y-5,
our problem reducesto one of finding the points (x, y) at which the function

h(x,y) : f(x,y,2x *) - 5) : x2 * y2 + (Zx + y _ 5) z


has its minimum value or values. since the domain of ft is the entire ly-plane, the
first derivative test of Section 12.8 tells us that any minima that ft might have must
occur at points where

h, :2x * 2(2x * y - 5)(2) : O, hy:2y * 2(2x f y - 5) : 0.


This leads to

l Ox * 4y:20, 4x * 4y: l Q,
and the solution
5
-t-
J 6
we may apply a geometric argurnent together with the second derivative test to
show that these values minimize h. The z-coordinate of the corresponding point on
12.9 LagrangeMult iplier s 981

th e pl anez:2x * y-5i s
/5\ s 5
z:2lll+
- ;- 5- - -
\31 6 6
Therefore, the point we seek is
. s\
Clo s eps o
t in t : r^ (r,
/ss
a . -O /
The distancefrom P to the origin is 5lJ6 x 2'04. D

Attemptsto solvea constrainedmaximum or minimum problemby substitution,


as we might call the methodof Example l, do not always go smoothly.This is one
of the reasonsfor learning the new method of this section.

EXAMPLE 2 Find the points closest to the origin on the hyperbolic cylinder
x 2 -22-1:0.

Solution 1 The cylinder is shown inFig. 12.59.We seekthe points on the cylinder
12.59 The hyperboliccylinder closest to the origin. These are the points whose coordinatesminimize the value of
x2- 22- 1: 0inE x a m p l e 2 . the function
of thedistance
Square
f(x, y, z) : xz + yz + z2
subject to the constraintthat x2 - zz - 1 : 0. If we regard x and y as independent
variables in the constraint equation, then
z2:x2-l

a n d theval uesoff(x,y,Z):x2+ y' + z2onthecyl i nderaregi venbyt hef unct ion


h(x,y) : x2 * y2 + @ 2- 1) : 2x2 + Y 2 - l .

To find the points on the cylinder whose coordinates minimize /, we look for the
points in the xy-plane whose coordinatesminimize h.The only extremevalue of
ft occurs where
h, :4x - 0 and hy:2Y - 0,
The hJperbolic cylinderx2 - z2 = |
that is, at the point (0, 0). But now we're in trouble-there are no points on the
cylinder where both x and y are zero. What went wrong?
What happenedwas that the first derivative test found (as it should have) the
point ln the domain of h whete ft has a minimum value. we, on the other hand, want
ihe points on the cylinder where h has a minimum value. While the domain of /r is
the entire xy-plane, the domain from which we can select the first two coordinates
o f t hepoi nts(x,y,z) onthecyl i nderi srestri ctedtothe" shadow"oft hecylinder
on the ry-plane; it doesnot include the band betweenthe lines x : -l and x : I
(Fig. 12.60).
We can avoid this problem if we treat y and z as independentvariables (instead
of x and y) and express.x in terms of y and z as
x2:22* 1.
12.60 The regionin the xy-planefrom With this substitution,f (x, y, z) : x2 + y' + z2 becomes
which the first two coordinates of the
points(x,y,z) on the hyperboliccylinder k(y, z) : 722* I) * yz * zz : | + y2 + 2zz
x2 - z2: 1 are selectedexcludes the band
-1 < x < l int hex y -p l a n e . and we look for the points where ft takes on its smallest value. The domain of
982 Chapt er12: M u l ti v a ri a b l eF u n c ti o n sa n d Parti alD eri vati ves

k in the yz-plane now matches the domain from which we select the y- and
z-coordinatesof the points (x, y, z) on the cylinder.Hence,the points that minimize
ft in the plane will have correspondingpoints on the cylinder. The smallestvalues
of k occur where

kY :2Y -0 and kr:42-0,


or where | : z :0. This leadsto

x 2 : 2 2 *l : 1 , - - - Lt

The conesponding points on the cylinder are (* 1,0,0). We can see from the
inequality

k(Y .d:l + y2+ 222> l

that the points (* 1,0,0) give a minimum value for k. we can also see that the
minimum distance from the origin to a point on the cylinder is 1 unit.

solution 2 Another way to find the points on the cylinder closest to the origin is
" 2_ 2 2 _ l : 0
to imagine a small spherecenteredat the origin expanding like a soap bubble until
x 2+ y 2+ a2- o2=
it just touches the cylinder (Fig. 12.61). At each point of contact, the cylinder and
sphere have the same tangent plane and normal line. Therefore, if the sphere and
cylinder are representedas the level surfacesobtained by setting

f(x,y,Z):x2+ y' ,+ 22-a2 and g(x,y,Z):x2-z' -l


equal to 0, then the gradients V/ and vg will be parallel where the surfacestouch.
At any point of contact we should therefore be able to find a scalar l. ("lambda")
such that

V /: l V g'
or

2x i | 2y j * Zzk : ).(2x i - 2zk).


12.61 A sphereexpandinglike a soap
bubblecenteredat the origin until it just Thus, the coordinatesx, y, and z of any point of tangency will have to satisfy the
touchesthe hyperboliccylinder three scalarequations
x 2- 22- 1 :0 . 2x : 2).x, 2y :0, 2z : -2),2. ( l)
SeeSolution2 of Example2.
For what valuesof ), will a point (x, y, z) whose coordinatessatisfy the equa-
tions in (1) also lie on the surfacex2 - z2 - I : 0? To answer this question,we
use the fact that no point on the surface has a zero x-coordinate to conclude that
x l0 in the first equationin (l). This meansthat 2x :2)"x only if

2:2)' , or ,1": 1.
For )" : l, the equation 27 : -2)"2 becomes2z : -Zz. If this equation is to be
satisfiedas well, z must be zero. Since y : 0 also (from the equation2y :0), we
conclude that the points we seek all have coordinates of the form

(-r,0, 0).

What points on the surface x2 - zz : I have coordinates of this form? The points
(x, 0, 0) for which

x2 - :1,
1072 x2 :1, or x : * 1.
The points on the cylinder closestto the origin are the points (* 1,0,0). D
12.9 LagrangeM ult iplier s 983

Multipliers
The Methodof Lagrange
In Solution 2 of Example 2, we solved the problem by the method of Lagrange
multipliers. In generalterms,the methodsaysthat the extremevaluesof a function
: 0 are to be found
f (*, y, z) whosevariablesare subjectto a constraint,g(-r,y, z)
:
on the surf'ace8 0 at the points where
Y1 : )"Vg

for some scalar,tr(called a Lagrange multiplier).


To explorethe methodfurther and seewhy it works, we first make the following
observation,which we stateas a theorem.

Theorem9
Theorem
Gradient
TheOrthogonal
Supposethat /(x, ), z) is differentiablein a region whose interior contains
a smooth curve
C: r : s (t )i+ h (t )i+ f t (/ )k .
If Ps is a point on C where / has a local. maximum or minimuin relative
to its values on C, then V/ is orthogonal to C at Ps.

Proof We show that V.f is orthogonal to the curve's velocity vector at Ps. The
valuesof f on C are given by the composite/(S(t), h(t),k(t)), whosederivative
with respectto t is
d f : a f lg * { 4 ! " { 4 ! :vr.r.
dt 0x dt 3y dt 3z dt

At any point P6 where / has a local maximum or minimum relative to its values
o n the curve,df l dt:0, SO
V ./.v:0. D
By droppingthe z-termsin Theorem9, we obtain a similar result for functions
of two variables.

Corollaryof Theorem 9
At the pointson a smoothcurve r: g(/) i+h(t)i where a differentiable
function f (x, y) takeson its local maxima and minima relative to its values
on the curve,V / . v:0.

Theorem 9 is the key to the method of Lagrange multipliers. Suppose that


f (x,y,z) and g?,y,z) are differentiableand that Pe is a point on the surface
g@,y,2):0 where / has a local maximum or minimum value relative to its
other values on the surface. Then / takes on a local maximum or minimum at
Pe relative to its values on every differentiable curve through Ps on the surface
C@,y,2):0. Therefore,V/ is orthogonalto the velocity vector of every such
differentiable curve through Ps. But so is Vg (becauseVg is orthogonal to the level
surface 8 : 0, as we saw in Section 12.7). Therefore, at Ps, V/ is some scalar
multiple I of V6.
984 Chapter '12:MultivariableFunctionsand partial Derivatives

The Method of Lagrange Multipliers

Supposethat f (x,),2) and g(r,y,a) are differentiable.To find


rhe local
maximum and minimum valuesof subjectto the constraintg(x,
/ !, z) :0,
find the valuesof x, y,z, and.i. that simultaneouslysatisfy the equations
yf : Lyg and g(x, y, z) : 0.
For functions of two independentvariables,the appropriateequations
are
yf : ),V g and :0.
E k, i

EXAMPLE3 Find the greatestand smallestvaruesrharthe function

f(x' Y) : xY
takeson the ellipse(Fig. 12.62)
.,2
^-2 ,/
T- t:t'

Solution We want the extremevaluesof (x,y):x), subjectto the constraint


12.62 Example3 showshow to find the f
largestand smallestvaluesof the product x2 r,2
xy on this ellipse. s \ x , y ) : T * i_ r : 0 .
To do so, we first findthe valuesof x,y, and), for which
Vf : ),YS and g(x, y) :0.
The gradient equation gives

Y i-f x i: 1 * i* ry i,
4

from which we find


l r
A .-
.t
L'
J:4* , x:)' Y , and V ::(,l V ):-v-
- A'
a+

so that ) : 0 or I : * 2. We now considerthesetwo cases.


s: l'*: Case1: If y :0, then x : | :0. But (0,0) is not on the ellipse.Hence,y
+ 0.
Case2: If y * 0, then i_: * 2 and x : +2y.Substituting
this in the equation
s(x,y):0gi ves

and v- * l

The function f (x, y) : .ry therefore takes on its extreme values


on the ellipse at
the four points (+ 2, l), (+2, -l). The extremevalues
are x! : 2 andxy _ _2.
12.53 When subjectedto the constraint
The Geometry of the Solution The level curvesof rhe funcrion (x, y) : xy
sU,9 : x2l8+ y2/2- I : o, the function .f
t(x,y): xy takeson extremevaluesat are the hyperbolas xy -- c (Fig. 12.63). The farther the
hyperboras lie from the
the four points(+2,*1). Theseare the origin, the larger the absolute value of
pointson the ellipsewhen Vf (red)is a /. we want to find the extreme values of
f (x, y), given that the poinr (x, y) also lies on the ellipse xz + 4y2: g. Which
scalarmultipleof vg (blue)(Example3). hyperbolas intersecting the ellipse lie farthest from the
origin? The hyperbolas that
Multipliers 985
12.9 Lagrange

just graze the ellipse, the ones that are tangentto it. At these points, any vector
normal to the hyperbola is normal to the ellipse, so Y f :yi * xj is a m ult iple
(l : + 2) of Yg : (x 14)i + t' j. At the point (2, 1), for example,

Yf:i+ 2i, vs: ji+ j. and Y f :2Yg.

At the poi nt (-2,l ),

v f : i-2 j, v g : -] i+ 1 , and Yf : -2Yg.


z D

EXAMPLE4 f(x, y) :
Findthemaximumandminimumvaluesofthefunction
3x -l 4y on the circle x2 + y2 : 1.

Solution We model this as a Lagrangemultiplier problem with

f (x,y) -- 3x * 4y, S O,9: x2 + y2 - |

and look for the valuesof x, y, and I that satisfy the equations
V /:),V g : 3i + 4j :2x),i * 2y),j ,

8(x' y):o: x2+ Y 2-l :0.

The gradientequationimplies that )" l0 and gives


-t z
y:;.
D.

These equationstell us, among other things, that r and y have the same sign. With
thesevaluesfor x and y, the equationg(x, )) :0 gives
z l r2 /.t\2
.(;) -,:0
(;,)
94 g + 16 - 4),2,
so + I' 4),2 : 25, and ), : + :.
aiz u: 2
Thus.
JJ 24
- -l-_ ., - _ - -{--
vf.:3i + 4i: zv8 11 {
'i"
)

- and f(x,y) :3x l 4y has extremeval uesat (x,y) : + (3/5,4/ 5) .


6.
By calculatingthe value of 3x * 4y at the points * (315, 415), we seethat its
:) * 3i
>l
maxlmum and minimum valueson the circle x2 + v2: 1 are
4l
)) /3\ /4\ 2s ')<
and , ( j) . - ( - i)
' l s /* * l s /: s :5
x

3x + 4y : J
The Geometry of the Solution (FiS. 12.6q The level curvesof f (x,y):
3x * 4y are the lines 3r * 4y : c. The farther the lines lie from the origin, the
3x + 4y = - 5
larger the absolutevalue of /. We want to find the extreme values of /(x, y) given
that the point (r,y) also lies on the circle x2 +y2: l. Which lines intersecting
12.64 The functionf(x,y) :3x + 4y takes
on its largestvalueon the unit circle the circle lie farthest from the origin? The lines tangent to the circle. At the points
S(x,y) : x'+ y' - 1 : 0 at the point of tangency, any vector normal to the line is normal to the circle, so the gradient
(315,415)and its smallestvalueat the Y f :3i f 4j i s a mul ti pl e(),: * 512) of the gradi entY g:2"i+2y: . At t he
point (-3l5, -4l5) (Example4). At each of point (3/5 , 4 I 5) , for example,
thesepoints,Vf is a scalarmultipleof
Vg. The figure showsthe gradientsat the vf:3i+ 4i, vs::t+;j, and vf:ttv s
first point but not the second. E
986 Chapt e r1 2 : Mu l ti v a ri a b l eF u n c ti o n sa n d parti alD eri vati ves

LagrangeMultiplierswith Two Constraints


Many problemsrequire us to find the extreme values of a differentiablefunction
f (x, y, z) whose variablesare subjectto two constraints.If the constraintsare
gt@ , y, z) : 0 and gz/, y, z) :0
and g1 and g2 are differentiable, with Vg1 not parallel to yg2, we find the constrained
local maxima and minima of / by introducing two Lagrangemultipliers I and pr
(mu, pronounced"mew"). That is, we locate the points p (x, y,
z) where / takes
on its constrainedextreme values by finding the values of x,y,z,)", and,p 111a1
simultaneouslysatisfy the equations

V/ : lVgr * ttYgz, gr?, y, z) : 0, 8z@,y, z) : o. (2)


The equationsin (2) have a nice geometricinterpretation.The surfacesgr :0
and g2: 0 (usually) intersectin a smooth curve, say c (Fig. 12.65),and alons
12.65 The vectorsVg1 and Vg2 lie in a this curve we seek the points where / has local maximum and minimum valuei
planeperpendicular to the curveC relative to its other values on the curve. These are the points where V/ is normal
becauseVg1 is normalto the surface to c, as we saw in Theorem 9. But Vg1 and yg2 are also normal to c at these
9r : 0 and Vg2 is normalto the surface points becauseC lies in the surfacesgr : 0 and
9z : 0' 92:0. Therefore V/ lies in the
plane determined by Vg1 and Vg2, which means that V/ : lVgr *
ttygz for some
)' and p'. Since the points we seek also lie in both surfaces,their coordinates must
satisfy the equationsg{x, y, z) : 0 and g2(x, !, z) :0, which are the remainine
requirementsin Eqs. (2).

E XA MP LE 5 The pl ane xl yl z:l cuts the cyl i nder,r +yr : l in an


ellipse (Fig- 12.66). Find the points on the ellipse that lie closest to and farthest
from the origin.

Solution We find the extreme values of

f(x,y,z):x2+ y2+ 22
(the square of the distance from (x, y, z) to the origin) subject to the constraints

gr?,y,Z):x2+ y2-l :O (3)


8z@ ,y,2):x* y* z-l :0. (4)
The gradient equation in (2) then gives

V/ : lVSr * ltYgz Eq (2)


2xi * 2y j * 2zk: L(2xi + 2y j ) + rr.(i + j + k)
2xi * 2y j -t2zk - (Z).x* tD i * (2)" y* tt)j + pk

x- l!*7 :l

2x : 2)"x * l.t, 2y :2Ly * 1t, 2z : F. (s)


The scalarequationsin (5) yield

2x : 2),xl2z + (l - X)x :7,


12.66 On the ellipsewherethe plane (6)
2y :2Ly *22 + (l - L)y :7.
and cylindermeet,what are the points
closestto and farthest from the origin Equations (6) are satisfied simultaneously if either ). : I and z : 0 or ), I I and
(Example5)? .tr:. I : z/(l - )" ).
12.9
Exercises 987

If z : 0, then solving Eqs.(3) and (4) simultaneouslyto find the corresponding


poinrson the ellipsegivesthe two points(1,0,0) and (0, 1,0). This makessense
when you look at Fig. 12.66.
If x : ), then Eqs. (3) and (4) give
x * x 11- I : 0

z : | -2x
6
^--2
,\L
z: l+J2 .

pointson the ellipseare


The corresponding

,,:(+,+,'-t) and P->:


IJ'
|
t
\-
/-
---:-,
1
--
J' t+Jr)
2'

But here we need to be careful.While Pr and P2 both give local maxima of / on


the ellipse, P2 is farther from the origin than P1.
The points on the ellipse closestto the origin are (1, 0, 0) and (0, 1, 0). The
point on ihe ellipse farthest from the origin is P2. D

12.9
Exercises
Two Independent Variableswith One Constraint 11. Use the method of Lagrange multipliers to find the dimensions of
1. Find the pointson the ellipsex2 +2y2: 1 where f (x,y): ay the rectangle of greatestarea that can be inscribed in the ellipse
has its extreme values. x2 116+ y219 :1 with sidesparallel to the coordinateaxes'

2' Find the extreme values of f (r ' y) : ;ry subject to the constraint 12. Find the dimensions of the rectangle of largest perimeter that can
be inscribedin the ellipse x21a2 + y2lb2 :1 with sidesparallel
s(x,y):x2 * Y2- lo: 0.
to the coordinate axes. What is the largest perimeter?
3. Find the maximum value of f (x, y) : 49 - x2 - yz on the line
x * 3 y :10 ( Fie. 12. 58) . 13. Find the maximum and minimum valuesof x2 + y2 subjectto
the constraintx2 - 2x I y2 - 4y :0.
4. Find the local extreme values of f(x,y):r'y on the line
x+Y:3. 14. Find the maximum and minimum values of 3x - y * 6 subject
to the constraintx2 * Y2 :4.
5. Find the points on the curve x!2 : 54 nearestthe origin.
15. The temperatureat a point (x,)) on a metal plate is T(x'y):
6. pind the points on the curve ,ty:2 nearestthe origin. 4x2 - 4xy + y2. An ant on the plate walks around the circle of
7. Use the method of Lagrange multipliers to find radius 5 centered at the origin. What are the highest and lowest
the minimum value of x * y, subject to the constraints temperaturesencounteredby the ant?
a)
xJ:16 ,'r > 0, Y> 0; 16. Your firm has been asked to design a storage tank for liquid
b) the maximum value of ;ry, subject to the constraint petroleum gas. The customer's specificationscall for a cylindrical
x+Y:16 ' iank with hemispherical ends, and the tank is to hold 8000 m3
Comment on the geometry of each solution. of gas. The customer also wants to use the smallest amount of
material possible in building the tank. What radius and height do
8. Find the points on the curve x2 + xy -f y2 :1 in the .ry-plane you recofirmend for the cylindrical portion of the tank?
that are nearest to and farthest from the origin.
with OneConstraint
Variables
ThreeIndependent
9. Find the dimensions of the closed right circular cylindrical can
of smallestsurfacearea whose volume is 16rr cm3- 17. Find the point on the planex * 2y * 3z : 13 closestto the point
(1,1,1).
10. Find the radius and height of the open right circular cylinder of
largest surface area that can be inscribed in a sphereof radius a. 18. Find the point on the spherex2 + y2 * z2 :4 which is farthest
What is the largest surface area? from the point (1, -1, l).