14
Partial Differentiation
In single-var iable calculus we were concerned with functio ns that map the real numbers R
to R, sometimes called “real functions of one variable”, meaning the “input” is a single real
number and the “output” is likewise a single real number. In the last chapter we considered
functions taking a real number to a vector, which may also be viewed as functions f: R
R
3
, that is, for each input value we get a position in space. Now we turn to functions
of several variables, meaning several input variables, functions f : R
n
R. We will deal
primarily with n = 2 and to a lesser extent n = 3; in fact many of t he techniques we
discuss can be applied to larger values of n as well.
A function f: R
2
R maps a pair of values (x, y) to a single real number. The three-
dimensional coordinate system we have already used is a convenient way to visualize such
functions: above each point (x, y) in the x-y plane we graph the point (x, y, z), where of
course z = f (x, y).
EXAMPLE 14.1.1 Consider f(x, y) = 3x +4y 5. Writing this as z = 3x + 4y 5 and
then 3x+4y z = 5 we recognize the equation of a plane. In the form f (x, y) = 3x+4y 5
the emphasis has shifted: we now think of x a nd y as independent variables and z as a
var iable dependent on them, but the geometry is unchanged.
EXAMPLE 14.1.2 We have seen that x
2
+ y
2
+ z
2
= 4 represents a sphere of radius 2.
We cannot write t hi s in the form f( x , y), since for each x and y in the disk x
2
+y
2
< 4 there
are two corresponding points on the sphere. A s with the equation of a circle, we can resolve
349
350 Chapter 14 Partial Differentiation
this equation into two functions, f (x, y) =
p
4 x
2
y
2
and f(x, y) =
p
4 x
2
y
2
,
representing the upper and lower hemispheres. Each of these is an example of a function
with a restri ct ed domain: only certain values of x and y make sense ( namel y, those for
which x
2
+ y
2
4) and the graphs of these functions are limited to a small region of the
plane.
EXAMPLE 14.1.3 Consider f =
x +
y. This function is defined only when both
x and y are non-negative. When y = 0 we get f(x, y) =
x, the familiar square root
function in the x-z plane, and when x = 0 we get the same curve in the y-z plane.
Generally speaking, we see that st arting from f(0, 0) = 0 this function gets larger in every
direction in roughly the same way that the square root function gets larger. For example,
if we restrict attention to the line x = y, we g et f(x, y) = 2
x and along the line y = 2x
we have f(x, y) =
x +
2x = ( 1 +
2)
x.
10.0
7.5
5.0
0
0.0
y
2.5
1
2.5
5.0
x
2
7.5
0.0
10.0
3
4
5
6
Figure 14.1.1 f(x, y) =
x +
y (AP)
A computer program that plots such surfaces can be very useful, as it is often difficult
to get a good idea of what they look like. Still, it is valuable to be able to visualize
relatively simple surfaces without such aids. As in the previ ous example, i t is often a good
idea to examine the function o n restricted subsets of the plane, especially lines. It can also
be useful to identify those points (x, y) that share a common z-value.
EXAMPLE 14.1.4 Consider f (x, y) = x
2
+ y
2
. When x = 0 this becomes f = y
2
, a
parabola in the y-z plane; when y = 0 we get the “same” parabol a f = x
2
in the x-z plane.
Now consider the line y = kx . If we simply replace y by kx we g et f(x, y) = (1 + k
2
)x
2
which is a parabola, but it does not really “represent” the cross-section along y = kx,
because the cross-section has the line y = kx where the horizontal axis should be. In
14.1 Functions of Several Variables 351
order to pretend that this line is the horizontal axis, we need to write the function in
terms of the distance from the origin, which is
p
x
2
+ y
2
=
p
x
2
+ k
2
x
2
. Now f(x, y) =
x
2
+ k
2
x
2
= (
p
x
2
+ k
2
x
2
)
2
. So the cross-section is the “same” parabola as in the x-z and
y-z planes, namely, the height is always the dist ance from the origin squared. This means
that f(x, y) = x
2
+ y
2
can be formed by starting with z = x
2
and rotating this curve
around the z axis.
Finally, picking a value z = k, at what points does f(x, y) = k? This means x
2
+y
2
= k,
which we recognize as the equation o f a circle of ra di us
k. So the graph o f f (x, y) has
parabolic cross-sections, and the same height everywhere on concentric circles with center
at the origin. This fits with what we have already discovered.
−3
0
−3
−2
−2
2
−1
−1
4
0
0
6
1
1
8
2
2
3
3
Figure 14.1.2 f(x, y) = x
2
+ y
2
(AP)
As in this example, the points (x, y) such that f(x, y) = k usually form a curve, called
a level c urve of the function. A graph of some level curves can give a good idea of the
shape of the surface; it looks much like a topogra phic map of the surface. In figure 14.1.2
both the surface and its associated level curves are shown. Note that, as w ith a topographic
map, the heights corresponding to the level curves are evenly spaced, so that where curves
are closer together t he surface is steeper.
Functions f : R
n
R behave much like functions of two variables; we will on occasion
discuss functions of three variables. The principal difficulty with such functions is visual-
izing t hem, as they do not “fit” in the three dimensions we are familiar with. For three
var iables there are various ways to interpret functions that make them easier to under-
stand. For example, f(x, y, z) could represent the t emperature a t t he point (x, y, z), or the
pressure, or the strength of a magnetic field. It remains useful t o consider those points at
which f(x, y, z) = k, where k is some constant value. If f(x, y, z) is temperature, the set of
points (x , y, z) such that f(x, y, z) = k is the collection o f points in space with temperature
352 Chapter 14 Partial Differentiation
k; in general this is called a level set; for three variables, a level set is typically a surface,
called a level surface.
EXAMPLE 14.1.5 Suppose the temperature at (x, y, z) i s T (x, y, z) = e
(x
2
+y
2
+z
2
)
.
This function has a maximum value of 1 at the origin, and tends to 0 in all directions.
If k is positive and at most 1, the set of points for which T (x , y, z) = k is t hose poi nts
satisfying x
2
+ y
2
+ z
2
= ln k, a sphere centered at the origin. The level surfaces are the
concentric spheres centered at the origin.
Exercises 14.1.
1. Let f (x, y) = (x y)
2
. Determine the equations and shapes of the cross-sections when x = 0,
y = 0, x = y, and describe the level curves. Use a three-dimensional graphing tool to graph
the surface.
2. Let f(x, y) = |x|+ |y|. Determine the equations and shapes of the cross-sections when x = 0,
y = 0, x = y, and describe the level curves. Use a three-dimensional graphing tool to graph
the surface.
3. Let f(x, y) = e
(x
2
+y
2
)
sin(x
2
+y
2
). Determ ine the equations and shapes of the cross-sections
when x = 0, y = 0, x = y, and describe the level curves. Use a three-dimensional graphing
tool to graph the surface.
4. Let f (x, y) = sin(x y) . Determine the equations and shapes of the cross-sections when
x = 0, y = 0, x = y, and describe the level curves. Use a three-dimensional graphing tool to
graph the surface.
5. Let f (x, y) = (x
2
y
2
)
2
. Determine the equati ons and shapes of the cross-sections when
x = 0, y = 0, x = y, and describe the level curves. Use a three-dimensional graphing tool to
graph the surface.
6. Find the domain of each of the following functions of two variables:
a.
p
9 x
2
+
p
y
2
4
b. arcsin( x
2
+ y
2
2)
c.
p
16 x
2
4y
2
7. Below are two sets of level curves. One is for a cone, one is for a paraboloid. Which is which?
Explain.
14.2 Limits and Continuity 353
To develop calculus for functions of one variable, we needed to make sense of the concept of
a limit, which we needed to understand continuous functions and to define the derivative.
Limits involving functions of two variables can be considerably more difficult to deal with;
fortunately, most of the functions we encounter are fairly easy to understand.
The potential difficulty is largely due to the fact that there are many ways to “ap-
proach” a point in the x-y plane. If we want to say that lim
(x,y)(a,b)
f(x, y) = L, we need to
capture the idea that as (x, y) gets close to (a, b) then f(x, y) gets cl ose to L. For functions
of one variable, f (x), there are only two ways that x can approach a: from the left or right.
But there are an infinite number of ways to approach ( a, b): along any one of an infinite
number of lines, or an infinite number of parabolas, or an i nfinite number o f sine curves,
and so on. We might hope that it’s really not so bad—suppose, for example, that along
every possible line through (a, b ) the value of f(x, y) gets close to L; surely this means that
f(x, y) approaches L as (x, y) approaches (a, b)”. Sadly, no.
EXAMPLE 14.2.1 Consider f (x, y) = xy
2
/(x
2
+ y
4
). When x = 0 o r y = 0, f(x, y) i s
0, so the limit of f (x, y) approaching the origin along either the x or y axis is 0. Moreover,
along the line y = mx, f(x, y) = m
2
x
3
/(x
2
+ m
4
x
4
). As x approaches 0 thi s expression
approaches 0 as well. So along every line through the origin f (x, y) approaches 0. Now
suppose we approach the origin along x = y
2
. Then
f(x, y) =
y
2
y
2
y
4
+ y
4
=
y
4
2y
4
=
1
2
,
so t he limit is 1/2. Looking at figure 14.2.1, it is apparent that there is a ridge above
x = y
2
. Approaching the origin along a stra ight line, we go over the ridge and then drop
down toward 0, but approaching along the ridge the height is a constant 1/2. Thus, there
is no limit at (0, 0).
Fortunately, we can define the concept of limit without needing to specify how a
particular poi nt is approached—indeed, in definition 2. 3.2, we didn’t need t he concept of
“approach.” Roughly, that definition says that when x is close to a then f( x) is close to
L; there is no mention of “how” we get clo se to a. We can adapt that definition to two
var iables quite easily:
DEFINITION 14.2.2 Limit Suppose f( x, y) is a function. We say that
lim
(x,y)(a,b)
f(x, y) = L
if for every ǫ > 0 there is a δ > 0 so that whenever 0 <
p
(x a)
2
+ (y b)
2
< δ,
|f(x, y) L| < ǫ.
354 Chapter 14 Partial Differentiation
Figure 14.2.1 f(x, y) =
xy
2
x
2
+ y
4
(AP)
This says that we can make |f( x , y) L| < ǫ, no ma tter how small ǫ is, by ma king t he
distance from (x, y) to (a, b) “small enough”.
EXAMPLE 14.2.3 We show that lim
(x,y)(0,0)
3x
2
y
x
2
+ y
2
= 0. Suppose ǫ > 0. Then
3x
2
y
x
2
+ y
2
=
x
2
x
2
+ y
2
3|y|.
Note that x
2
/(x
2
+ y
2
) 1 and |y| =
p
y
2
p
x
2
+ y
2
< δ. So
x
2
x
2
+ y
2
3|y| < 1 · 3 · δ.
14.2 Limits and Continuity 355
We want to force this to be less than ǫ by picking δ “small enough.” If we choose δ = ǫ/3
then
3x
2
y
x
2
+ y
2
< 1 ·3 ·
ǫ
3
= ǫ.
Recall that a function f (x) is continuous at x = a if lim
xa
f(x) = f (a); roughly this
says that there is no “hole” or “jump” at x = a. We can say exactly the same t hi ng about
a function of two variables.
DEFINITION 14.2.4 f(x, y) is continuous at (a, b) if lim
(x,y)(a,b)
f(x, y) = f (a, b).
EXAMPLE 14.2.5 The function f (x, y) = 3x
2
y/(x
2
+ y
2
) is not continuous at (0, 0),
because f (0, 0) is not defined. H owever, we know t hat lim
(x,y)(0,0)
f(x, y) = 0, so we can
easily “fix” the problem, by extending the definition of f so that f(0, 0) = 0. This surface
is shown in figure 14 .2.2.
Figure 14.2.2 f(x, y) =
3x
2
y
x
2
+ y
2
(AP)
356 Chapter 14 Partial Differentiation
Note that in contrast to this example we cannot fix example 14 .2.1 at (0, 0) because
the limit does not exist. No matter what value we try to assign to f at (0, 0) the surface
will have a “ jump” there.
Fortunately, the functions we will examine will typically be continuous almost ev-
erywhere. Usually this follows easily from the fact that closely related functions of one
var iable are continuous. As with single variable functions, two classes of common functions
are particularly useful and easy to describe. A polynomial in two variables is a sum o f
terms of the form ax
m
y
n
, where a is a real number and m and n are non-negative integers.
A rational function is a quotient of poly nomials.
THEOREM 14.2.6 Poly nomials are continuous everywhere. Rational functions are
continuous everywhere they are defined.
Exercises 14.2.
Determine whether each limit exists. If it does, find the limit and prove that it is the lim it; if it
does not, explain how you know.
1. lim
(x,y)(0,0)
x
2
x
2
+ y
2
2. lim
(x,y)(0,0)
xy
x
2
+ y
2
3. lim
(x,y)(0,0)
xy
2x
2
+ y
2
4. lim
(x,y)(0,0)
x
4
y
4
x
2
+ y
2
5. lim
(x,y)(0,0)
sin(x
2
+ y
2
)
x
2
+ y
2
6. lim
(x,y)(0,0)
xy
p
2x
2
+ y
2
7. lim
(x,y)(0,0)
e
x
2
y
2
1
x
2
+ y
2
8. lim
(x,y)(0,0)
x
3
+ y
3
x
2
+ y
2
9. lim
(x,y)(0,0)
x
2
+ sin
2
y
2x
2
+ y
2
10. lim
(x,y)(1,0)
(x 1)
2
ln x
(x 1)
2
+ y
2
11. lim
(x,y)(1,1)
3x + 4y
12. lim
(x,y)(0,0)
4x
2
y
x
2
+ y
2
14.3 Partial Differentiation 357
13. Does the function f (x, y ) =
x y
1 + x + y
have any discontinuities? What about f(x, y) =
x y
1 + x
2
+ y
2
? Explain.
When we first considered what the derivative of a vector function might mean, there was
really not much difficulty i n understanding either how such a thing might be computed or
what it might measure. In the case of functions of two variables, things are a bit harder
to understand. If we think of a function of two variables in terms of i ts graph, a surface,
there is a more-or-less obvious derivative-like question we might ask, namely, how “steep”
is the surface. But it’s not clear that this has a simple answer, nor how we might proceed.
We will start with what seem to be very small steps toward the goal; surprisingly, it turns
out that these simple ideas hold the keys to a more general understanding.
Figure 14.3.1 f(x, y) = x
2
+ y
2
, cut by the plane x + y = 1 (AP)
Imagine a particular point o n a surface; what might we be able to say about how steep
it is? We can limit the question to ma ke it more familiar : how steep is the surface in a
particular direction? What does this even mean? Here’s one way to think of it: Suppose
we’re interested in t he point (a, b, c). Pick a straight line in the x-y pla ne through the
point (a, b, 0), then extend the line vertically into a plane. Look at the intersection of the
358 Chapter 14 Partial Differentiation
plane with the surface. If we pay attention to just the plane, we see the chosen straight
line where the x-axis would normall y be, and the i ntersection wit h the surface shows up as
a curve in the plane. Figure 14.3.1 shows the paraboli c surface from figure 14.1.2 , exposing
its cross-section above the li ne x + y = 1 .
In principle, this is a problem we k now how to solve: find the slope of a curve in a
plane. Let’s start by looking at some particularly easy lines: those parallel to the x o r y
axis. Suppose we are interested in the cross-section of f( x , y) above the line y = b. If we
substitute b for y in f (x, y), we get a function in one variable, describing the height of the
cross-section as a function of x. Because y = b is parallel to the x-axis, if we view it from
a vantage point o n the negative y-axis, we wi ll see what appears to be simply an ordinary
curve in the x-z plane.
8.8
8.0
7.2
6.4
5.6
4.8
4.0
3.2
2.4
1.6
0.8
0.0
3210−1−2−3
Figure 14.3.2 f(x, y) = x
2
+ y
2
, cut by the plane y = 2 (AP)
Consider again the parabolic surface f(x, y) = x
2
+y
2
. The cross-section above the line
y = 2 consists of all points (x, 2 , x
2
+ 4). Looking a t this cross-section from somewhere on
the negative y axis, we see what appears to be just the curve f(x) = x
2
+ 4. At any point
on the cross-section, ( a, 2, a
2
+ 4), the steepness of the surface in the direction of the line
y = 2 is simply the slope of the curve f(x) = x
2
+ 4 at x = a, namely 2a. Figure 14.3.2
shows the same parabolic surface as before, but now cut by the plane y = 2. The left
graph shows the cut-off surface, the right shows just the cross-section, looking up from the
negative y-axis toward the origin.
14.3 Partial Differentiation 359
If, say, we’re interested in the point (1, 2, 5) o n the surface, then the slope in t he
direction of the line y = 2 is 2x = 2( 1) = 2. This means that starting at (1, 2, 5) and
moving on the surface, above the line y = 2, in the direction of increasing x va lues, the
surface goes down; of course moving in the opposite direction, toward decreasing x values,
the surface will rise.
If we’re interested in some other line y = k, there is really no change in the computa-
tion. The equation of the cross-section above y = k is x
2
+ k
2
with derivative 2x. We can
save ourselves the effort, small as it is, of substituting k for y: all we are in effect doing
is temporarily assuming that y is some constant. Wit h this assumption, the derivative
d
dx
(x
2
+ y
2
) = 2x. To emphasize that we are only temporarily assuming y is constant, we
use a slightly different not ation:
x
(x
2
+ y
2
) = 2x; t he reminds us that there are more
var iables than x, but that onl y x is bei ng treated as a variable. We read the equation
as “the partial derivative of (x
2
+ y
2
) with respect to x is 2x. A convenient alternate
notation for the partial derivative of f (x, y) with respect to x is f
x
(x, y).
EXAMPLE 14.3.1 The partial derivative with respect to x of x
3
+ 3xy is 3x
2
+ 3y.
Note that the parti al derivative includes the variable y, unlike the example x
2
+ y
2
. It is
somewhat unusual for the partial derivative to depend on a single variable; this example
is more typical.
Of course, we can do the same sort of calculation for lines parallel to the y-axis. We
temporarily hold x constant, which gives us the equat ion of the cross-section above a line
x = k. We can then compute the derivative wit h respect to y; this will measure the
steepness of the curve in the y direction.
EXAMPLE 14.3.2 The partial derivative with respect to y of f (x, y) = sin(xy) + 3xy
is
f
y
(x, y) =
y
sin(xy) + 3x y = cos(xy)
y
(xy) + 3x = x cos(xy) + 3x.
So far, using no new techniques, we have succeeded i n measuring the slope of a surface
in two quite special dir ections. For functions of one variable, the derivative is closely linked
to the notion of tangent line. For surfaces, the analogous i dea is the tangent plane—a
plane that just touches a surface at a point, and has the same “steepness” as t he surface
in all directions. Even though we haven’t yet figured out how to compute the slope in
all directions, we have enough informatio n to find tangent planes. Suppose we want the
plane tangent to a surface at a particular point (a, b, c). If we compute the two partial
derivatives of the function for that point, we get enough information to determine two
lines tangent to the surface, both through (a, b, c) and both tangent to the surface in their
360 Chapter 14 Partial Differentiation
Figure 14.3.3 Tangent vectors and tangent plane. (AP)
respective directions. These two lines determine a plane, that is, there i s exactly o ne plane
containing the two lines: the tangent plane. Fig ure 14.3.3 shows (part of) two tangent
lines at a point, and the tangent pl ane containing them.
How can we di scover an equation for this tangent plane? We know a point on the
plane, (a, b, c); we need a vector normal to the plane. If we can find two vectors, one
parallel to each of the tangent lines we know how to find, then the cross product of these
vectors will give the desired normal vector.
0
1
2
3
0 1 2 3 4
z
x
f
x
(2, b)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
..
.......
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.
.
.
.
.
..
.
.
.
..
.
..
.
..
.
..
..
.
..
..
..
..
..
...
...
...
.....
.....
..................
.....
.....
...
...
...
..
..
..
..
..
..
.
..
.
..
.
..
.
..
.
.
.
..
.
.
.
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Figure 14.3.4 A tangent vector.
How can we find vectors parallel to the tangent lines? Consider first the line tangent
to the surface above the line y = b. A vector hu, v, wi parallel to this tangent line must
have y component v = 0 , and we may as well take the x component to be u = 1. The ratio
14.3 Partial Differentiation 361
of the z component to the x component is the slope of the tangent line, precisely what we
know how to compute. The slope of the tangent line is f
x
(a, b), so
f
x
(a, b) =
w
u
=
w
1
= w.
In other words, a vector parallel to this tangent line is h1, 0, f
x
(a, b)i, as shown in fig-
ure 14.3.4. If we repeat the reasoning for the tangent line above x = a, we get the vector
h0, 1, f
y
(a, b)i.
Now to find the desired normal vector we compute the cross product, h0, 1, f
y
i ×
h1, 0, f
x
i = hf
x
, f
y
, 1i. From our earlier discussion of planes, we can write down the
equation we seek: f
x
(a, b)x + f
y
(a, b)y z = k, and k as usual can be computed by
substituting a known point: f
x
(a, b)(a ) + f
y
(a, b)(b) c = k. There are various more-or-
less nice ways to write the result:
f
x
(a, b)x + f
y
(a, b)y z = f
x
(a, b)a + f
y
(a, b)b c
f
x
(a, b)x + f
y
(a, b)y f
x
(a, b)a f
y
(a, b)b + c = z
f
x
(a, b)(x a) + f
y
(a, b)(y b) + c = z
f
x
(a, b)(x a) + f
y
(a, b)(y b) + f(a, b) = z
EXAMPLE 14.3.3 Find the plane tangent to x
2
+ y
2
+ z
2
= 4 at (1, 1,
2). This
point is on the upper hemisphere, so we use f(x, y) =
p
4 x
2
y
2
. Then f
x
(x, y) =
x(4 x
2
y
2
)
1/2
and f
y
(x, y) = y(4 x
2
y
2
)
1/2
, so f
x
(1, 1) = f
y
(1, 1) = 1/
2
and the equation of the plane is
z =
1
2
(x 1)
1
2
(y 1) +
2.
The hemisphere and this tangent plane are pictured in figure 14.3.3.
So it appears t hat to find a tangent plane, we need only find two quite simple ordinary
derivatives, namely f
x
and f
y
. This is true if the tangent plane exists. It is, unfortunately,
not always the case that if f
x
and f
y
exist there is a tangent plane. Consider t he functi on
xy
2
/(x
2
+ y
4
) pictured in figure 14.2.1. This function has value 0 when x = 0 or y = 0,
and we can plug the hole” by agreeing that f (0, 0) = 0. Now it’s clear that f
x
(0, 0) =
f
y
(0, 0) = 0, because in t he x and y directions the surface is simply a horizontal line. But
it’s also clear from t he picture that this surface does not have anything that deserves to
be called a “tangent pla ne” at the origin, certainly not the x-y pla ne containing these two
tangent lines.
362 Chapter 14 Partial Differentiation
When does a surface have a tangent plane at a particular point? What we really want
from a tangent plane, as from a tangent line, is that the plane be a “good” approximation
of the surface near the point. Here is how we can make this precise:
DEFINITION 14.3.4 Let x = x x
0
, y = y y
0
, and z = z z
0
where
z
0
= f(x
0
, y
0
). The function z = f(x, y) is differentiable at (x
0
, y
0
) if
z = f
x
(x
0
, y
0
)∆x + f
y
(x
0
, y
0
)∆y + ǫ
1
x + ǫ
2
y,
and both ǫ
1
and ǫ
2
approach 0 as (x, y) approaches (x
0
, y
0
).
This definition takes a bit of absorbing. Let’s rewrite the central equation a bit:
z = f
x
(x
0
, y
0
)(x x
0
) + f
y
(x
0
, y
0
)(y y
0
) + f(x
0
, y
0
) + ǫ
1
x + ǫ
2
y. (14.3.1)
The first three terms on t he right give the value of z on the tangent plane, that is,
f
x
(x
0
, y
0
)(x x
0
) + f
y
(x
0
, y
0
)(y y
0
) + f(x
0
, y
0
)
is the z-value of the point on the plane above (x, y). Equation 14.3 .1 says that the z-value
of a point on the surface is equal to the z-value of a p o int o n the plane plus a “little bit,”
namely ǫ
1
x + ǫ
2
y. As (x, y) approaches ( x
0
, y
0
), both x and y approach 0, so this
little bit ǫ
1
x + ǫ
2
y also approaches 0, and the z-values on the surface and the plane
get close to each other. But that by itself is not very interesting: since the surface and
the plane both contain the point (x
0
, y
0
, z
0
), the z values will approach z
0
and hence get
close to each other whether the tangent plane is “tangent” to the surface or not. The ext ra
condition in the definition says that as (x, y) a pproaches (x
0
, y
0
), the ǫ values approach
0—this means that ǫ
1
x + ǫ
2
y approaches 0 much, much faster, because ǫ
1
x is much
smaller t han either ǫ
1
or x. It is this extra conditi on that makes the pla ne a tangent
plane.
We can see that the extra condition on ǫ
1
and ǫ
2
fits neatly with the definition of
partial deriva tives. Suppose we tempo rarily fix y = y
0
, so y = 0. Then t he equation
from the definition becomes
z = f
x
(x
0
, y
0
)∆x + ǫ
1
x
or
z
x
= f
x
(x
0
, y
0
) + ǫ
1
.
Now taking the limit of the two sides as x approaches 0, the left side turns into the
partial derivative of z wit h respect to x at (x
0
, y
0
), or in other words f
x
(x
0
, y
0
), and the
14.3 Partial Differentiation 363
right side does the same, because as (x, y) approaches (x
0
, y
0
), ǫ
1
approaches 0. Essentially
the same calculation works for f
y
.
Almost all of the functions we will encounter are differentiable at points we will be
interested in, and often at all poi nts. This is usually because the functions satisfy the
hypotheses of this theorem.
THEOREM 14.3.5 If f(x, y) and its partial derivat ives are continuous at a point
(x
0
, y
0
), then f is differentiable there.
Exercises 14.3.
1. Find f
x
and f
y
where f (x, y) = cos(x
2
y) + y
3
.
2. Find f
x
and f
y
where f (x, y) =
xy
x
2
+ y
.
3. Find f
x
and f
y
where f (x, y) = e
x
2
+y
2
.
4. Find f
x
and f
y
where f (x, y) = xy ln(xy).
5. Find f
x
and f
y
where f (x, y) =
p
1 x
2
y
2
.
6. Find f
x
and f
y
where f (x, y) = x tan(y).
7. Find f
x
and f
y
where f (x, y) =
1
xy
.
8. Find an equat ion for the pl ane tangent to 2x
2
+ 3y
2
z
2
= 4 at (1, 1, 1).
9. Find an equat ion for the pl ane tangent to f ( x, y) = sin(xy) at (π, 1/2, 1).
10. Find an equat ion for the pl ane tangent to f (x, y) = x
2
+ y
3
at (3, 1, 10).
11. Find an equat ion for the pl ane tangent to f (x, y) = x ln(xy) at (2, 1/2, 0).
12. Find an equat ion for the line normal to x
2
+ 4y
2
= 2z at (2, 1, 4).
13. Expl ain in your own words why, when taking a partial derivative of a function of multiple
variables, we can treat the variables not being differentiated as constants.
14. Consider a differentiable function, f (x, y). Give physical interpretations of the meanings of
f
x
(a, b) and f
y
(a, b) as they relate to the graph of f .
15. In much the same way that we used the tangent line to approximate the value of a function
from single variable calculus, we can use the tangent plane to approximate a function from
multivariable calculus. Consider the tangent plane found in Exercise 11. Use this plane to
approximate f (1.98, 0.4).
16. Suppose that one of your colleagues has calculated the part ial derivatives of a given function,
and reported to you that f
x
(x, y) = 2x + 3y and that f
y
(x, y) = 4x + 6y. Do you be lieve
them? Why or why not? If not, what answer might you have accepted for f
y
?
17. Suppose f(t) and g(t) are single variable differentiable functions. Find z/∂x and z/∂y for
each of the following two variable functions.
a. z = f(x)g(y)
b. z = f (xy)
c. z = f (x/y)
364 Chapter 14 Partial Differentiation
Consider the surface z = x
2
y + x y
2
, and suppose that x = 2 + t
4
and y = 1 t
3
. We can
think of the l atter two equations as describing how x and y change relative to, say, time.
Then
z = x
2
y + xy
2
= (2 + t
4
)
2
(1 t
3
) + (2 + t
4
)(1 t
3
)
2
tells us explicit ly how the z coordinate of the corresponding point on the surface depends
on t. If we want t o know dz/dt we can compute it more or less directly—it’s act ually a bit
simpler to use the chain rule:
dz
dt
= x
2
y
+ 2xx
y + x 2yy
+ x
y
2
= (2xy + y
2
)x
+ (x
2
+ 2xy)y
= (2(2 + t
4
)(1 t
3
) + (1 t
3
)
2
)(4t
3
) + ((2 + t
4
)
2
+ 2(2 + t
4
)(1 t
3
))(3t
2
)
If we look carefully at the middle step, dz/ dt = (2xy + y
2
)x
+ (x
2
+ 2xy)y
, we notice that
2xy + y
2
is z/∂x, and x
2
+ 2xy is z/∂y. This turns out to be true in general, and gives
us a new chain rule:
THEOREM 14.4.1 Suppose that z = f(x, y), f is differentiable, x = g(t), and y = h(t) .
Assuming that the relevant derivatives exist,
dz
dt
=
z
x
dx
dt
+
z
y
dy
dt
.
Proof. If f is differentiable, then
z = f
x
(x
0
, y
0
)∆x + f
y
(x
0
, y
0
)∆y + ǫ
1
x + ǫ
2
y,
where ǫ
1
and ǫ
2
approach 0 as (x, y) approaches (x
0
, y
0
). Then
z
t
= f
x
x
t
+ f
y
y
t
+ ǫ
1
x
t
+ ǫ
2
y
t
. (14.4.1)
14.4 The Chain Rule 365
As t approaches 0, (x, y) approaches (x
0
, y
0
) and so
lim
t0
z
t
=
dz
dt
lim
t0
ǫ
1
x
t
= 0 ·
dx
dt
lim
t0
ǫ
2
y
t
= 0 ·
dy
dt
and so taking the limit of (14.4.1) as t goes to 0 gives
dz
dt
= f
x
dx
dt
+ f
y
dy
dt
,
as desired.
We can write the chain rule in way that is somewhat closer to the single var iable chain
rule:
df
dt
= hf
x
, f
y
i ·hx
, y
i,
or (roughly) the derivatives of the outside function “times” the derivatives of t he inside
functions. Not surprisingly, essentially the same chain rule work s for functions of more
than two va riables, for example, given a function of t hree variables f(x, y, z) , where each
of x , y and z is a function of t,
df
dt
= hf
x
, f
y
, f
z
i ·hx
, y
, z
i.
We can even extend the i dea further. Suppose that f(x, y) is a function and x = g(s, t)
and y = h(s, t) are functions of two variables s and t. Then f is “really” a function of s
and t as well, and
f
s
= f
x
g
s
+ f
y
h
s
f
t
= f
x
g
t
+ f
y
h
t
.
The natural ex tension of this to f(x, y, z) works as well.
Recall that we used the ordinary chain rule to do implicit differentiati on. We can do
the same wit h the new chain rule.
EXAMPLE 14.4.2 x
2
+ y
2
+ z
2
= 4 defines a sphere, which i s not a function of x and
y, though it can be thought of as two functions, the top and bottom hemispheres. We
can think of z as one of these two functions, so really z = z(x, y), and we can think of x
366 Chapter 14 Partial Differentiation
and y as particularly simple functions of x and y, and let f(x, y, z) = x
2
+ y
2
+ z
2
. Since
f(x, y, z) = 4, f/∂x = 0, but using the chain rule:
0 =
f
x
= f
x
x
x
+ f
y
y
x
+ f
z
z
x
= (2x)(1) + (2y)(0) + (2z)
z
x
,
noting that since y is temporarily held constant its deriva tive y/∂x = 0. Now we can
solve for z/∂x:
z
x
=
2x
2z
=
x
z
.
In a similar manner we can compute z/∂y.
Exercises 14.4.
1. Use the chain rule to compute dz/dt for z = sin(x
2
+ y
2
), x = t
2
+ 3, y = t
3
.
2. Use the chain rule to compute dz/dt for z = x
2
y, x = sin(t), y = t
2
+ 1.
3. Use the chain rule to compute z/∂s and z/∂t for z = x
2
y, x = sin(st), y = t
2
+ s
2
.
4. Use the chain rule to compute z/∂s and z/∂t for z = x
2
y
2
, x = st, y = t
2
s
2
.
5. Use the chain rule to compute z/∂x and z/∂y for 2x
2
+ 3y
2
2z
2
= 9.
6. Use the chain rule to compute z/∂x and z/∂y for 2x
2
+ y
2
+ z
2
= 9.
7. Use the chain rule to compute z/∂x and z/∂y for xy
2
+ z
2
= 5.
8. Use the chain rule to compute z/∂x and z/∂y for 2 sin(xyz) = 1.
9. Chemi stry students will recognize the ideal gas law , given by P V = nRT whi ch relates the
Pressure, Volume, and Temperature of n moles of gas. (R is the ideal gas constant). Thus,
we can view pressure, volume, and temperature as variables, each one dependent on the other
two.
a. If pressure of a gas is increasing at a rate of 0.2P a/min and temperature is increasing at
a rate of 1K/min, how fast is the volume changing?
b. If the volume of a gas is decreasing at a rate of 0.3m
3
/min and temperature i s increasing
at a rate of .5K/min, how fast is the pressure changing?
c. If the pressure of a gas is decreasing at a rate of 0.4P a/min and the volume is increasing
at a rate of 3L/min, how fast is the temperature changing?
10. Verify the following identi ty in the case of the ideal gas law:
P
V
V
T
T
P
= 1
11. The previous exercise was a special case of the following fact, which you are to verify here:
If F (x, y, z) is a function of 3 variables, and the relation F (x, y, z) = 0 defines each of the
14.5 Directional Derivatives 367
variables in terms of t he other two, namely x = f (y, z), y = g(x, z) and z = h(x, y), then
x
y
y
z
z
x
= 1
We stil l have not answered one of our first questions about the steepness of a surface:
starting at a point on a surface given by f(x, y), and walking in a particular direction, how
steep is the surface? We are now ready to answer the question.
We already know roughly what has to be done: as shown i n figure 14.3.1, we extend a
line in the x-y plane to a vertical plane, and we then compute the slope of the curve that
is the cross-section of the surface in that plane. The major stumbling block is that what
appears in this plane to be the horizontal axis, namel y the line in the x-y plane, is not an
actual axis—we know nothing about the “units” along the axis. Our goal is to make this
line into a t axis; then we need formulas to write x and y in terms of this new var iable t;
then we can write z in terms of t since we know z in t erms of x and y; and finally we can
simply take the derivative.
So we need to somehow “mar k off units on the line, and we need a convenient way
to refer to the line i n calculations. It turns out that we can accomplish both by using the
vector form of a l ine. Suppose that u is a unit vector hu
1
, u
2
i in the direction of interest. A
vector equation for the line through (x
0
, y
0
) in this direction is v(t) = hu
1
t + x
0
, u
2
t + y
0
i.
The height of the surface above the point (u
1
t+ x
0
, u
2
t+ y
0
) is g(t) = f(u
1
t+ x
0
, u
2
t+ y
0
).
Because u is a unit vector, the value of t is precisely the distance along the line from
(x
0
, y
0
) to (u
1
t + x
0
, u
2
t + y
0
); this means that t he line is effectively a t axis, with orig in
at the point (x
0
, y
0
), so the slope we seek is
g
(0) = hf
x
(x
0
, y
0
), f
y
(x
0
, y
0
)i ·hu
1
, u
2
i
= hf
x
, f
y
i ·u
= f · u
Here we have used the chain rule and the derivatives
d
dt
(u
1
t+x
0
) = u
1
and
d
dt
(u
2
t+y
0
) = u
2
.
The vector hf
x
, f
y
i is very useful, so it has i ts own symbol, f, pronounced “del f”; it is
also called the gradient of f.
EXAMPLE 14.5.1 Find the slope of z = x
2
+ y
2
at (1, 2) in the direction of the vector
h3, 4i.
We first compute the gradient at (1, 2 ): f = h2x, 2yi, which is h2, 4i at (1, 2). A unit
vector in the desired direction is h3/5, 4/5i, and the desired slope is then h2, 4i·h3/5, 4/5i =
6/5 + 16/5 = 22/5.
368 Chapter 14 Partial Differentiation
When doing such problems, it is easy to forget that we require a unit vector in the
calculation f · u. You may prefer to r emember that this can always be written as
f · v/|v|. In the previous example, we mi ght then have computed h2, 4i · h3, 4i/| h3, 4i|,
rather than remembering to first compute u = h3 , 4i/|h3, 4i|.
EXAMPLE 14.5.2 Find a tangent vector to z = x
2
+ y
2
at (1, 2) in the directi on of
the vector h3, 4i and show that it is parallel to the tangent plane at that point.
Since h3/5, 4/ 5i is a unit vector in the desired direction, we can easily expand it to a
tangent vector simply by adding the third coordinate computed in the previous example:
h3/5, 4/5, 22/5i. To see that this vector is parallel to the tangent plane, we can compute
its dot product with a normal to the plane. We know that a normal to the t a ngent pl ane
is
hf
x
(1, 2), f
y
(1, 2), 1i = h2, 4, 1i,
and t he dot product is h2, 4, 1i · h3/5, 4/5, 22/5i = 6/5 + 16/5 22/5 = 0, so t he two
vectors a re perpendicular. (Not e t hat the vector normal to the surface, namely hf
x
, f
y
, 1i,
is simply the gradient with a 1 tacked on as the third component.)
The slope of a surface given by z = f (x, y) i n the direction of a (two-dimensional)
unit vector u is called the direction al derivative of f, written D
u
f. The directional
derivative immediately provides us with some additional information. We know that
D
u
f = f · u = |∇f ||u|cos θ = |∇f |cos θ
if u is a unit vector; θ is the angle between f and u. This tells us immediately that the
largest va lue o f D
u
f occurs when cos θ = 1, namely, when θ = 0, so f is parallel to u.
In other words, the gradient f points i n the dir ection of steepest ascent of the surface,
and |∇f | is the slope in that direction. Likewise, the smallest value of D
u
f occurs when
cos θ = 1, namely, when θ = π, so f is anti-parallel to u. In other words, −∇f points
in the direction of steepest descent of the surface, a nd −|∇f | is the slope in that directio n.
EXAMPLE 14.5.3 Investigate the directio n of steepest ascent and descent for z =
x
2
+ y
2
.
The gradient is h2x, 2yi = 2hx, yi; this is a vector parallel to the vector hx, yi, so the
direction of steepest ascent is directly away from the origin, starting at the point (x, y) .
The direction of steepest descent is thus directly toward the origin from (x, y). Note that
at (0, 0) the gradient vector is h0, 0i, which has no direction, and it is clear from the plot
of this surface that there is a minimum point at the origin, and tangent vectors in all
directions are parallel to the x-y plane.
If f is perpendicular to u, D
u
f = |∇f|cos(π/2) = 0, since cos(π/ 2) = 0. This means
that in either of the two directi o ns perpendicular to f, the slope of the surface is 0; this
14.5 Directional Derivatives 369
implies that a vector in either of these directions is tangent to the level curve at that point.
Starting with f = hf
x
, f
y
i, it is easy to find a vector perpendicular to it: either hf
y
, f
x
i
or h−f
y
, f
x
i will work.
If f(x, y, z) is a function of three variables, all the calcula tions proceed in essentially
the same way. The rat e at w hi ch f changes in a particular direction is f · u, where now
f = hf
x
, f
y
, f
z
i and u = hu
1
, u
2
, u
3
i i s a unit vector. Again f points in the direction of
maximum rate of increase, −∇f points in the direction of maximum rate of decrease, and
any vector perpendicular to f is tangent to the level surface f( x , y, z) = k at the point
in questio n. Of course there are no l onger just two such vectors; the vectors perpendicular
to f describe the tangent plane to the level surface, or in other words f is a normal to
the tangent plane.
EXAMPLE 14.5.4 Suppose the temperature at a point in space is given by T (x, y, z) =
T
0
/(1 + x
2
+ y
2
+ z
2
); at the or igin the temperature in Kelvin is T
0
> 0, and it decreases in
every direction from there. It might be, for example, that there is a source of heat at the
origin, and as we get farther from the source, the temperature decreases. The gradient is
T = h
2T
0
x
(1 + x
2
+ y
2
+ z
2
)
2
,
2T
0
y
(1 + x
2
+ y
2
+ z
2
)
2
,
2T
0
z
(1 + x
2
+ y
2
+ z
2
)
2
i
=
2T
0
(1 + x
2
+ y
2
+ z
2
)
2
hx, y, zi.
The gra di ent points directly at the origin from the point (x, y, z)—by moving directly
toward the heat source, we increase the temp erature as quickly as possible.
EXAMPLE 14.5.5 Find the points on the surface defined by x
2
+ 2y
2
+ 3z
2
= 1 where
the tangent plane is parallel to the plane defined by 3x y + 3z = 1.
Two planes are parallel if their normals are parallel or anti-parallel, so we want to
find the points on the surface with normal parallel or anti-parallel to h3 , 1, 3i. Let f =
x
2
+ 2y
2
+ 3z
2
; t he gr a dient of f is normal to the level surface at every point, so we are
looking for a gradient parallel or anti-parallel to h3, 1, 3i. The gradient i s h2x, 4 y, 6zi; if
it is paral lel or anti-parall el to h3, 1, 3i, then
h2x, 4y, 6zi = kh3, 1, 3i
for some k. This means we need a solution to the equations
2x = 3k 4y = k 6z = 3k
but this is three equations in four unknowns—we need another equation. What we haven’t
used so far is that the points we seek are on the surface x
2
+ 2y
2
+ 3z
2
= 1; this is the
370 Chapter 14 Partial Differentiation
fourth equation. If we solve the first three equations for x, y, and z and substitute into
the fourth equation we get
1 =
3k
2
2
+ 2
k
4
2
+ 3
3k
6
2
=
9
4
+
2
16
+
3
4
k
2
=
25
8
k
2
so k = ±
2
2
5
. The desired points are
3
2
5
,
2
10
,
2
5
!
and
3
2
5
,
2
10
,
2
5
!
. The
ellipsoid and the three planes are shown in figure 14.5.1.
Figure 14.5.1 Ellipsoid with two tangent planes paral lel t o a given plane. (AP)
Exercises 14.5.
1. Find D
u
f for f = x
2
+ xy + y
2
in the directi on of v = h2, 1i at the point (1, 1).
2. Find D
u
f for f = sin(xy) in the direction of v = h−1, 1i at the point (3, 1).
3. Find D
u
f for f = e
x
cos(y) in the direc tion 30 degrees from t he positi ve x axis at the point
(1, π/4).
14.5 Directional Derivatives 371
4. The temperature of a thin plate in the x-y plane is T = x
2
+ y
2
. How fast does temperature
change at the point (1, 5) moving in a direct ion 30 degrees from the positive x axis?
5. Suppose the density of a thin plate at (x, y) is 1/
p
x
2
+ y
2
+ 1. Find the rate of change of
the density at (2, 1) in a direction π/3 radi ans from the positive x axis.
6. Suppose the electric potential at (x, y) is ln
p
x
2
+ y
2
. Find the rate of change of the potential
at (3, 4) toward the origin and also in a direction at a right angle to the direction toward the
origin.
7. A plane perpendicular to the x-y plane contains the point (2, 1, 8) on the paraboloid z =
x
2
+ 4y
2
. T he cross-section of the parabol oid created by this plane has slope 0 at this point.
Find an equation of the plane.
8. A plane perpendi c ular to the x-y plane contains the point (3, 2, 2) on the paraboloid 36z =
4x
2
+ 9y
2
. The cross-section of the paraboloid created by this plane has slope 0 at this point.
Find an equation of the plane.
9. Suppose the temperature at (x, y, z) is given by T = xy + sin(yz). In what direction should
you go from the point (1, 1, 1) to decrease the temperature as quickly as possible? What is
the rate of change of temperature in this direction?
10. Suppose the temperature at (x, y, z) is given by T = xyz. In what direction can you go from
the point (1, 1, 1) to maintain the same temperature?
11. Find an equat ion for the pl ane tangent to x
2
3y
2
+ z
2
= 7 at (1, 1, 3).
12. Find an equat ion for the pl ane tangent to xyz = 6 at (1, 2, 3).
13. Find a vector function for the line normal to x
2
+ 2y
2
+ 4z
2
= 26 at (2, 3, 1).
14. Find a vector function for the line normal to x
2
+ y
2
+ 9z
2
= 56 at (4, 2, 2).
15. Find a vector function for the line normal to x
2
+ 5y
2
z
2
= 0 at (4, 2, 6) .
16. Find the directions in which the directi onal derivative of f (x, y) = x
2
+ si n(xy) at the point
(1, 0) has the value 1.
17. Show that the curve r(t) = hln(t), t ln(t), ti is tangent to the surface xz
2
yz + cos(xy) = 1
at the point (0, 0, 1).
18. A bug is crawling on the surface of a hot plate, the temperature of which at the point x
units to the right of the lower left corner and y units up from the lower left corner is given
by T (x, y) = 100 x
2
3y
3
.
a. If the bug is at the point (2, 1), i n what direction should it move to cool off the fastest?
How fast will the temperature drop i n this direction?
b. If the bug is at the point (1, 3), in what direction should it move in order to maintain its
temperature?
19. The el evation on a portion of a hi ll is given by f (x, y) = 100 4x
2
2y. From the locat ion
above (2, 1), in which directi on wi ll water run?
20. The contour map here shows wind spe ed in knots during Hurricane Andrew on August
24, 1992. Use it to estimate the value of the directional derivative of the wind speed at
Homestead, FL, in the direction of the eye of the hurricane. Explain the meaning of your
answer to a lay person.
372 Chapter 14 Partial Differentiation
21. Suppose that g(x, y) = y x
2
. Find the gradient at the point (1, 3). Sketch the level curve
to the graph of g when g(x, y) = 2, and plot both the tangent line and the gradient vector
at the point (1, 3). (Make your sketch large). What do you notice, geometri cally?
22. The gradient f is a vector valued function of two variables. Prove the following gradient
rules. Assume f(x, y) and g(x, y) are differentiable functions.
a. (f g) = f(g) + g(f )
b. (f/g) = (gf f g)/g
2
c. ( (f(x, y))
n
) = nf (x, y)
n1
f
In single variable calculus we saw that the second derivative is often useful: in appropriate
circumstances it measures acceleration; it can be used to identify maximum and minimum
points; it tells us something about how sharply curved a graph is. Not surprisingly, second
derivatives are also useful in the multi-variable case, but aga in not surprisingly, things are
a bit more complicated.
It’s easy t o see where some complication is going to come from: with two variables
there are four po ssible second derivatives. To take a “derivative,” we must take a part ial
derivative with respect to x or y, and there are four ways to do it: x then x, x then y, y
then x, y then y.
EXAMPLE 14.6.1 Compute all four second derivatives of f(x, y) = x
2
y
2
.
Using an o bvious notation, we g et :
f
xx
= 2y
2
f
xy
= 4xy f
yx
= 4xy f
yy
= 2x
2
.
14.7 Maxima and minima 373
Yo u will have noticed that two of these are the same, the “mixed partials” computed
by taking partial derivatives with respect to both va riables in the two possible orders. This
is not an accident—as long as the function is reasonably nice, this will a lways be true.
THEOREM 14.6.2 Clairaut’s Th eorem If the mixed partial derivatives are con-
tinuous, they are equal.
EXAMPLE 14.6.3 Compute the mixed partials of f = xy/(x
2
+ y
2
).
f
x
=
y
3
x
2
y
(x
2
+ y
2
)
2
f
xy
=
x
4
6x
2
y
2
+ y
4
(x
2
+ y
2
)
3
We leave f
yx
as an exercise.
Exercises 14.6.
1. Find all first and second partial derivatives of f = xy/(x
2
+ y
2
).
2. Find all first and second partial derivatives of x
3
y
2
+ y
5
.
3. Find all first and second partial derivatives of 4x
3
+ xy
2
+ 10.
4. Find all first and second partial derivatives of x sin y.
5. Find all first and second partial derivatives of sin(3x) cos(2y).
6. Find all first and second partial derivatives of e
x+y
2
.
7. Find all first and second partial derivatives of l n
p
x
3
+ y
4
.
8. Find all first and second partial derivatives of z with respect to x and y if x
2
+4y
2
+16z
2
64 =
0.
9. Find all first and second partial derivatives of z with respect to x and y if xy + y z + xz = 1.
10. Let α and k b e constants. Prove that the function u(x, t) = e
α
2
k
2
t
sin(kx) is a solution to
the heat equation u
t
= α
2
u
xx
11. Let a be a constant. Prove that u = sin(x at) + ln(x+at) is a solution to the wave equation
u
tt
= a
2
u
xx
.
12. How many third-order derivatives does a function of 2 variables have? How many of these
are distinct?
13. How many nth order derivatives does a function of 2 variables have? How many of these are
distinct?
Suppose a surface given by f(x, y) has a local maximum at (x
0
, y
0
, z
0
); geometrically, this
point on the surface looks like the top of a hill. If we look at t he cross-section in the
plane y = y
0
, we will see a local maximum on the curve at (x
0
, z
0
), and we know from
single-var iable calculus that
z
x
= 0 at this point. Likewise, in the plane x = x
0
,
z
y
= 0.
374 Chapter 14 Partial Differentiation
So if there is a local ma ximum at (x
0
, y
0
, z
0
), both partial deriva tives at the point must
be zero, and likewise for a local minimum. T hus, t o find local maximum and minimum
points, we need only consider those points at which both partial derivatives are 0. As in
the single-variable case, it is possible for the derivatives to be 0 at a point that is neither
a maximum or a minimum, so we need to test these poi nts further.
Yo u will recall that in the single variable case, we examined three methods to identify
maximum and minimum po ints; the most useful is the second derivative test, though it
does not always work. For functions of two variables there is also a second derivative test;
again it is by far the most useful test, though it doesn’t always work.
THEOREM 14.7.1 Suppose that the second partial derivatives of f(x, y) are continuous
near (x
0
, y
0
), and f
x
(x
0
, y
0
) = f
y
(x
0
, y
0
) = 0. We denote by D the di scri minant:
D(x
0
, y
0
) = f
xx
(x
0
, y
0
)f
yy
(x
0
, y
0
) f
xy
(x
0
, y
0
)
2
.
If D > 0:
if f
xx
(x
0
, y
0
) < 0: there is a local maximum at (x
0
, y
0
);
if f
xx
(x
0
, y
0
) > 0: there is a local minimum at (x
0
, y
0
);
if D < 0: there is neither a maximum nor a minimum a t (x
0
, y
0
);
if D = 0: the test fails.
EXAMPLE 14.7.2 Verify that f (x, y) = x
2
+ y
2
has a mini mum at (0, 0).
First, we compute all the needed derivatives:
f
x
= 2x f
y
= 2y f
xx
= 2 f
yy
= 2 f
xy
= 0.
The derivatives f
x
and f
y
are zero only at (0, 0). Applying the second derivative test t here:
D(0, 0) = f
xx
(0, 0)f
yy
(0, 0) f
xy
(0, 0)
2
= 2 · 2 0 = 4 > 0
and
f
xx
(0, 0) = 2 > 0,
so there is a local minimum at (0, 0), and there are no other possibilities.
EXAMPLE 14.7.3 Find all local maxima and minima for f(x, y) = x
2
y
2
.
The derivatives:
f
x
= 2x f
y
= 2y f
xx
= 2 f
yy
= 2 f
xy
= 0.
Again there is a single cri tical point, at (0, 0 ), and
D(0, 0) = f
xx
(0, 0)f
yy
(0, 0) f
xy
(0, 0)
2
= 2 ·2 0 = 4 < 0,
so there is neit her a maximum nor minimum there, and so there are no local m a xima or
minima. The surface is shown in figure 14 .7.1.
14.7 Maxima and minima 375
Figure 14.7.1 A saddle point, neither a m aximum nor a minimum. (AP)
EXAMPLE 14.7.4 Find all local maxima and minima for f(x, y) = x
4
+ y
4
.
The derivatives:
f
x
= 4x
3
f
y
= 4y
3
f
xx
= 12x
2
f
yy
= 12y
2
f
xy
= 0.
Again there is a single cri tical point, at (0, 0 ), and
D(0, 0) = f
xx
(0, 0)f
yy
(0, 0) f
xy
(0, 0)
2
= 0 · 0 0 = 0,
so we get no information. However, in this case it is easy to see that there is a minimum
at (0, 0), because f(0, 0) = 0 and at all other points f(x, y) > 0.
EXAMPLE 14.7.5 Find all local maxima and minima for f(x, y) = x
3
+ y
3
.
The derivatives:
f
x
= 3x
2
f
y
= 3y
2
f
xx
= 6x
2
f
yy
= 6y
2
f
xy
= 0.
Again there is a single cri tical point, at (0, 0 ), and
D(0, 0) = f
xx
(0, 0)f
yy
(0, 0) f
xy
(0, 0)
2
= 0 · 0 0 = 0,
so we get no informat ion. In this case, a little thought shows there is neither a maximum
nor a mi ni mum at (0, 0): when x and y are both positive, f(x, y) > 0, and w hen x and
376 Chapter 14 Partial Differentiation
y are both negative, f(x, y) < 0, and there are points of both kinds arbitrarily close to
(0, 0). Alternately, if we look at the cross-sectio n when y = 0, we get f(x, 0) = x
3
, which
does not have either a maximum or minimum at x = 0.
EXAMPLE 14.7.6 Suppose a box with no top is to hold a certain volume V . Find the
dimensions for the box that result in the minimum surface area.
The a rea of the box is A = 2hw + 2hl + lw, and the volume is V = lwh, so we can
write the area as a function of two va r iables,
A(l, w) =
2V
l
+
2V
w
+ lw.
Then
A
l
=
2V
l
2
+ w and A
w
=
2V
w
2
+ l.
If we set these equal to zero and solve, we find w = (2V )
1/3
and l = (2V )
1/3
, and the
corresponding height is h = V /(2V )
2/3
.
The second derivatives are
A
ll
=
4V
l
3
A
ww
=
4V
w
3
A
lw
= 1,
so the discriminant is
D =
4V
l
3
4V
w
3
1 = 4 1 = 3 > 0.
Since A
ll
is 2, there is a local minimum at the crit ical point. Is this a global minimum?
It i s, but it is difficult to see this analytically; physically and graphically it is clear that
there is a minimum, in whi ch case it must be at the single critical point. This applet shows
an example of such a graph. Note that we must choose a value for V in order to graph
it.
Recall that when we did single var iable global maximum and minimum problems, the
easiest cases were those for which the variable could be limited to a finite closed interval,
for then we simply had to check all critical values and the endpoints. The previous example
is difficult because there is no finite boundary to the domain of the problem—both w and
l can be in (0, ). As in the single variable case, the problem is often simpler when there
is a finite boundary.
THEOREM 14.7.7 If f (x, y) is continuous on a closed and bo unded subset of R
2
, then
it has both a maximum and minimum value.
14.7 Maxima and minima 377
As in the case of singl e variable functions, this means that the ma ximum and minimum
values must occur at a critical point or on the boundary; in t he two variable case, however,
the boundary is a curve, not merely two endpoints.
EXAMPLE 14.7.8 The length of the diag onal of a box is to be 1 meter; find the
maximum possible volume.
If the box is placed with one corner at the origin, and sides along the axes, the length
of the diagonal is
p
x
2
+ y
2
+ z
2
, and t he volume is
V = x yz = xy
p
1 x
2
y
2
.
Clearly, x
2
+ y
2
1, so the domain we are interested in is the quarter of the unit disk in
the first quadrant. C omputing derivatives:
V
x
=
y 2yx
2
y
3
p
1 x
2
y
2
V
y
=
x 2xy
2
x
3
p
1 x
2
y
2
If these are both 0, then x = 0 o r y = 0, or x = y = 1/
3. The boundary o f the domain is
composed of three curves: x = 0 for y [0, 1]; y = 0 for x [0, 1]; and x
2
+ y
2
= 1, where
x 0 and y 0. In all three cases, the volume xy
p
1 x
2
y
2
is 0, so the ma ximum
occurs at the only critical point (1/
3, 1/
3, 1/
3). See figure 14.7.2.
Exercises 14.7.
1. Find all local maximum and minimum points of f = x
2
+ 4y
2
2x + 8y 1.
2. Find all local maximum and minimum points of f = x
2
y
2
+ 6x 10y + 2.
3. Find all local maximum and minimum points of f = xy.
4. Find all local maximum and minimum points of f = 9 + 4x y 2x
2
3y
2
.
5. Find all local maximum and minimum points of f = x
2
+ 4xy + y
2
6y + 1.
6. Find all local maximum and minimum points of f = x
2
xy + 2y
2
5x + 6y 9.
7. Find the absolute maximum and m inimum poi nts of f = x
2
+ 3y 3xy over the region
bounded by y = x, y = 0, and x = 2.
8. A six-si ded rectangular box is to hold 1/2 cubi c meter; what shape should the box be to
minimize surface area?
9. The post office will accept packages whose combined length and girth is at most 130 inches.
(Girth is t he maximum distance around the package perpendicular to the length; for a rect-
angular box, the length is the largest of the three dimensions.) What is the largest volume
that can be sent in a rectangular box?
378 Chapter 14 Partial Differentiation
Figure 14.7.2 The volume of a box with fixed length diagonal.
10. The bottom of a rectangular box costs twice as much per unit area as the sides and top.
Find the shape for a given volume that will minimize cost.
11. Using the methods of this section, find the shortest distance from the origin to the plane
x + y + z = 10.
12. Using the methods of this section, find the shortest distance from the point (x
0
, y
0
, z
0
) to
the plane ax + by + c z = d. You may assume that c 6= 0; use of Sage or similar software is
recommended.
13. A trough i s to be formed by bending up two sides of a long metal rectangle so that the
cross-section of the trough is an isosceles trapezoid, as in figure 6.2.6. If the width of the
metal sheet is 2 meters, how should it be bent to maximize the volume of the trough?
14. Given t he three points (1, 4), (5, 2), and (3, 2), (x 1)
2
+ (y 4)
2
+ (x 5)
2
+ (y 2)
2
+
(x 3)
2
+ (y + 2)
2
is the sum of the squares of the distances from point (x, y) to the three
points. Find x and y so that this quantity is mini mized.
15. Suppose that f(x, y) = x
2
+ y
2
+ kxy. Find and classify the critical points, and discuss how
they change when k takes on different values.
16. Find the shortest di stance from the poi nt (0, b) to the parabola y = x
2
.
17. Find the shortest di stance from the poi nt (0, 0, b) to t he paraboloid z = x
2
+ y
2
.
18. Consider the function f(x, y) = x
3
3x
2
y + y
3
.
a. Show that (0, 0) is the only critical point of f .
b. Show that the discriminant test is inconclusive for f .
c. Determine the cross-sections of f obtained by sett ing y = kx for various values of k.
14.8 Lagrange Multipliers 379
d. W hat kind of critical point is (0, 0)?
19. Find the volume of the largest rectangular box with edges parallel to the axes that can be
inscribed in the ell ipsoid 2x
2
+ 72y
2
+ 18z
2
= 288.
Many applied max/min problems take the form of the last two examples: we want to
find an extreme value of a function, like V = x yz, subject to a constraint, like 1 =
p
x
2
+ y
2
+ z
2
. Often this can be done, as we have, by expl icitly combining the equations
and then finding critical points. There is a nother approach that is often convenient, the
method of Lagrange multipliers.
It i s somewhat easier to understand two variable problems, so we begin with one as
an example. Suppose the perimeter of a rectangle is to be 100 units. Find the rectangle
with largest area. This is a fairly straightforward problem from single variable calculus.
We write down the two equations: A = xy, P = 100 = 2x + 2y, solve the second of
these for y (or x), substitute into the first, and end up with a one-variable maximization
problem. Let’s now think of it di fferently: the equation A = xy defines a surface, and the
equation 100 = 2x + 2 y defines a curve (a line, in thi s case) in the x-y plane. If we graph
both of these in t he three-dimensional coordinate system, we can phrase the problem like
this: what is the highest point o n the surface above the line? The solution we already
understand effectively produces the equation of the cross-section of the surface above the
line and then treats it as a single variable problem. Instead, imagine that we draw the
level curves (the contour lines) for the surface in the x-y plane, along wi th the line.
30
40
y
0
3020 40 50
50
10
10
20
x
0
Figure 14.8.1 Constraint line with contour plot of the surface xy.
380 Chapter 14 Partial Differentiation
Imagine that the line represents a hiking trail and the contour lines are, as on a
topographic map, the lines of constant altitude. How could you estimate, based on the
graph, the hig h (or low) points on the path? As the path crosses contour lines, you know
the path must be increasing or decreasing in elevation. At some point you will see the path
just touch a contour line (tangent to it), and then begin to cross contours in the opposite
order—that po int of tangency must be a maximum or minimum point. If we can identify
all such points, we can then check them to see which g ives the maximum and which the
minimum value. As usual, we also need to check boundary points; in this problem, we
know that x and y are positive, so we are interested in just the portion of the line in the
first quadrant, as shown. The endpoints of the path, the two points on the axes, are not
points of tangency, but they are the two places that the functi on xy is a minimum in the
first quadrant.
How can we actually make use of this? At the points of t angency that we seek, the
constraint curve (in this case the line) and the level curve have the same slope—their
tangent lines are parallel. This also means that the constraint curve is perpendicular to
the gradient vector of the function; going a bit further, if we can express t he constraint
curve itself as a level curve, then we seek the points at which the two level curves have
parallel g r adients. The curve 100 = 2x + 2y can be thought of as a level curve of the
function 2x + 2y; figure 14.8.2 shows both sets of level curves on a single graph. We are
interested in those points where two level curves are tangent—but there are many such
points, in fact an infinite number, as we’ve only shown a few of the l evel curves. All along
the line y = x are points at which two level curves are ta ngent. While this might seem to
be a show-stopper, it is not.
50
50
30
0
10
20
0
20
y
30 40
40
10
x
Figure 14.8.2 Contour plots for 2x + 2y and xy.
14.8 Lagrange Multipliers 381
The gradient of 2x + 2y is h2, 2i, and the gradient of xy is hy, xi . T hey are parallel
when h2, 2i = λhy, xi, that is, when 2 = λy and 2 = λx. We have two equations in three
unknowns, which typically results in many solutions (as we expected). A third equation will
reduce the number of solutions; the third equation is the original constraint, 100 = 2x+2y.
So we have the following syst em to solve:
2 = λy 2 = λx 100 = 2x + 2y.
In the first two equations, λ can’t be 0, so we may divide by it to get x = y = 2.
Substituting into the third equati on we get
2
2
λ
+ 2
2
λ
= 100
8
100
= λ
so x = y = 25. Note t hat we are not really interested in the value of λ—it i s a clever
tool, the Lagrange multiplier, introduced to solve the problem. In many cases, as here, it
is easier t o find λ than to find everything else without using λ.
The same method works for functions of three variables, except of course everything
is one dimension higher: the function to be optimized is a function of three variables and
the constraint represents a surface—for example, the function may represent temperature,
and we may be interested i n the maximum temperature on some surface, like a sphere.
The points we seek are those at which the constraint surface is tangent to a l evel surface of
the function. Once again, we consider the constraint surface to be a level surface of some
function, and we loo k for points at which the two gradients are parall el , giving us t hree
equations in four unknowns. The constraint provides a fourth equatio n.
EXAMPLE 14.8.1 Recall example 14.7.8: the diagonal of a box is 1, we seek to
maximize the volume. The constraint is 1 =
p
x
2
+ y
2
+ z
2
, which is the same as 1 =
x
2
+ y
2
+ z
2
. The function to maximize is xyz. The two gradient vectors are h2x, 2y, 2zi
and hyz, xz, xyi, so the equations to be solved are
yz = 2
xz = 2yλ
xy = 2zλ
1 = x
2
+ y
2
+ z
2
If λ = 0 then at least two of x, y, z must be 0, giving a volume of 0, which will not be the
maximum. If we multiply the first two equations by x and y respectively, we get
xyz = 2x
2
λ
xyz = 2y
2
λ
382 Chapter 14 Partial Differentiation
so 2x
2
λ = 2y
2
λ or x
2
= y
2
; in the same way we can show x
2
= z
2
. H ence the fourth
equation becomes 1 = x
2
+ x
2
+ x
2
or x = 1/
3, and so x = y = z = 1/
3 gives the
maximum volume. This is of course the same answer we obtained previously.
Another possibility is that we have a function of three variables, and we want to
find a max imum or mi ni mum value not on a surface but on a curve; often the curve
is the intersection of two surfaces, so that we really have two constraint equations, say
g(x, y, z) = c
1
and h(x, y, z) = c
2
. It turns out t hat at points on the intersection of the
surfaces where f has a maximum or mini mum value,
f = λg + µh.
As before, t hi s gives us three equations, one for each component of the vectors, but now
in five unknowns, x, y, z, λ, and µ. Si nce there are two constraint functions, we have a
total of five equati ons in five unknowns, and so can usually find the solutions we need.
EXAMPLE 14.8.2 The plane x + y z = 1 intersects the cylinder x
2
+ y
2
= 1 in an
ellipse. Find the points on t he ellipse closest to a nd farthest from the origin.
We want the ex treme val ues of f =
p
x
2
+ y
2
+ z
2
subject to the constraints g =
x
2
+ y
2
= 1 and h = x + y z = 1. To simplify the algebra, we may use instead
f = x
2
+ y
2
+ z
2
, since this has a maxi mum or mi ni mum va lue at exactly the points at
which
p
x
2
+ y
2
+ z
2
does. The gradients are
f = h2 x , 2y, 2zi g = h2x, 2y, 0i h = h1, 1, 1i ,
so the equations we need to solve are
2x = λ2x + µ
2y = λ2y + µ
2z = 0 µ
1 = x
2
+ y
2
1 = x + y z.
Subtracting the first two we get 2y 2x = λ(2y 2x), so either λ = 1 or x = y. If λ = 1
then µ = 0, so z = 0 and the last two equations are
1 = x
2
+ y
2
and 1 = x + y.
Solving these gives x = 1, y = 0, or x = 0, y = 1, so the po ints of interest are (1, 0, 0) and
(0, 1, 0), which are both distance 1 from the orig in. If x = y, the fourth equation i s 2x
2
= 1,
14.8 Lagrange Multipliers 383
giving x = y = ±1/
2, and from the fifth equation we get z = 1 ±
2. The distance
from the origin to (1/
2, 1/
2, 1 +
2) is
p
4 2
2 1.08 and the distance from the
origin t o (1/
2, 1/
2, 1
2) is
p
4 + 2
2 2.6. Thus, the points (1, 0, 0) and
(0, 1, 0) are closest to the origin and (1/
2, 1/
2, 1
2) is farthest from the origin.
This applet shows the cylinder, the pl ane, the four points of interest, and t he origi n.
Exercises 14.8.
1. A six-si ded rectangular box is to hold 1/2 cubi c meter; what shape should the box be to
minimize surface area?
2. The post office will accept packages whose combined lengt h and girth are at most 130 inches
(girth is the maximum distance around the package perpendicular to the length). What is
the largest volume that can be sent in a rectangular box?
3. The bottom of a rectangular box costs twice as much per unit area as the sides and top.
Find the shape for a given volume that will minimize cost.
4. Using Lagrange multipliers, find the shortest distance from the point (x
0
, y
0
, z
0
) to the plane
ax + by + cz = d.
5. Find all points on the surface xy z
2
+ 1 = 0 that are closest to the origin.
6. The m aterial for the bottom of an aquarium costs half as much as the high strength glass for
the four sides. Find the shape of the cheapest aquarium that holds a given volume V .
7. The plane x y + z = 2 intersects the cylinder x
2
+ y
2
= 4 in an ellipse. Find the points on
the ellipse closest to and farthest from the origin.
8. Find three positive numbers whose sum is 48 and whose product is as large as possible.
9. Find all points on the plane x + y + z = 5 in the first octant at which f (x, y, z) = xy
2
z
2
has
a maximum value.
10. Find the points on the surface x
2
yz = 5 that are closest t o the ori gin.
11. A manufacturer makes two models of an item, standard and deluxe. It costs $40 to manu-
facture the standard model and $60 for the deluxe. A market research firm estimates that if
the standard model is priced at x dollars and the deluxe at y dollars, then the manufacturer
will sell 500(y x) of the standard items and 45, 000 + 500( x 2y) of the deluxe each year.
How should the i tems be priced to maximize profit?
12. A length of sheet metal is to be made into a water trough by bending up two sides as shown
in figure 14.8.3. Find x and φ so that the trapezoi d–shaped cross section has maxi mum area,
when the width of the metal sheet is 2 meters (t hat is, 2x + y = 2).
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
....................................................................................................................................................................................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
x x
y
φφ
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Figure 14.8.3 Cross-section of a trough.
13. Find the maximum and minimum values of f(x, y, z) = 6x+ 3y + 2z subject to the constraint
g(x, y, z) = 4x
2
+ 2y
2
+ z
2
70 = 0.
384 Chapter 14 Partial Differentiation
14. Find the maximum and minimum values of f (x, y) = e
xy
subject to the constraint g(x, y) =
x
3
+ y
3
16 = 0.
15. Find the maximum and mini mum values of f (x, y) = xy +
p
9 x
2
y
2
when x
2
+ y
2
9.
16. Find three real numbers whose sum is 9 and the sum of whose sq uares is a small as possible.
17. Find the dimensions of the c losed rectangular box with maximum volume that can be in-
scribed in the unit sphere.
18. Find the isoceles triangle w ith perimeter 12 and maximum area.