Nothing Special   »   [go: up one dir, main page]

Openstax - Multivariable Functions & Partial Derivatives

Download as pdf or txt
Download as pdf or txt
You are on page 1of 144

Chapter 4 | Differentiation of Functions of Several Variables 333

4 | DIFFERENTIATION OF
FUNCTIONS OF SEVERAL
VARIABLES

Figure 4.1 Americans use (and lose) millions of golf balls a year, which keeps golf ball manufacturers in business. In this
chapter, we study a profit model and learn methods for calculating optimal production levels for a typical golf ball manufacturing
company. (credit: modification of work by oatsy40, Flickr)
334 Chapter 4 | Differentiation of Functions of Several Variables

Chapter Outline
4.1 Functions of Several Variables
4.2 Limits and Continuity
4.3 Partial Derivatives
4.4 Tangent Planes and Linear Approximations
4.5 The Chain Rule
4.6 Directional Derivatives and the Gradient
4.7 Maxima/Minima Problems
4.8 Lagrange Multipliers

Introduction
In Introduction to Applications of Derivatives (http://cnx.org/content/m53602/latest/) , we studied how to
determine the maximum and minimum of a function of one variable over a closed interval. This function might represent
the temperature over a given time interval, the position of a car as a function of time, or the altitude of a jet plane as it travels
from New York to San Francisco. In each of these examples, the function has one independent variable.
Suppose, however, that we have a quantity that depends on more than one variable. For example, temperature can depend
on location and the time of day, or a company’s profit model might depend on the number of units sold and the amount
of money spent on advertising. In this chapter, we look at a company that produces golf balls. We develop a profit model
and, under various restrictions, we find that the optimal level of production and advertising dollars spent determines the
maximum possible profit. Depending on the nature of the restrictions, both the method of solution and the solution itself
changes (see Example 4.41).
When dealing with a function of more than one independent variable, several questions naturally arise. For example, how
do we calculate limits of functions of more than one variable? The definition of derivative we used before involved a limit.
Does the new definition of derivative involve limits as well? Do the rules of differentiation apply in this context? Can we
find relative extrema of functions using derivatives? All these questions are answered in this chapter.

4.1 | Functions of Several Variables


Learning Objectives
4.1.1 Recognize a function of two variables and identify its domain and range.
4.1.2 Sketch a graph of a function of two variables.
4.1.3 Sketch several traces or level curves of a function of two variables.
4.1.4 Recognize a function of three or more variables and identify its level surfaces.

Our first step is to explain what a function of more than one variable is, starting with functions of two independent variables.
This step includes identifying the domain and range of such functions and learning how to graph them. We also examine
ways to relate the graphs of functions in three dimensions to graphs of more familiar planar functions.

Functions of Two Variables


The definition of a function of two variables is very similar to the definition for a function of one variable. The main
difference is that, instead of mapping values of one variable to values of another variable, we map ordered pairs of variables
to another variable.

Definition
A function of two variables z = f ⎛⎝x, y⎞⎠ maps each ordered pair (x, y) in a subset D of the real plane ℝ 2 to a
unique real number z. The set D is called the domain of the function. The range of f is the set of all real numbers

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 335

z that has at least one ordered pair (x, y) ∈ D such that f (x, y) = z as shown in the following figure.

Figure 4.2 The domain of a function of two variables consists


of ordered pairs (x, y).

Determining the domain of a function of two variables involves taking into account any domain restrictions that may exist.
Let’s take a look.

Example 4.1

Domains and Ranges for Functions of Two Variables

Find the domain and range of each of the following functions:


a. f (x, y) = 3x + 5y + 2

b. g(x, y) = 9 − x 2 − y 2

Solution
a. This is an example of a linear function in two variables. There are no values or combinations of x and
y that cause f (x, y) to be undefined, so the domain of f is ℝ 2. To determine the range, first pick
a value for z. We need to find a solution to the equation f (x, y) = z, or 3x − 5y + 2 = z. One such
solution can be obtained by first setting y = 0, which yields the equation 3x + 2 = z. The solution
⎛ ⎞
to this equation is x = z − 2 , which gives the ordered pair ⎝z − 2 , 0⎠ as a solution to the equation
3 3
f (x, y) = z for any value of z. Therefore, the range of the function is all real numbers, or ℝ.

b. For the function g(x, y) to have a real value, the quantity under the square root must be nonnegative:

9 − x 2 − y 2 ≥ 0.

This inequality can be written in the form


x 2 + y 2 ≤ 9.

|
⎧ ⎫
Therefore, the domain of g(x, y) is ⎨⎩(x, y) ∈ ℝ 2 x 2 + y 2 ≤ 9⎬⎭. The graph of this set of points can be
described as a disk of radius 3 centered at the origin. The domain includes the boundary circle as shown
in the following graph.
336 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.3 The domain of the function


g(x, y) = 9 − x 2 − y 2 is a closed disk of radius 3.

To determine the range of g(x, y) = 9 − x 2 − y 2 we start with a point (x 0, y 0) on the boundary of the
domain, which is defined by the relation x 2 + y 2 = 9. It follows that x 02 + y 20 = 9 and

g(x 0, y 0) = 9 − x 02 − y 20 = 9 − ⎛⎝x 02 + y 20⎞⎠ = 9 − 9 = 0.

If x 02 + y 20 = 0 (in other words, x 0 = y 0 = 0), then

g(x 0, y 0) = 9 − x 02 − y 20 = 9 − ⎛⎝x 02 + y 20⎞⎠ = 9 − 0 = 3.

This is the maximum value of the function. Given any value c between 0 and 3, we can find an entire
set of points inside the domain of g such that g(x, y) = c:

9 − x2 − y2 = c
9 − x2 − y2 = c2
x 2 + y 2 = 9 − c 2.

Since 9 − c 2 > 0, this describes a circle of radius 9 − c 2 centered at the origin. Any point on this
circle satisfies the equation g(x, y) = c. Therefore, the range of this function can be written in interval
notation as [0, 3].

4.1 Find the domain and range of the function f (x, y) = 36 − 9x 2 − 9y 2.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 337

Graphing Functions of Two Variables


Suppose we wish to graph the function z = (x, y). This function has two independent variables ⎛⎝x and y⎞⎠ and one
dependent variable (z). When graphing a function y = f (x) of one variable, we use the Cartesian plane. We are able to
graph any ordered pair (x, y) in the plane, and every point in the plane has an ordered pair (x, y) associated with it. With a
function of two variables, each ordered pair (x, y) in the domain of the function is mapped to a real number z. Therefore,
the graph of the function f consists of ordered triples (x, y, z). The graph of a function z = (x, y) of two variables is
called a surface.
To understand more completely the concept of plotting a set of ordered triples to obtain a surface in three-dimensional
space, imagine the (x, y) coordinate system laying flat. Then, every point in the domain of the function f has a unique
z-value associated with it. If z is positive, then the graphed point is located above the xy-plane, if z is negative, then the
graphed point is located below the xy-plane. The set of all the graphed points becomes the two-dimensional surface that is
the graph of the function f .

Example 4.2

Graphing Functions of Two Variables

Create a graph of each of the following functions:

a. g(x, y) = 9 − x 2 − y 2

b. f (x, y) = x 2 + y 2

Solution
a. In Example 4.1, we determined that the domain of g(x, y) = 9 − x 2 − y 2 is

| |
⎧ 2 2 2 ⎫ ⎧ 2 ⎫ 2 2


(x, y) ∈ ℝ x + y ≤ 9 ⎬

and the range is z ∈ ℝ 0 ≤ z ≤ 3 . When x + y = 9 we have



g(x, y) = 0. Therefore any point on the circle of radius 3 centered at the origin in the x, y-plane maps
to z = 0 in ℝ 3. If x 2 + y 2 = 8, then g(x, y) = 1, so any point on the circle of radius 2 2 centered
at the origin in the x, y-plane maps to z = 1 in ℝ 3. As x 2 + y 2 gets closer to zero, the value of z
approaches 3. When x 2 + y 2 = 0, then g(x, y) = 3. This is the origin in the x, y-plane. If x 2 + y 2 is
equal to any other value between 0 and 9, then g(x, y) equals some other constant between 0 and 3.
The surface described by this function is a hemisphere centered at the origin with radius 3 as shown in
the following graph.
338 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.4 Graph of the hemisphere represented by the given function of


two variables.

b. This function also contains the expression x 2 + y 2. Setting this expression equal to various values
starting at zero, we obtain circles of increasing radius. The minimum value of f (x, y) = x 2 + y 2 is
zero (attained when x = y = 0.). When x = 0, the function becomes z = y 2, and when y = 0,
then the function becomes z = x 2. These are cross-sections of the graph, and are parabolas. Recall from
Introduction to Vectors in Space that the name of the graph of f (x, y) = x 2 + y 2 is a paraboloid.
The graph of f appears in the following graph.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 339

Figure 4.5 A paraboloid is the graph of the given function of two


variables.

Example 4.3

Nuts and Bolts

A profit function for a hardware manufacturer is given by


f (x, y) = 16 − (x − 3) 2 − ⎛⎝y − 2⎞⎠ 2,

where x is the number of nuts sold per month (measured in thousands) and y represents the number of bolts sold
per month (measured in thousands). Profit is measured in thousands of dollars. Sketch a graph of this function.

Solution
This function is a polynomial function in two variables. The domain of f consists of (x, y) coordinate pairs that
yield a nonnegative profit:
16 − (x − 3) 2 − ⎛⎝y − 2⎞⎠ 2 ≥ 0
(x − 3) 2 + ⎛⎝y − 2⎞⎠ 2 ≤ 16.

This is a disk of radius 4 centered at (3, 2). A further restriction is that both x and y must be nonnegative.
When x = 3 and y = 2, f (x, y) = 16. Note that it is possible for either value to be a noninteger; for example,
it is possible to sell 2.5 thousand nuts in a month. The domain, therefore, contains thousands of points, so we
340 Chapter 4 | Differentiation of Functions of Several Variables

can consider all points within the disk. For any z < 16, we can solve the equation f (x, y) = 16:

16 − (x − 3) 2 − ⎛⎝y − 2⎞⎠ 2 = z
(x − 3) 2 + ⎛⎝y − 2⎞⎠ 2 = 16 − z.

Since z < 16, we know that 16 − z > 0, so the previous equation describes a circle with radius 16 − z
centered at the point (3, 2). Therefore. the range of f (x, y) is {z ∈ ℝ|z ≤ 16}. The graph of f (x, y) is also a
paraboloid, and this paraboloid points downward as shown.

Figure 4.6 The graph of the given function of two variables is


also a paraboloid.

Level Curves
If hikers walk along rugged trails, they might use a topographical map that shows how steeply the trails change. A
topographical map contains curved lines called contour lines. Each contour line corresponds to the points on the map that
have equal elevation (Figure 4.7). A level curve of a function of two variables f (x, y) is completely analogous to a
contour line on a topographical map.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 341

Figure 4.7 (a) A topographical map of Devil’s Tower, Wyoming. Lines that are close together indicate very steep terrain. (b) A
perspective photo of Devil’s Tower shows just how steep its sides are. Notice the top of the tower has the same shape as the
center of the topographical map.

Definition
Given a function f (x, y) and a number c in the range of f , a level curve of a function of two variables for the
value c is defined to be the set of points satisfying the equation f (x, y) = c.

Returning to the function g(x, y) = 9 − x 2 − y 2, we can determine the level curves of this function. The range of g is
the closed interval [0, 3]. First, we choose any number in this closed interval—say, c = 2. The level curve corresponding
to c = 2 is described by the equation

9 − x 2 − y 2 = 2.

To simplify, square both sides of this equation:


9 − x 2 − y 2 = 4.

Now, multiply both sides of the equation by −1 and add 9 to each side:

x 2 + y 2 = 5.

This equation describes a circle centered at the origin with radius 5. Using values of c between 0 and 3 yields other
circles also centered at the origin. If c = 3, then the circle has radius 0, so it consists solely of the origin. Figure 4.8
is a graph of the level curves of this function corresponding to c = 0, 1, 2, and 3. Note that in the previous derivation it
may be possible that we introduced extra solutions by squaring both sides. This is not the case here because the range of the
square root function is nonnegative.
342 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.8 Level curves of the function


g(x, y) = 9 − x 2 − y 2, using c = 0, 1, 2, and 3 (c = 3
corresponds to the origin).

A graph of the various level curves of a function is called a contour map.

Example 4.4

Making a Contour Map

Given the function f (x, y) = 8 + 8x − 4y − 4x 2 − y 2, find the level curve corresponding to c = 0. Then
create a contour map for this function. What are the domain and range of f ?

Solution
To find the level curve for c = 0, we set f (x, y) = 0 and solve. This gives

0 = 8 + 8x − 4y − 4x 2 − y 2.

We then square both sides and multiply both sides of the equation by −1:

4x 2 + y 2 − 8x + 4y − 8 = 0.

Now, we rearrange the terms, putting the x terms together and the y terms together, and add 8 to each side:

4x 2 − 8x + y 2 + 4y = 8.

Next, we group the pairs of terms containing the same variable in parentheses, and factor 4 from the first pair:

4⎛⎝x 2 − 2x⎞⎠ + ⎛⎝y 2 + 4y⎞⎠ = 8.

Then we complete the square in each pair of parentheses and add the correct value to the right-hand side:
4⎛⎝x 2 − 2x + 1⎞⎠ + ⎛⎝y 2 + 4y + 4⎞⎠ = 8 + 4(1) + 4.

Next, we factor the left-hand side and simplify the right-hand side:
4(x − 1) 2 + ⎛⎝y + 2⎞⎠ 2 = 16.

Last, we divide both sides by 16:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 343

(x − 1) 2 ⎛⎝y + 2⎞⎠ 2 (4.1)


+ = 1.
4 16
This equation describes an ellipse centered at (1, −2). The graph of this ellipse appears in the following graph.

Figure 4.9 Level curve of the function


f (x, y) = 8 + 8x − 4y − 4x 2 − y 2 corresponding to
c = 0.

We can repeat the same derivation for values of c less than 4. Then, Equation 4.1 becomes

4(x − 1) 2 ⎛⎝y + 2⎞⎠ 2


+ =1
16 − c 2 16 − c 2
for an arbitrary value of c. Figure 4.10 shows a contour map for f (x, y) using the values c = 0, 1, 2, and 3.
When c = 4, the level curve is the point (−1, 2).
344 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.10 Contour map for the function


f (x, y) = 8 + 8x − 4y − 4x 2 − y 2 using the values
c = 0, 1, 2, 3, and 4.

4.2 Find and graph the level curve of the function g(x, y) = x 2 + y 2 − 6x + 2y corresponding to c = 15.

Another useful tool for understanding the graph of a function of two variables is called a vertical trace. Level curves are
always graphed in the xy-plane, but as their name implies, vertical traces are graphed in the xz - or yz-planes.

Definition
Consider a function z = f (x, y) with domain D ⊆ ℝ 2. A vertical trace of the function can be either the set of points
that solves the equation f (a, y) = z for a given constant x = a or f (x, b) = z for a given constant y = b.

Example 4.5

Finding Vertical Traces

Find vertical traces for the function f (x, y) = sin x cos y corresponding to x = − π , 0, and π , and
4 4
y = − π , 0, and π .
4 4

Solution
First set x = − π in the equation z = sin x cos y:
4

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 345

⎛ ⎞ 2 cos y
z = sin⎝− π ⎠cos y = − ≈ −0.7071 cos y.
4 2
This describes a cosine graph in the plane x = − π . The other values of z appear in the following table.
4

c Vertical Trace for x = c

−π 2 cos y
4 z= −
2

0 z=0

π 2 cos y
4 z=
2

Table 4.1
Vertical Traces Parallel to the xz-Plane
for the Function f (x, y) = sin x cos y

In a similar fashion, we can substitute the y-values in the equation f (x, y) to obtain the traces in the yz-plane,
as listed in the following table.

d Vertical Trace for y = d

−π z = − 2 sin x
4 2

0 z = sin x

π
4 z = 2 sin x
2

Table 4.2
Vertical Traces Parallel to the yz-Plane
for the Function f (x, y) = sin x cos y

The three traces in the xz-plane are cosine functions; the three traces in the yz-plane are sine functions.
These curves appear in the intersections of the surface with the planes x = − π , x = 0, x = π and
4 4
y = − π , y = 0, y = π as shown in the following figure.
4 4
346 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.11 Vertical traces of the function f (x, y) are cosine curves in the xz-planes (a) and sine curves in the
yz-planes (b).

4.3 Determine the equation of the vertical trace of the function g(x, y) = −x 2 − y 2 + 2x + 4y − 1
corresponding to y = 3, and describe its graph.

Functions of two variables can produce some striking-looking surfaces. The following figure shows two examples.

Figure 4.12 Examples of surfaces representing functions of two variables: (a) a combination of a power function and a sine
function and (b) a combination of trigonometric, exponential, and logarithmic functions.

Functions of More Than Two Variables


So far, we have examined only functions of two variables. However, it is useful to take a brief look at functions of more
than two variables. Two such examples are

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 347

f (x, y, z) = x 2 − 2xy + y 2 + 3yz − z 2 + 4x − 2y + 3x − 6 (a polynomial in three variables)

and
g(x, y, t) = ⎛⎝x 2 − 4xy + y 2⎞⎠sin t − ⎛⎝3x + 5y⎞⎠cos t.

In the first function, (x, y, z) represents a point in space, and the function f maps each point in space to a fourth quantity,
such as temperature or wind speed. In the second function, (x, y) can represent a point in the plane, and t can represent
time. The function might map a point in the plane to a third quantity (for example, pressure) at a given time t. The method
for finding the domain of a function of more than two variables is analogous to the method for functions of one or two
variables.

Example 4.6

Domains for Functions of Three Variables

Find the domain of each of the following functions:


3x − 4y + 2z
a. f (x, y, z) =
9 − x2 − y2 − z2

b. g(x, y, t) = 2t −4
x2 − y2

Solution
3x − 4y + 2z
a. For the function f (x, y, z) = to be defined (and be a real value), two conditions must
9 − x2 − y2 − z2
hold:
1. The denominator cannot be zero.
2. The radicand cannot be negative.
Combining these conditions leads to the inequality
9 − x 2 − y 2 − z 2 > 0.

Moving the variables to the other side and reversing the inequality gives the domain as

|
⎧ ⎫
domain⎛⎝ f ⎞⎠ = ⎨⎩(x, y, z) ∈ ℝ 3 x 2 + y 2 + z 2 < 9⎬⎭,

which describes a ball of radius 3 centered at the origin. (Note: The surface of the ball is not included in
this domain.)

b. For the function g(x, y, t) = 2t


2
− 4 to be defined (and be a real value), two conditions must hold:
2
x −y

1. The radicand cannot be negative.


2. The denominator cannot be zero.
Since the radicand cannot be negative, this implies 2t − 4 ≥ 0, and therefore that t ≥ 2. Since the
denominator cannot be zero, x 2 − y 2 ≠ 0, or x 2 ≠ y 2, Which can be rewritten as y = ±x, which
are the equations of two lines passing through the origin. Therefore, the domain of g is

domain(g) = (x, y, t)|y ≠ ±x, t ≥ 2 .


⎧ ⎫
⎨ ⎬
⎩ ⎭
348 Chapter 4 | Differentiation of Functions of Several Variables

4.4 Find the domain of the function h(x, y, t) = (3t − 6) y − 4x 2 + 4.

Functions of two variables have level curves, which are shown as curves in the xy-plane. However, when the function has
three variables, the curves become surfaces, so we can define level surfaces for functions of three variables.

Definition
Given a function f (x, y, z) and a number c in the range of f , a level surface of a function of three variables is
defined to be the set of points satisfying the equation f (x, y, z) = c.

Example 4.7

Finding a Level Surface

Find the level surface for the function f (x, y, z) = 4x 2 + 9y 2 − z 2 corresponding to c = 1.

Solution
The level surface is defined by the equation 4x 2 + 9y 2 − z 2 = 1. This equation describes a hyperboloid of one
sheet as shown in the following figure.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 349

Figure 4.13 A hyperboloid of one sheet with some of its level surfaces.

4.5 Find the equation of the level surface of the function


g(x, y, z) = x 2 + y 2 + z 2 − 2x + 4y − 6z

corresponding to c = 2, and describe the surface, if possible.


350 Chapter 4 | Differentiation of Functions of Several Variables

4.1 EXERCISES
For the following exercises, evaluate each function at the 15. z(x, y) = y 2 − x 2, c=4
indicated values.
16. g(x, y) = x 2 + y 2; c = 4, c = 9
1. W(x, y) = 4x 2 + y 2. Find W(2, −1), W(−3, 6).

17. g(x, y) = 4 − x − y; c = 0, 4
2. W(x, y) = 4x 2 + y 2. Find W(2 + h, 3 + h).
18. f (x, y) = xy; c = 1; c = −1
3. The volume of a right circular cylinder is calculated by
a function of two variables, V(x, y) = πx 2 y, where x is 19. h(x, y) = 2x − y; c = 0, −2, 2
the radius of the right circular cylinder and y represents the
height of the cylinder. Evaluate V(2, 5) and explain what 20. f (x, y) = x 2 − y; c = 1, 2
this means.
x ; c = −1, 0, 2
21. g(x, y) = x + y
4. An oxygen tank is constructed of a right cylinder of
height y and radius x with two hemispheres of radius x
mounted on the top and bottom of the cylinder. Express 22. g(x, y) = x 3 − y; c = −1, 0, 2
the volume of the cylinder as a function of two variables,
xy
x and y, find V(10, 2), and explain what this means. 23. g(x, y) = e ; c = 1 , 3
2
For the following exercises, find the domain of the
function. 24. f (x, y) = x 2; c = 4, 9

5. V(x, y) = 4x 2 + y 2 25. f (x, y) = xy − x; c = −2, 0, 2

6. f (x, y) = x 2 + y 2 − 4 26. h(x, y) = ln(x 2 + y 2); c = −1, 0, 1

⎛y⎞
7. f (x, y) = 4 ln(y 2 − x) 27. g(x, y) = ln
⎝x 2 ⎠; c = −2, 0, 2

8. g(x, y) = 16 − 4x 2 − y 2
28. z = f (x, y) = x 2 + y 2, c=3

9. z(x, y) = y 2 − x 2 y+2
29. f (x, y) = , c = any constant
x2
y+2
10. f (x, y) =
x2 For the following exercises, find the vertical traces of the
functions at the indicated values of x and y, and plot the
Find the range of the functions. traces.

11. g(x, y) = 16 − 4x 2 − y 2 30. z = 4 − x − y; x = 2

12. V(x, y) = 4x 2 + y 2 31. f (x, y) = 3x + y 3, x = 1

13. z = y 2 − x 2 32. z = cos x 2 + y 2 x = 1

For the following exercises, find the level curves of each Find the domain of the following functions.
function at the indicated value of c to visualize the given
function. 33. z = 100 − 4x 2 − 25y 2

14. z(x, y) = y 2 − x 2, c=1


34. z = ln⎛⎝x − y 2⎞⎠

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 351

35. f (x, y, z) = 1 54. g(x, y) = y 2 arctan x, P(1, 2)


36 − 4x − 9y 2 − z 2
2
xy
55. g(x, y) = e (x 2 + y 2), P(1, 0)
36. f (x, y, z) = 49 − x 2 − y 2 − z 2
56. The strength E of an electric field at point (x, y, z)
3
37. f (x, y, z) = 16 − x 2 − y 2 − z 2 resulting from an infinitely long charged wire lying along
the y-axis is given by E(x, y, z) = k/ x 2 + y 2, where k
38. f (x, y) = cos x 2 + y 2 is a positive constant. For simplicity, let k = 1 and find the
equations of the level surfaces for E = 10 and E = 100.
For the following exercises, plot a graph of the function.
57. A thin plate made of iron is located in the xy-plane.
2 2
39. z = f (x, y) = x + y The temperature T in degrees Celsius at a point P(x, y) is
inversely proportional to the square of its distance from the
40. z = x 2 + y 2 origin. Express T as a function of x and y.

41. Use technology to graph z = x 2 y. 58. Refer to the preceding problem. Using the temperature
function found there, determine the proportionality
constant if the temperature at point P(1, 2) is 50°C. Use
Sketch the following by finding the level curves. Verify the
graph using technology. this constant to determine the temperature at point
Q(3, 4).
2 2
42. f (x, y) = 4 − x − y
59. Refer to the preceding problem. Find the level curves
for T = 40°C and T = 100°C, and describe what the
43. f (x, y) = 2 − x 2 + y 2
level curves represent.

−x 2 − y 2
44. z = 1 + e

45. z = cos x 2 + y 2

46. z = y 2 − x 2

47. Describe the contour lines for several values of c for


z = x 2 + y 2 − 2x − 2y.

Find the level surface for the functions of three variables


and describe it.

48. w(x, y, z) = x − 2y + z, c = 4

49. w(x, y, z) = x 2 + y 2 + z 2, c = 9

50. w(x, y, z) = x 2 + y 2 − z 2, c = −4

51. w(x, y, z) = x 2 + y 2 − z 2, c = 4

52. w(x, y, z) = 9x 2 − 4y 2 + 36z 2, c = 0

For the following exercises, find an equation of the level


curve of f that contains the point P.

53. f (x, y) = 1 − 4x 2 − y 2, P(0, 1)


352 Chapter 4 | Differentiation of Functions of Several Variables

4.2 | Limits and Continuity


Learning Objectives
4.2.1 Calculate the limit of a function of two variables.
4.2.2 Learn how a function of two variables can approach different values at a boundary point,
depending on the path of approach.
4.2.3 State the conditions for continuity of a function of two variables.
4.2.4 Verify the continuity of a function of two variables at a point.
4.2.5 Calculate the limit of a function of three or more variables and verify the continuity of the
function at a point.

We have now examined functions of more than one variable and seen how to graph them. In this section, we see how to take
the limit of a function of more than one variable, and what it means for a function of more than one variable to be continuous
at a point in its domain. It turns out these concepts have aspects that just don’t occur with functions of one variable.

Limit of a Function of Two Variables


Recall from Section 2.2 the definition of a limit of a function of one variable:
Let f (x) be defined for all x ≠ a in an open interval containing a. Let L be a real number. Then

x→a
lim f (x) = L

if for every ε > 0, there exists a δ > 0, such that if 0 < |x − a| < δ for all x in the domain of f , then

| f (x) − L| > ε.
Before we can adapt this definition to define a limit of a function of two variables, we first need to see how to extend the
idea of an open interval in one variable to an open interval in two variables.

Definition
Consider a point (a, b) ∈ ℝ 2. A δ disk centered at point (a, b) is defined to be an open disk of radius δ centered
at point (a, b) —that is,

|
⎧ ⎫


(x, y) ∈ ℝ 2 (x − a) 2 + (y − b) 2 < δ 2⎬⎭

as shown in the following graph.

Figure 4.14 A δ disk centered around the point (2, 1).

The idea of a δ disk appears in the definition of the limit of a function of two variables. If δ is small, then all the points
(x, y) in the δ disk are close to (a, b). This is completely analogous to x being close to a in the definition of a limit of
a function of one variable. In one dimension, we express this restriction as
a − δ < x < a + δ.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 353

In more than one dimension, we use a δ disk.

Definition
Let f be a function of two variables, x and y. The limit of f (x, y) as (x, y) approaches (a, b) is L, written

lim f (x, y) = L
(x, y) → (a, b)

if for each ε > 0 there exists a small enough δ > 0 such that for all points (x, y) in a δ disk around (a, b), except
possibly for (a, b) itself, the value of f (x, y) is no more than ε away from L (Figure 4.15). Using symbols, we
write the following: For any ε > 0, there exists a number δ > 0 such that

| f (x, y) − L| < ε whenever 0 < (x − a) 2 + ⎛⎝y − b⎞⎠ 2 < δ.

Figure 4.15 The limit of a function involving two variables requires that f (x, y)
be within ε of L whenever (x, y) is within δ of (a, b). The smaller the value of
ε, the smaller the value of δ.

Proving that a limit exists using the definition of a limit of a function of two variables can be challenging. Instead, we use
the following theorem, which gives us shortcuts to finding limits. The formulas in this theorem are an extension of the
formulas in the limit laws theorem in The Limit Laws (http://cnx.org/content/m53492/latest/) .

Theorem 4.1: Limit laws for functions of two variables


Let f (x, y) and g(x, y) be defined for all (x, y) ≠ (a, b) in a neighborhood around (a, b), and assume the
neighborhood is contained completely inside the domain of f . Assume that L and M are real numbers such
that lim f (x, y) = L and lim g(x, y) = M, and let c be a constant. Then each of the following
(x, y) → (a, b) (x, y) → (a, b)
354 Chapter 4 | Differentiation of Functions of Several Variables

statements holds:
Constant Law:
lim c=c (4.2)
(x, y) → (a, b)

Identity Laws:
lim x=a (4.3)
(x, y) → (a, b)
lim y=b (4.4)
(x, y) → (a, b)

Sum Law:

lim ⎝ f (x, y) + g(x, y)⎞⎠ = L + M (4.5)
(x, y) → (a, b)

Difference Law:

lim ⎝ f (x, y) − g(x, y)⎞⎠ = L − M (4.6)
(x, y) → (a, b)

Constant Multiple Law:



lim c f (x, y)⎞⎠ = cL
⎝ (4.7)
(x, y) → (a, b)

Product Law:

lim ⎝ f (x, y)g(x, y)⎞⎠ = LM (4.8)
(x, y) → (a, b)

Quotient Law:
f (x, y) (4.9)
lim = L for M ≠ 0
(x, y) → (a, b) g(x, y) M

Power Law:
lim ⎛
⎝ f (x, y)⎞⎠ n = L n (4.10)
(x, y) → (a, b)

for any positive integer n.


Root Law:
n n (4.11)
lim f (x, y) = L
(x, y) → (a, b)

for all L if n is odd and positive, and for L ≥ 0 if n is even and positive.

The proofs of these properties are similar to those for the limits of functions of one variable. We can apply these laws to
finding limits of various functions.

Example 4.8

Finding the Limit of a Function of Two Variables

Find each of the following limits:


⎛ 2
a. lim ⎝x − 2xy + 3y 2 − 4x + 3y − 6⎞⎠
(x, y) → (2, −1)

2x + 3y
b. lim
(x, y) → (2, −1) 4x − 3y

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 355

Solution
a. First use the sum and difference laws to separate the terms:
⎛ 2
lim ⎝x − 2xy + 3y 2 − 4x + 3y − 6⎞⎠
⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
(x, y) → (2, −1)
=⎝ lim x 2⎠ − ⎝ lim 2xy⎠ + ⎝ lim 3y 2⎠ − ⎝ lim 4x⎠
(x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1)
⎛ ⎞ ⎛ ⎞
+⎝ lim 3y⎠ − ⎝ lim 6⎠.
(x, y) → (2, −1) (x, y) → (2, −1)

Next, use the constant multiple law on the second, third, fourth, and fifth limits:
⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
=⎝ lim x 2⎠ − 2⎝ lim xy⎠ + 3⎝ lim y 2⎠ − 4⎝ lim x⎠
(x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1)
⎛ ⎞
+3⎝ lim y⎠ − lim 6.
(x, y) → (2, −1) (x, y) → (2, −1)

Now, use the power law on the first and third limits, and the product law on the second limit:

⎛ ⎞ ⎛ ⎞⎛ ⎞ ⎛ ⎞
2 2
=⎝
(x, y) → (2, −1) ⎠
x − 2⎝
(x, y) → (2, −1) ⎠⎝(x, y) → (2, −1) ⎠
y + 3⎝
(x, y) → (2, −1) ⎠
lim lim x lim lim y

⎛ ⎞ ⎛ ⎞
−4⎝ lim x⎠ + 3⎝ lim y⎠ − lim 6.
(x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1)

Last, use the identity laws on the first six limits and the constant law on the last limit:
⎛ 2
lim ⎝x − 2xy + 3y 2 − 4x + 3y − 6⎞⎠ = (2) 2 − 2(2)(−1) + 3(−1) 2 − 4(2) + 3(−1) − 6
(x, y) → (2, −1)

= −6.
b. Before applying the quotient law, we need to verify that the limit of the denominator is nonzero. Using
the difference law, constant multiple law, and identity law,

lim ⎝ 4x − 3y⎞⎠ = lim 4x − lim 3y
(x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1)
⎛ ⎞ ⎛ ⎞
= 4⎝ lim x⎠ − 3⎝ lim y⎠
(x, y) → (2, −1) (x, y) → (2, −1)
= 4(2) − 3(−1) = 11.

Since the limit of the denominator is nonzero, the quotient law applies. We now calculate the limit of the
numerator using the difference law, constant multiple law, and identity law:

lim ⎝ 2x + 3y⎞⎠ = lim 2x + lim 3y
(x, y) → (2, −1) (x, y) → (2, −1) (x, y) → (2, −1)
⎛ ⎞ ⎛ ⎞
= 2⎝ lim x⎠ + 3⎝ lim y⎠
(x, y) → (2, −1) (x, y) → (2, −1)
= 2(2) + 3(−1)
= 1.

Therefore, according to the quotient law we have


356 Chapter 4 | Differentiation of Functions of Several Variables


lim ⎝2x + 3y⎞⎠
2x + 3y
= 1.
(x, y) → (2, −1)
lim = ⎛
(x, y) → (2, −1) 4x − 3y lim ⎝4x − 3y⎞⎠ 11
(x, y) → (2, −1)

4.6 Evaluate the following limit:


3
x2 − y
lim 2
.
(x, y) → (5, −2) y +x−1

Since we are taking the limit of a function of two variables, the point (a, b) is in ℝ 2, and it is possible to approach this
point from an infinite number of directions. Sometimes when calculating a limit, the answer varies depending on the path
taken toward (a, b). If this is the case, then the limit fails to exist. In other words, the limit must be unique, regardless of
path taken.

Example 4.9

Limits That Fail to Exist

Show that neither of the following limits exist:


2xy
a. lim
(x, y) → (0, 0) 3x 2 + y 2

4xy 2
b. lim
(x, y) → (0, 0) x 2 + 3y 4

Solution
2xy
a. The domain of the function f (x, y) = consists of all points in the xy-plane except for the
3x 2 + y 2
point (0, 0) (Figure 4.16). To show that the limit does not exist as (x, y) approaches (0, 0), we note
that it is impossible to satisfy the definition of a limit of a function of two variables because of the fact
that the function takes different values along different lines passing through point (0, 0). First, consider
the line y = 0 in the xy-plane. Substituting y = 0 into f (x, y) gives

2x(0)
f (x, 0) = =0
3x 2 + 0 2

for any value of x. Therefore the value of f remains constant for any point on the x-axis, and as y
approaches zero, the function remains fixed at zero.
Next, consider the line y = x. Substituting y = x into f (x, y) gives

2x(x) 2
f (x, x) = = 2x 2 = 1 .
2
3x + x 2
4x 2

This is true for any point on the line y = x. If we let x approach zero while staying on this line, the

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 357

value of the function remains fixed at 1 , regardless of how small x is.


2
Choose a value for ε that is less than 1/2 —say, 1/4. Then, no matter how small a δ disk we
draw around (0, 0), the values of f (x, y) for points inside that δ disk will include both 0 and 1 .
2
Therefore, the definition of limit at a point is never satisfied and the limit fails to exist.

Figure 4.16 Graph of the function


f (x, y) = ⎛⎝2xy⎞⎠/⎛⎝3x 2 + y 2⎞⎠. Along the line y = 0, the
function is equal to zero; along the line y = x, the function is

equal to 1 .
2

In a similar fashion to a., we can approach the origin along any straight line passing through the origin. If
we try the x-axis (i.e., y = 0), then the function remains fixed at zero. The same is true for the y-axis.
Suppose we approach the origin along a straight line of slope k. The equation of this line is y = kx.
Then the limit becomes
4xy 2 4x(kx) 2
lim = lim
(x, y) → (0, 0) x 2 + 3y 4 (x, y) → (0, 0) x 2 + 3(kx) 4

= lim 4k 2 x 3
(x, y) → (0, 0) x 2 + 3k 4 x 4

= lim 4k 2 x
(x, y) → (0, 0) 1 + 3k 4 x 2
⎛ 2 ⎞
lim ⎝4k x⎠
(x, y) → (0, 0)
= ⎛
lim ⎝1 + 3k 4 x 2⎞⎠
(x, y) → (0, 0)
=0

regardless of the value of k. It would seem that the limit is equal to zero. What if we chose a curve
passing through the origin instead? For example, we can consider the parabola given by the equation
x = y 2. Substituting y 2 in place of x in f (x, y) gives
358 Chapter 4 | Differentiation of Functions of Several Variables

4xy 2 4⎛⎝y 2⎞⎠y 2


lim = lim
(x, y) → (0, 0) x 2 + 3y 4 (x, y) → (0, 0) ⎛ 2⎞ 2
y + 3y 4 ⎝ ⎠

4y 4
= lim
(x, y) → (0, 0) y 4 + 3y 4

= lim 1
(x, y) → (0, 0)
= 1.

By the same logic in a., it is impossible to find a δ disk around the origin that satisfies the definition of
4xy 2
the limit for any value of ε < 1. Therefore, lim does not exist.
(x, y) → (0, 0) x 2 + 3y 4

4.7 Show that


(x − 2)⎛⎝y − 1⎞⎠
lim
(x, y) → (2, 1) (x − 2) 2 + ⎛⎝y − 1⎞⎠ 2

does not exist.

Interior Points and Boundary Points


To study continuity and differentiability of a function of two or more variables, we first need to learn some new terminology.

Definition
Let S be a subset of ℝ 2 (Figure 4.17).
1. A point P 0 is called an interior point of S if there is a δ disk centered around P 0 contained completely in
S.
2. A point P 0 is called a boundary point of S if every δ disk centered around P 0 contains points both inside
and outside S.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 359

Figure 4.17 In the set S shown, (−1, 1) is an interior point


and (2, 3) is a boundary point.

Definition
Let S be a subset of ℝ 2 (Figure 4.17).
1. S is called an open set if every point of S is an interior point.
2. S is called a closed set if it contains all its boundary points.

An example of an open set is a δ disk. If we include the boundary of the disk, then it becomes a closed set. A set that
contains some, but not all, of its boundary points is neither open nor closed. For example if we include half the boundary of
a δ disk but not the other half, then the set is neither open nor closed.

Definition
Let S be a subset of ℝ 2 (Figure 4.17).
1. An open set S is a connected set if it cannot be represented as the union of two or more disjoint, nonempty
open subsets.
2. A set S is a region if it is open, connected, and nonempty.

The definition of a limit of a function of two variables requires the δ disk to be contained inside the domain of the function.
However, if we wish to find the limit of a function at a boundary point of the domain, the δ disk is not contained inside
the domain. By definition, some of the points of the δ disk are inside the domain and some are outside. Therefore, we need
only consider points that are inside both the δ disk and the domain of the function. This leads to the definition of the limit
of a function at a boundary point.

Definition
Let f be a function of two variables, x and y, and suppose (a, b) is on the boundary of the domain of f . Then,
the limit of f (x, y) as (x, y) approaches (a, b) is L, written

lim f (x, y) = L,
(x, y) → (a, b)
360 Chapter 4 | Differentiation of Functions of Several Variables

if for any ε > 0, there exists a number δ > 0 such that for any point (x, y) inside the domain of f and within a
suitably small distance positive δ of (a, b), the value of f (x, y) is no more than ε away from L (Figure 4.15).
Using symbols, we can write: For any ε > 0, there exists a number δ > 0 such that

| f (x, y) − L| < ε whenever 0 < (x − a) 2 + ⎛⎝y − b⎞⎠ 2 < δ.

Example 4.10

Limit of a Function at a Boundary Point

Prove lim 25 − x 2 − y 2 = 0.
(x, y) → (4, 3)

Solution

|
⎧ ⎫
The domain of the function f (x, y) = 25 − x 2 − y 2 is ⎨⎩(x, y) ∈ ℝ 2 x 2 + y 2 ≤ 25⎬⎭, which is a circle of
radius 5 centered at the origin, along with its interior as shown in the following graph.

Figure 4.18 Domain of the function


f (x, y) = 25 − x 2 − y 2.

We can use the limit laws, which apply to limits at the boundary of domains as well as interior points:

lim 25 − x 2 − y 2 = lim ⎝25 − x 2 − y 2⎞⎠
(x, y) → (4, 3) (x, y) → (4, 3)

= lim 25 − lim x2 − lim y2


(x, y) → (4, 3) (x, y) → (4, 3) (x, y) → (4, 3)

= 25 − 4 2 − 3 2
= 0.
See the following graph.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 361

Figure 4.19 Graph of the function


f (x, y) = 25 − x 2 − y 2.

4.8 Evaluate the following limit:

lim 29 − x 2 − y 2.
(x, y) → (5, −2)

Continuity of Functions of Two Variables


In Continuity (http://cnx.org/content/m53489/latest/) , we defined the continuity of a function of one variable and
saw how it relied on the limit of a function of one variable. In particular, three conditions are necessary for f (x) to be
continuous at point x = a:
1. f (a) exists.

2. lim f (x) exists.


x→a

3. lim f (x) = f (a).


x→a

These three conditions are necessary for continuity of a function of two variables as well.

Definition
A function f (x, y) is continuous at a point (a, b) in its domain if the following conditions are satisfied:

1. f (a, b) exists.

2. lim f (x, y) exists.


(x, y) → (a, b)

3. lim f (x, y) = f (a, b).


(x, y) → (a, b)
362 Chapter 4 | Differentiation of Functions of Several Variables

Example 4.11

Demonstrating Continuity for a Function of Two Variables

3x + 2y
Show that the function f (x, y) = is continuous at point (5, −3).
x+y+1

Solution
There are three conditions to be satisfied, per the definition of continuity. In this example, a = 5 and b = −3.
1. f (a, b) exists. This is true because the domain of the function f consists of those ordered pairs
for which the denominator is nonzero (i.e., x + y + 1 ≠ 0). Point (5, −3) satisfies this condition.
Furthermore,
3(5) + 2(−3) 15 − 6
f (a, b) = f (5, −3) = = = 3.
5 + (−3) + 1 2+1
2. lim f (x, y) exists. This is also true:
(x, y) → (a, b)

3x + 2y
lim f (x, y) = lim
(x, y) → (a, b) (x, y) → (5, −3) x + y+1
⎛ ⎞
lim ⎝3x + 2y⎠
(x, y) → (5, −3)
= ⎛
lim ⎝ x + y + 1⎞⎠
(x, y) → (5, −3)

= 15 − 6
5−3+1
= 3.
3. lim f (x, y) = f (a, b). This is true because we have just shown that both sides of this equation
(x, y) → (a, b)
equal three.

4.9 Show that the function f (x, y) = 26 − 2x 2 − y 2 is continuous at point (2, −3).

Continuity of a function of any number of variables can also be defined in terms of delta and epsilon. A function of two
variables is continuous at a point (x 0, y 0) in its domain if for every ε > 0 there exists a δ > 0 such that, whenever

(x − x 0) 2 + (y − y 0) 2 < δ it is true, | f (x, y) − f (a, b)| < ε. This definition can be combined with the formal definition
(that is, the epsilon–delta definition) of continuity of a function of one variable to prove the following theorems:

Theorem 4.2: The Sum of Continuous Functions Is Continuous


If f (x, y) is continuous at (x 0, y 0), and g(x, y) is continuous at (x 0, y 0), then f (x, y) + g(x, y) is continuous
at (x 0, y 0).

Theorem 4.3: The Product of Continuous Functions Is Continuous


If g(x) is continuous at x 0 and h(y) is continuous at y 0, then f (x, y) = g(x)h(y) is continuous at (x 0, y 0).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 363

Theorem 4.4: The Composition of Continuous Functions Is Continuous


Let g be a function of two variables from a domain D ⊆ ℝ 2 to a range R ⊆ ℝ. Suppose g is continuous at some
point (x 0, y 0) ∈ D and define z 0 = g(x 0, y 0). Let f be a function that maps ℝ to ℝ such that z 0 is in the domain
of f . Last, assume f is continuous at z 0. Then f ∘ g is continuous at (x 0, y 0) as shown in the following figure.

Figure 4.20 The composition of two continuous functions is continuous.

Let’s now use the previous theorems to show continuity of functions in the following examples.

Example 4.12

More Examples of Continuity of a Function of Two Variables

Show that the functions f (x, y) = 4x 3 y 2 and g(x, y) = cos⎛⎝4x 3 y 2⎞⎠ are continuous everywhere.

Solution
The polynomials g(x) = 4x 3 and h(y) = y 2 are continuous at every real number, and therefore by the product
of continuous functions theorem, f (x, y) = 4x 3 y 2 is continuous at every point (x, y) in the xy-plane. Since
f (x, y) = 4x 3 y 2 is continuous at every point (x, y) in the xy-plane and g(x) = cos x is continuous at every
real number x, the continuity of the composition of functions tells us that g(x, y) = cos⎛⎝4x 3 y 2⎞⎠ is continuous
at every point (x, y) in the xy-plane.

4
Show that the functions f (x, y) = 2x 2 y 3 + 3 and g(x, y) = ⎛⎝2x 2 y 3 + 3⎞⎠ are continuous everywhere.
4.10

Functions of Three or More Variables


The limit of a function of three or more variables occurs readily in applications. For example, suppose we have a
function f (x, y, z) that gives the temperature at a physical location (x, y, z) in three dimensions. Or perhaps a function
g(x, y, z, t) can indicate air pressure at a location (x, y, z) at time t. How can we take a limit at a point in ℝ 3 ? What
does it mean to be continuous at a point in four dimensions?
The answers to these questions rely on extending the concept of a δ disk into more than two dimensions. Then, the ideas of
the limit of a function of three or more variables and the continuity of a function of three or more variables are very similar
to the definitions given earlier for a function of two variables.
364 Chapter 4 | Differentiation of Functions of Several Variables

Definition
Let (x 0, y 0, z 0) be a point in ℝ 3. Then, a δ ball in three dimensions consists of all points in ℝ 3 lying at a distance
of less than δ from (x 0, y 0, z 0) —that is,

|
⎧ ⎫


(x, y, z) ∈ ℝ 3 (x − x 0) 2 + (y − y 0) 2 + (z − z 0) 2 < δ⎬⎭.

To define a δ ball in higher dimensions, add additional terms under the radical to correspond to each additional
dimension. For example, given a point P = (w 0, x 0, y 0, z 0) in ℝ 4, a δ ball around P can be described by

|
⎧ ⎫


(w, x, y, z) ∈ ℝ 4 (w − w 0) 2 + (x − x 0) 2 + (y − y 0) 2 + (z − z 0) 2 < δ⎬⎭.

To show that a limit of a function of three variables exists at a point (x 0, y 0, z 0), it suffices to show that for any point in a
δ ball centered at (x 0, y 0, z 0), the value of the function at that point is arbitrarily close to a fixed value (the limit value).
All the limit laws for functions of two variables hold for functions of more than two variables as well.

Example 4.13

Finding the Limit of a Function of Three Variables

x 2 y − 3z
Find lim .
(x, y, z) → (4, 1, −3) 2x + 5y − z

Solution
Before we can apply the quotient law, we need to verify that the limit of the denominator is nonzero. Using the
difference law, the identity law, and the constant law,
⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2x + 5y − z⎞⎠ = 2⎝
(x, y, z) → (4, 1, −3) ⎠
x + 5⎝
(x, y, z) → (4, 1, −3) ⎠ ⎝(x, y, z) → (4, 1, −3) ⎠

lim ⎝ lim lim y − lim z
(x, y, z) → (4, 1, −3)
= 2(4) + 5(1) − (−3)
= 16.
Since this is nonzero, we next find the limit of the numerator. Using the product law, difference law, constant
multiple law, and identity law,

⎛ ⎞ ⎛ ⎞
2
⎛ 2
− 3z⎞⎠ = ⎝
(x, y, z) → (4, 1, −3) ⎠ ⎝(x, y, z) → (4, 1, −3) ⎠
lim ⎝x y lim x lim y −3 lim z
(x, y, z) → (4, 1, −3) (x, y, z) → (4, 1, −3)

= ⎛⎝4 2⎞⎠(1) − 3(−3)


= 16 + 9
= 25.
Last, applying the quotient law:
⎛ 2
lim ⎝x y − 3z⎞⎠
x 2 y − 3z (x, y, z) → (4, 1, −3)
lim = ⎛
(x, y, z) → (4, 1, −3) 2x + 5y − z lim ⎝ 2x + 5y − z⎞⎠
(x, y, z) → (4, 1, −3)

= 25 .
16

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 365

4.11 Find lim 13 − x 2 − 2y 2 + z 2.


(x, y, z) → (4, −1, 3)
366 Chapter 4 | Differentiation of Functions of Several Variables

4.2 EXERCISES
For the following exercises, find the limit of the function. xy + 1
75. lim
(x, y) → (0, 0) x 2 + y 2 + 1
60. lim x
(x, y) → (1, 2)
x2 + y2
76. lim
5x 2 y (x, y) → (0, 0) x2 + y2 + 1 − 1
61. lim
(x, y) → (1, 2) x 2 + y 2

77. lim ln⎛⎝x 2 + y 2⎞⎠


2 (x, y) → (0, 0)
5x y
62. Show that the limit lim exists and is
(x, y) → (0, 0) x 2 + y 2
For the following exercises, complete the statement.
the same along the paths: y-axis and x-axis, and along
y = x. 78. A point (x 0, y 0) in a plane region R is an interior
point of R if _________________.
For the following exercises, evaluate the limits at the
indicated values of x and y. If the limit does not exist, state 79. A point (x 0, y 0) in a plane region R is called a
this and explain why the limit does not exist. boundary point of R if ___________.

4x 2 + 10y 2 + 4 For the following exercises, use algebraic techniques to


63. lim evaluate the limit.
(x, y) → (0, 0) 4x 2 − 10y 2 + 6

x−y−1
1 80. lim
64. lim (x, y) → (2, 1) x−y−1
(x, y) → (11, 13) xy

x 4 − 4y 4
y 2 sin x 81. lim
65. lim (x, y) → (0, 0) x 2 + 2y 2
(x, y) → (0, 1) x

⎛ x8 + y7 ⎞ x3 − y3
lim
sin⎜ ⎟
82.
66. lim (x, y) → (0, 0) x − y
(x, y) → (0, 0) ⎝ x − y + 10 ⎠

y tan x x 2 − xy
lim 83. lim
67.
(x, y) → (π/4, 1) y + 1 (x, y) → (0, 0) x − y

sec x + 2 For the following exercises, evaluate the limits of the


68. lim functions of three variables.
(x, y) → (0, π/4) 3x − tan y

⎛1 ⎞ xz 2 − y 2 z
lim − 5y ⎠ 84. lim
(x, y) → (2, 5)⎝ x
69. (x, y, z) → (1, 2, 3) xyz − 1

70. lim x ln y x2 − y2 − z2
(x, y) → (4, 4) 85. lim
(x, y, z) → (0, 0, 0) x 2 + y 2 − z 2

−x 2 − y 2
71. lim e For the following exercises, evaluate the limit of the
(x, y) → (4, 4)
function by determining the value the function approaches
along the indicated paths. If the limit does not exist, explain
72. lim 9 − x2 − y2 why not.
(x, y) → (0, 0)

⎛ 2 3
73. lim ⎝x y − x 3 y 2 + 3x + 2y⎞⎠
(x, y) → (1, 2)

⎛x + y ⎞
lim x sin⎝
4 ⎠
74.
(x, y) → (π, π)

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 367

xy + y 3 x2 − y2
86. lim 97. Determine whether g(x, y) = 2 is continuous
(x, y) → (0, 0) x 2 + y 2 x + y2
a. Along the x-axis (y = 0) at (0, 0).
b. Along the y-axis (x = 0)
98. Create a plot using graphing software to determine
c. Along the path y = 2x
where the limit does not exist. Determine the region of
the coordinate plane in which f (x, y) = 1 is
xy + y 3 x2 − y
87. Evaluate lim using the results of
(x, y) → (0, 0) x 2 + y 2
continuous.
previous problem.
99. Determine the region of the xy-plane in which the
2
x y ⎛ xy 2 ⎞
88. lim composite function g(x, y) = arctan⎜ x + y ⎟ is
(x, y) → (0, 0) x 4 + y 2 ⎝ ⎠
a. Along the x-axis (y = 0) continuous. Use technology to support your conclusion.
b. Along the y-axis (x = 0)
100. Determine the region of the xy-plane in which
c. Along the path y = x 2
f (x, y) = ln(x 2 + y 2 − 1) is continuous. Use technology
to support your conclusion. (Hint: Choose the range of
x2 y
89. Evaluate lim using the results of values for x and y carefully!)
(x, y) → (0, 0) x 4 + y 2

previous problem. 101. At what points in space is


g(x, y, z) = x 2 + y 2 − 2z 2 continuous?
Discuss the continuity of the following functions. Find the
largest region in the xy-plane in which the following
functions are continuous. 102. At what points in space is g(x, y, z) = 2 12
x +z −1
90. f (x, y) = sin(xy) continuous?

103. Show that lim 1 does not exist at


91. f (x, y) = ln(x + y) (x, y) → (0, 0) x 2 + y 2

3xy (0, 0) by plotting the graph of the function.


92. f (x, y) = e
−xy 2
93. 1
f (x, y) = xy 104. [T] Evaluate lim by plotting the
(x, y) → (0, 0) x 2 + y 4

function using a CAS. Determine analytically the limit


For the following exercises, determine the region in which
along the path x = y 2.
the function is continuous. Explain your answer.

x2 y 105. [T]
94. f (x, y) = a. Use a CAS to draw a contour map of
x + y2
2
z = 9 − x 2 − y 2.
⎧ ⎫
⎪ x2 y ⎪
b. What is the name of the geometric shape of the
if (x, y) ≠ (0, 0)
95. f (x, y) = ⎨ x2 + y2 ⎬ (Hint: level curves?
⎪ ⎪ c. Give the general equation of the level curves.
⎩ 0 if (x, y) = (0, 0)⎭ d. What is the maximum value of z ?
Show that the function approaches different values along e. What is the domain of the function?
two different paths.) f. What is the range of the function?

sin(x 2 + y 2) 106. True or False: If we evaluate lim f (x)


96. f (x, y) = (x, y) → (0, 0)
x2 + y2
along several paths and each time the limit is 1, we can
conclude that lim f (x) = 1.
(x, y) → (0, 0)
368 Chapter 4 | Differentiation of Functions of Several Variables

107. Use polar coordinates to find


2 2
sin x + y
lim . You can also find the limit using
(x, y) → (0, 0) x2 + y2
L’Hôpital’s rule.

108. Use polar coordinates to find


lim cos⎛⎝x 2 2⎞
+ y ⎠.
(x, y) → (0, 0)

109. Discuss the continuity of f (g(x, y)) where


f (t) = 1/t and g(x, y) = 2x − 5y.

110. Given f (x, y) = x 2 − 4y, find


f (x + h, y) − f (x, y)
lim .
h→0 h

111. Given f (x, y) = x 2 − 4y, find


f (1 + h, y) − f (1, y)
lim .
h→0 h

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 369

4.3 | Partial Derivatives


Learning Objectives
4.3.1 Calculate the partial derivatives of a function of two variables.
4.3.2 Calculate the partial derivatives of a function of more than two variables.
4.3.3 Determine the higher-order derivatives of a function of two variables.
4.3.4 Explain the meaning of a partial differential equation and give an example.

Now that we have examined limits and continuity of functions of two variables, we can proceed to study derivatives.
Finding derivatives of functions of two variables is the key concept in this chapter, with as many applications in
mathematics, science, and engineering as differentiation of single-variable functions. However, we have already seen that
limits and continuity of multivariable functions have new issues and require new terminology and ideas to deal with them.
This carries over into differentiation as well.

Derivatives of a Function of Two Variables


When studying derivatives of functions of one variable, we found that one interpretation of the derivative is an instantaneous
rate of change of y as a function of x. Leibniz notation for the derivative is dy/dx, which implies that y is the dependent
variable and x is the independent variable. For a function z = f (x, y) of two variables, x and y are the independent
variables and z is the dependent variable. This raises two questions right away: How do we adapt Leibniz notation for
functions of two variables? Also, what is an interpretation of the derivative? The answer lies in partial derivatives.

Definition
Let f (x, y) be a function of two variables. Then the partial derivative of f with respect to x, written as ∂ f /∂ x,
or f x, is defined as

∂f f ⎛x + h, y⎞⎠ − f (x, y) (4.12)


= lim ⎝ .
∂x h → 0 h
The partial derivative of f with respect to y, written as ∂ f /∂ y, or f y, is defined as

∂f f ⎛x, y + k⎞⎠ − f (x, y) (4.13)


= lim ⎝ .
∂y k → 0 k

This definition shows two differences already. First, the notation changes, in the sense that we still use a version of Leibniz
notation, but the d in the original notation is replaced with the symbol ∂ . (This rounded “d” is usually called “partial,” so
∂ f /∂ x is spoken as the “partial of f with respect to x.”) This is the first hint that we are dealing with partial derivatives.
Second, we now have two different derivatives we can take, since there are two different independent variables. Depending
on which variable we choose, we can come up with different partial derivatives altogether, and often do.

Example 4.14

Calculating Partial Derivatives from the Definition

Use the definition of the partial derivative as a limit to calculate ∂ f /∂ x and ∂ f /∂ y for the function

f (x, y) = x 2 − 3xy + 2y 2 − 4x + 5y − 12.

Solution
370 Chapter 4 | Differentiation of Functions of Several Variables

First, calculate f ⎛⎝x + h, y⎞⎠.

f ⎛⎝x + h, y⎞⎠ = (x + h) 2 − 3(x + h)y + 2y 2 − 4(x + h) + 5y − 12


= x 2 + 2xh + h 2 − 3xy − 3hy + 2y 2 − 4x − 4h + 5y − 12.

Next, substitute this into Equation 4.12 and simplify:


∂f f ⎛x + h, y⎞⎠ − f (x, y)
= lim ⎝
∂x h→0 h
⎛ 2
⎝x + 2xh + h 2 − 3xy − 3hy + 2y 2 − 4x − 4h + 5y − 12⎞⎠ − ⎛⎝x 2 − 3xy + 2y 2 − 4x + 5y − 12⎞⎠
= lim
h→0 h
x 2 + 2xh + h 2 − 3xy − 3hy + 2y 2 − 4x − 4h + 5y − 12 − x 2 + 3xy − 2y 2 + 4x − 5y + 12
= lim
h→0 h
2xh + h 2 − 3hy − 4h
= lim
h→0 h
h⎛⎝2x + h − 3y − 4⎞⎠
= lim
h→0 h
= lim ⎛⎝2x + h − 3y − 4⎞⎠
h→0
= 2x − 3y − 4.

∂f
To calculate , first calculate f ⎛⎝x, y + h⎞⎠:
∂y

f ⎛⎝x + h, y⎞⎠ = x 2 − 3x⎛⎝y + h⎞⎠ + 2⎛⎝y + h⎞⎠ 2 − 4x + 5⎛⎝y + h⎞⎠ − 12


= x 2 − 3xy − 3xh + 2y 2 + 4yh + 2h 2 − 4x + 5y + 5h − 12.

Next, substitute this into Equation 4.13 and simplify:


∂f f (x, y + h) − f (x, y)
= lim
∂y h→0 h
⎛ 2
⎝x − 3xy − 3xh + 2y 2 + 4yh + 2h 2 − 4x + 5y + 5h − 12⎞⎠ − ⎛⎝x 2 − 3xy + 2y 2 − 4x + 5y − 12⎞⎠
= lim
h→0 h
x 2 − 3xy − 3xh + 2y 2 + 4yh + 2h 2 − 4x + 5y + 5h − 12 − x 2 + 3xy − 2y 2 + 4x − 5y + 12
= lim
h→0 h
−3xh + 4yh + 2h 2 + 5h
= lim
h→0 h

h −3x + 4y + 2h + 5⎞⎠
= lim ⎝
h→0 h
= lim ⎝−3x + 4y + 2h + 5⎞⎠

h→0
= −3x + 4y + 5.

4.12 Use the definition of the partial derivative as a limit to calculate ∂ f /∂ x and ∂ f /∂ y for the function

f (x, y) = 4x 2 + 2xy − y 2 + 3x − 2y + 5.

The idea to keep in mind when calculating partial derivatives is to treat all independent variables, other than the variable
with respect to which we are differentiating, as constants. Then proceed to differentiate as with a function of a single
variable. To see why this is true, first fix y and define g(x) = f (x, y) as a function of x. Then

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 371

g(x + h) − g(x) f ⎛x + h, y⎞⎠ − f (x, y) ∂ f


g′ (x) = lim = lim ⎝ = .
h→0 h h→0 h ∂x
The same is true for calculating the partial derivative of f with respect to y. This time, fix x and define h(y) = f (x, y)
as a function of y. Then

h(x + k) − h(x) f ⎛x, y + k⎞⎠ − f (x, y) ∂ f


h′ (x) = lim = lim ⎝ = .
k→0 k k→0 k ∂y

All differentiation rules from Introduction to Derivatives (http://cnx.org/content/m53494/latest/) apply.

Example 4.15

Calculating Partial Derivatives

Calculate ∂ f /∂ x and ∂ f /∂ y for the following functions by holding the opposite variable constant then
differentiating:
a. f (x, y) = x 2 − 3xy + 2y 2 − 4x + 5y − 12

b. g(x, y) = sin⎛⎝x 2 y − 2x + 4⎞⎠

Solution
a. To calculate ∂ f /∂ x, treat the variable y as a constant. Then differentiate f (x, y) with respect to x
using the sum, difference, and power rules:
∂f
= ∂ ⎡⎣x 2 − 3xy + 2y 2 − 4x + 5y − 12⎤⎦
∂x ∂x
= ∂ ⎡⎣x 2⎤⎦ − ∂ ⎡⎣3xy⎤⎦ + ∂ ⎡⎣2y 2⎤⎦ − ∂ [4x] + ∂ ⎡⎣5y⎤⎦ − ∂ [12]
∂x ∂x ∂x ∂x ∂x ∂x
= 2x − 3y + 0 − 4 + 0 − 0
= 2x − 3y − 4.

The derivatives of the third, fifth, and sixth terms are all zero because they do not contain the variable x,
so they are treated as constant terms. The derivative of the second term is equal to the coefficient of x,
which is −3y. Calculating ∂ f /∂ y:

∂f
= ∂ ⎡⎣x 2 − 3xy + 2y 2 − 4x + 5y − 12⎤⎦
∂y ∂y
= ∂ ⎡⎣x 2⎤⎦ − ∂ ⎡⎣3xy⎤⎦ + ∂ ⎡⎣2y 2⎤⎦ − ∂ [4x] + ∂ ⎡⎣5y⎤⎦ − ∂ [12]
∂y ∂y ∂y ∂y ∂y ∂y
= −3x + 4y − 0 + 5 − 0
= −3x + 4y + 5.

These are the same answers obtained in Example 4.14.


b. To calculate ∂ g/∂ x, treat the variable y as a constant. Then differentiate g(x, y) with respect to x using
the chain rule and power rule:

= ∂ ⎡⎣sin⎛⎝x 2 y − 2x + 4⎞⎠⎤⎦
∂g
∂x ∂x
= cos⎛⎝x 2 y − 2x + 4⎞⎠ ∂ ⎡⎣x 2 y − 2x + 4⎤⎦
∂x
= ⎝2xy − 2⎠cos⎝x y − 2x + 4⎞⎠.
⎛ ⎞ ⎛ 2
372 Chapter 4 | Differentiation of Functions of Several Variables

To calculate ∂ g/∂ y, treat the variable x as a constant. Then differentiate g(x, y) with respect to y
using the chain rule and power rule:

= ∂ ⎡⎣sin⎛⎝x 2 y − 2x + 4⎞⎠⎤⎦
∂g
∂y ∂y
= cos⎛⎝x 2 y − 2x + 4⎞⎠ ∂ ⎡⎣x 2 y − 2x + 4⎤⎦
∂y
= x 2 cos⎛⎝x 2 y − 2x + 4⎞⎠.

4.13 Calculate ∂ f /∂ x and ∂ f /∂ y for the function f (x, y) = tan⎛⎝x 3 − 3x 2 y 2 + 2y 4⎞⎠ by holding the
opposite variable constant, then differentiating.

How can we interpret these partial derivatives? Recall that the graph of a function of two variables is a surface in ℝ 3. If
we remove the limit from the definition of the partial derivative with respect to x, the difference quotient remains:

f ⎛⎝x + h, y⎞⎠ − f (x, y)


.
h
This resembles the difference quotient for the derivative of a function of one variable, except for the presence of the y
variable. Figure 4.21 illustrates a surface described by an arbitrary function z = f (x, y).

Figure 4.21 Secant line passing through the points


⎛ ⎞ ⎛ ⎛ ⎞⎞
⎝x, y, f (x, y)⎠ and ⎝x + h, y, f ⎝x + h, y⎠⎠.

In Figure 4.21, the value of h is positive. If we graph f (x, y) and f ⎛⎝x + h, y⎞⎠ for an arbitrary point (x, y), then the
slope of the secant line passing through these two points is given by
f ⎛⎝x + h, y⎞⎠ − f (x, y)
.
h
This line is parallel to the x-axis. Therefore, the slope of the secant line represents an average rate of change of the function
f as we travel parallel to the x-axis. As h approaches zero, the slope of the secant line approaches the slope of the tangent
line.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 373

If we choose to change y instead of x by the same incremental value h, then the secant line is parallel to the y-axis and
so is the tangent line. Therefore, ∂ f /∂ x represents the slope of the tangent line passing through the point ⎛⎝x, y, f (x, y)⎞⎠
parallel to the x-axis and ∂ f /∂ y represents the slope of the tangent line passing through the point ⎛⎝x, y, f (x, y)⎞⎠ parallel
to the y-axis. If we wish to find the slope of a tangent line passing through the same point in any other direction, then we
need what are called directional derivatives, which we discuss in Directional Derivatives and the Gradient.
We now return to the idea of contour maps, which we introduced in Functions of Several Variables. We can use a
contour map to estimate partial derivatives of a function g(x, y).

Example 4.16

Partial Derivatives from a Contour Map


Use a contour map to estimate ∂ g/∂ x at the point ⎝ 5, 0⎞⎠ for the function g(x, y) = 9 − x 2 − y 2.

Solution
The following graph represents a contour map for the function g(x, y) = 9 − x 2 − y 2.

Figure 4.22 Contour map for the function


g(x, y) = 9 − x 2 − y 2, using c = 0, 1, 2, and 3
(c = 3 corresponds to the origin).

The inner circle on the contour map corresponds to c = 2 and the next circle out corresponds to c = 1. The first
circle is given by the equation 2 = 9 − x 2 − y 2; the second circle is given by the equation 1 = 9 − x 2 − y 2.
The first equation simplifies to x 2 + y 2 = 5 and the second equation simplifies to x 2 + y 2 = 8. The

x-intercept of the first circle is ⎝ 5, 0⎞⎠ and the x-intercept of the second circle is ⎛⎝2 2, 0⎞⎠. We can estimate

the value of ∂ g/∂ x evaluated at the point ⎝ 5, 0⎞⎠ using the slope formula:

∂g
∂x | (x, y) = ⎛
⎝ 5, 0⎞⎠ ≈
g⎛⎝ 5, 0⎞⎠ − g⎛⎝2 2, 0⎞⎠
5−2 2
= 2−1 =
5−2 2
1
5−2 2
≈ −1.688.


To calculate the exact value of ∂ g/∂ x evaluated at the point ⎝ 5, 0⎞⎠, we start by finding ∂ g/∂ x using the
374 Chapter 4 | Differentiation of Functions of Several Variables

1/2
chain rule. First, we rewrite the function as g(x, y) = 9 − x 2 − y 2 = ⎛⎝9 − x 2 − y 2⎞⎠ and then differentiate
with respect to x while holding y constant:

∂ g 1⎛ −1/2
= ⎝9 − x 2 − y 2⎞⎠ (−2x) = − x .
∂x 2 9 − x2 − y2

Next, we evaluate this expression using x = 5 and y = 0:

∂g
∂x | (x, y) = ⎛⎝ 5, 0⎞⎠ = − 5
9 − ⎛⎝ 5⎞⎠ 2 − (0) 2
= − 5 = − 5 ≈ −1.118.
4 2

The estimate for the partial derivative corresponds to the slope of the secant line passing through the points
⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞
⎝ 5, 0, g⎝ 5, 0⎠⎠ and ⎝2 2, 0, g⎝2 2, 0⎠⎠. It represents an approximation to the slope of the tangent line to the


surface through the point ⎝ 5, 0, g⎛⎝ 5, 0⎞⎠⎞⎠, which is parallel to the x-axis.

4.14 Use a contour map to estimate ∂ f /∂ y at point ⎛⎝0, 2⎞⎠ for the function

f (x, y) = x 2 − y 2.

Compare this with the exact answer.

Functions of More Than Two Variables


Suppose we have a function of three variables, such as w = f (x, y, z). We can calculate partial derivatives of w with
respect to any of the independent variables, simply as extensions of the definitions for partial derivatives of functions of two
variables.

Definition
Let f (x, y, z) be a function of three variables. Then, the partial derivative of f with respect to x, written as ∂ f /∂ x,
or f x, is defined to be

∂f f ⎛x + h, y, z⎞⎠ − f (x, y, z) (4.14)


= lim ⎝ .
∂x h → 0 h
The partial derivative of f with respect to y, written as ∂ f /∂ y, or f y, is defined to be

∂f f ⎛x, y + k, z⎞⎠ − f (x, y, z) (4.15)


= lim ⎝ .
∂y k → 0 k
The partial derivative of f with respect to z, written as ∂ f /∂ z, or f z, is defined to be

∂f f (x, y, z + m) − f (x, y, z) (4.16)


= lim m .
∂z m → 0

We can calculate a partial derivative of a function of three variables using the same idea we used for a function of two
variables. For example, if we have a function f of x, y, and z, and we wish to calculate ∂ f /∂ x, then we treat the other
two independent variables as if they are constants, then differentiate with respect to x.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 375

Example 4.17

Calculating Partial Derivatives for a Function of Three Variables

Use the limit definition of partial derivatives to calculate ∂ f /∂ x for the function

f (x, y, z) = x 2 − 3xy + 2y 2 − 4xz + 5yz 2 − 12x + 4y − 3z.

Then, find ∂ f /∂ y and ∂ f /∂ z by setting the other two variables constant and differentiating accordingly.

Solution
We first calculate ∂ f /∂ x using Equation 4.14, then we calculate the other two partial derivatives by holding
the remaining variables constant. To use the equation to find ∂ f /∂ x, we first need to calculate f ⎛⎝x + h, y, z⎞⎠:

f ⎛⎝x + h, y, z⎞⎠ = (x + h) 2 − 3(x + h)y + 2y 2 − 4(x + h)z + 5yz 2 − 12(x + h) + 4y − 3z


= x 2 + 2xh + h 2 − 3xy − 3xh + 2y 2 − 4xz − 4hz + 5yz 2 − 12x − 12h + 4y − 3z

and recall that f (x, y, z) = x 2 − 3xy + 2y 2 − 4zx + 5yz 2 − 12x + 4y − 3z. Next, we substitute these two
expressions into the equation:
∂f ⎡ x 2 + 2xh + h 2 − 3xy − 3hy + 2y 2 − 4xz − 4hz + 5yz 2 − 12x − 12h + 4y − 3z
= lim ⎢
∂x h → 0⎣ h
x 2 − 3xy + 2y 2 − 4xz + 5yz 2 − 12x + 4y − 3z ⎤⎥

h ⎦
⎡ 2xh + h 2 − 3hy − 4hz − 12h ⎤
= lim ⎢ ⎥
h → 0⎣ h ⎦
⎡h⎛2x + h − 3y − 4z − 12⎞⎠ ⎤
= lim ⎣ ⎝ ⎦
h→0 h
= lim ⎛⎝2x + h − 3y − 4z − 12⎞⎠
h→0
= 2x − 3y − 4z − 12.

Then we find ∂ f /∂ y by holding x and z constant. Therefore, any term that does not include the variable y
is constant, and its derivative is zero. We can apply the sum, difference, and power rules for functions of one
variable:
∂ ⎡x 2 − 3xy + 2y 2 − 4xz + 5yz 2 − 12x + 4y − 3z⎤
∂ y⎣ ⎦
∂ ⎡ 2⎤ ∂ ⎡ ⎤ ∂ ⎡ 2⎤ ∂ ∂ ⎡
= ⎣x ⎦ − ⎣3xy⎦ + ⎣2y ⎦ − [4xz] + ⎣5yz 2⎤⎦ − ∂ [12x] + ∂ ⎡⎣4y⎤⎦ − ∂ [3z]
∂y ∂y ∂y ∂y ∂y ∂y ∂y ∂y
= 0 − 3x + 4y − 0 + 5z 2 − 0 + 4 − 0
= −3x + 4y + 5z 2 + 4.

To calculate ∂ f /∂ z, we hold x and y constant and apply the sum, difference, and power rules for functions of
one variable:
∂ ⎡x 2 − 3xy + 2y 2 − 4xz + 5yz 2 − 12x + 4y − 3z⎤
∂ z⎣ ⎡ ⎤ ⎦
= ⎣x ⎦ − ⎣3xy⎦ + ⎣2y ⎦ − [4xz] + ⎣5yz 2⎤⎦ − ∂ [12x] + ∂ ⎡⎣4y⎤⎦ − ∂ [3z]
∂ 2 ∂ ⎡ ⎤ ∂ ⎡ 2⎤ ∂ ∂ ⎡
∂z ∂z ∂z ∂z ∂z ∂z ∂z ∂z
= 0 − 0 + 0 − 4x + 10yz − 0 + 0 − 3
= −4x + 10yz − 3.
376 Chapter 4 | Differentiation of Functions of Several Variables

4.15 Use the limit definition of partial derivatives to calculate ∂ f /∂ x for the function

f (x, y, z) = 2x 2 − 4x 2 y + 2y 2 + 5xz 2 − 6x + 3z − 8.

Then find ∂ f /∂ y and ∂ f /∂ z by setting the other two variables constant and differentiating accordingly.

Example 4.18

Calculating Partial Derivatives for a Function of Three Variables

Calculate the three partial derivatives of the following functions.


x 2 y − 4xz + y 2
a. f (x, y, z) =
x − 3yz

b. g(x, y, z) = sin⎛⎝x 2 y − z⎞⎠ + cos⎛⎝x 2 − yz⎞⎠

Solution
In each case, treat all variables as constants except the one whose partial derivative you are calculating.
∂f ⎡ x 2 y − 4xz + y 2 ⎤
= ∂ ⎢ ⎥
∂x ∂ x⎣ x − 3yz ⎦
∂ ⎛x 2 y − 4xz + y 2⎞⎛x − 3yz⎞ − ⎛x 2 y − 4xz + y 2⎞ ∂ ⎛x − 3yz⎞
= ∂ x⎝ ⎠⎝ ⎠ ⎝ ⎠∂ x ⎝ ⎠

⎛ ⎞2
⎝ x − 3yz⎠
⎛ 2

2xy − 4z⎞⎠⎛⎝x − 3yz⎞⎠ −
⎝ ⎝x y − 4xz + y 2⎞⎠(1)
a. =
x − 3yz⎞⎠ 2

2x 2 y − 6xy 2 z − 4xz + 12yz 2 − x 2 y + 4xz − y 2


= ⎛ ⎞2
⎝x − 3yz⎠

x 2 y − 6xy 2 z − 4xz + 12yz 2 + 4xz − y 2


= ⎛ ⎞2
⎝x − 3yz⎠

∂f ⎡ x 2 y − 4xz + y 2 ⎤
= ∂ ⎢ ⎥
∂y ∂ y⎣ x − 3yz ⎦
∂ ⎛x 2 y − 4xz + y 2⎞⎛x − 3yz⎞ − ⎛x 2 y − 4xz + y 2⎞ ∂ ⎛x − 3yz⎞
∂ y⎝ ⎠⎝ ⎠ ⎝ ⎠∂ y ⎝ ⎠
= ⎛ ⎞2
⎝x − 3yz⎠
⎛ 2
⎝x + 2y⎞⎠⎛⎝x − 3yz −⎞

⎛ 2
⎝x y − 4xz + y 2⎞⎠(−3z)
=
x − 3yz⎞⎠ 2

x 3 − 3x 2 yz + 2xy − 6y 2 z + 3x 2 yz − 12xz 2 + 3y 2 z
= ⎛ ⎞2
⎝x − 3yz⎠

x 3 + 2xy − 3y 2 z − 12xz 2
= ⎛ ⎞2
⎝x − 3yz⎠

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 377

∂f ⎡ x 2 y − 4xz + y 2 ⎤
= ∂⎢ ⎥
∂z ∂ z⎣ x − 3yz ⎦
∂ ⎛x 2 y − 4xz + y 2⎞⎛x − 3yz⎞ − ⎛x 2 y − 4xz + y 2⎞ ∂ ⎛x − 3yz⎞
∂ z⎝ ⎠⎝ ⎠ ⎝ ⎠∂ z ⎝ ⎠
= ⎛ ⎞2
⎝x − 3yz⎠
⎛ 2

(−4x) x − 3yz −


⎠ ⎝x y − 4xz + y 2⎞⎠⎛⎝−3y⎞⎠
=
x − 3yz⎞⎠ 2

−4x 2 + 12xyz + 3x 2 y 2 − 12xyz + 3y 3


= ⎛ ⎞2
⎝x − 3yz⎠

−4x 2 + 3x 2 y 2 + 3y 3
= ⎛ ⎞2
⎝x − 3yz⎠

∂f
= ∂ ⎡⎣sin⎛⎝x 2 y − z⎞⎠ + cos⎛⎝x 2 − yz⎞⎠⎤⎦
∂x ∂x
= ⎝cos⎛⎝x 2 y − z⎞⎠⎞⎠ ∂ ⎛⎝x 2 y − z⎞⎠ − ⎛⎝sin⎛⎝x 2 − yz⎞⎠⎞⎠ ∂ ⎛⎝x 2 − yz⎞⎠

∂x ∂x
⎛ 2 ⎞ ⎛ 2 ⎞
= 2xy cos⎝x y − z⎠ − 2x sin⎝x − yz⎠
∂f
= ∂ ⎡⎣sin⎛⎝x 2 y − z⎞⎠ + cos⎛⎝x 2 − yz⎞⎠⎤⎦
∂y ∂y
b. = ⎝cos⎛⎝x 2 y − z⎞⎠⎞⎠ ∂ ⎛⎝x 2 y − z⎞⎠ − ⎛⎝sin⎛⎝x 2 − yz⎞⎠⎞⎠ ∂ ⎛⎝x 2 − yz⎞⎠

∂y ∂y
= x 2 cos⎛⎝x 2 y − z⎞⎠ + z sin⎛⎝x 2 − yz⎞⎠
∂f
= ∂ ⎡⎣sin⎛⎝x 2 y − z⎞⎠ + cos⎛⎝x 2 − yz⎞⎠⎤⎦
∂z ∂z
= ⎝cos⎛⎝x 2 y − z⎞⎠⎞⎠ ∂ ⎛⎝x 2 y − z⎞⎠ − ⎛⎝sin⎛⎝x 2 − yz⎞⎠⎞⎠ ∂ ⎛⎝x 2 − yz⎞⎠

∂z ∂z
= −cos⎛⎝x 2 y − z⎞⎠ + y sin⎛⎝x 2 − yz⎞⎠

4.16 Calculate ∂ f /∂ x, ∂ f /∂ y, and ∂ f /∂ z for the function f (x, y, z) = sec⎛⎝x 2 y⎞⎠ − tan⎛⎝x 3 yz 2⎞⎠.

Higher-Order Partial Derivatives


Consider the function
f (x, y) = 2x 3 − 4xy 2 + 5y 3 − 6xy + 5x − 4y + 12.

Its partial derivatives are


∂f ∂f
= 6x 2 − 4y 2 − 6y + 5 and = −8xy + 15y 2 − 6x − 4.
∂x ∂y

Each of these partial derivatives is a function of two variables, so we can calculate partial derivatives of these functions.
Just as with derivatives of single-variable functions, we can call these second-order derivatives, third-order derivatives, and
so on. In general, they are referred to as higher-order partial derivatives. There are four second-order partial derivatives
for any function (provided they all exist):
∂2 f ⎡∂ f ⎤ ∂2 f ⎡∂ f ⎤ ∂2 f ⎡∂ f ⎤ ∂2 f ⎡∂ f ⎤
= ∂ ⎣ ⎦, = ∂ = ∂ = ∂ ⎣ ⎦.
∂ x∂ y ∂ x ⎣ ∂ y ⎦ ∂ y∂ x ∂ y ⎣ ∂ x ⎦
, ,
∂x 2 ∂ x ∂x ∂y 2 ∂ y ∂y
378 Chapter 4 | Differentiation of Functions of Several Variables

An alternative notation for each is f xx, f yx, f xy, and f yy, respectively. Higher-order partial derivatives calculated with
respect to different variables, such as f xy and f yx, are commonly called mixed partial derivatives.

Example 4.19

Calculating Second Partial Derivatives

Calculate all four second partial derivatives for the function


−3y
f (x, y) = xe + sin⎛⎝2x − 5y⎞⎠.

Solution
To calculate ∂ 2 f /dx 2 and ∂ 2 f /∂ y∂ x, we first calculate ∂ f /∂ x:

∂f −3y
=e + 2 cos⎛⎝2x − 5y⎞⎠.
∂x

To calculate ∂ 2 f /dx 2, differentiate ∂ f /∂ x with respect to x:

∂2 f ⎡∂ f ⎤
= ∂ ⎣ ⎦
∂x 2 ∂ x ∂x
⎡ −3y ⎤
= ∂ ⎣e + 2 cos⎛⎝2x − 5y⎞⎠⎦
∂x
= −4 sin⎛⎝2x − 5y⎞⎠.

To calculate ∂ 2 f /∂ y∂ x, differentiate ∂ f /∂ x with respect to y:

∂2 f ⎡∂ f ⎤
= ∂ ⎣ ⎦
∂ y∂ x ∂y ∂x
⎡ −3y ⎤
= ∂ ⎣e + 2 cos⎛⎝2x − 5y⎞⎠⎦
∂y
−3y
= −3e + 10 sin⎛⎝2x − 5y⎞⎠.

To calculate ∂ 2 f /∂ x∂ y and ∂ 2 f /dy 2, first calculate ∂ f /∂ y:

∂f −3y
= −3xe − 5 cos⎛⎝2x − 5y⎞⎠.
∂y

To calculate ∂ 2 f /∂ x∂ y, differentiate ∂ f /∂ y with respect to x:

∂2 f ⎡∂ f ⎤
= ∂ ⎣ ⎦
∂ x∂ y ∂x ∂y
⎡ −3y ⎤
= ∂ ⎣−3xe − 5 cos⎛⎝2x − 5y⎞⎠⎦
∂x
−3y
= −3e + 10 sin⎛⎝2x − 5y⎞⎠.

To calculate ∂ 2 f /∂ y 2, differentiate ∂ f /∂ y with respect to y:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 379

∂2 f ⎡∂ f ⎤
= ∂ ⎣ ⎦
∂ y2 ∂y ∂y
⎡ −3y ⎤
= ∂ ⎣−3xe − 5 cos⎛⎝2x − 5y⎞⎠⎦
∂y
−3y
= 9xe − 25 sin⎛⎝2x − 5y⎞⎠.

4.17 Calculate all four second partial derivatives for the function
f (x, y) = sin⎛⎝3x − 2y⎞⎠ + cos⎛⎝x + 4y⎞⎠.

At this point we should notice that, in both Example 4.19 and the checkpoint, it was true that ∂ 2 f /∂ x∂ y = ∂ 2 f /∂ y∂ x.
Under certain conditions, this is always true. In fact, it is a direct consequence of the following theorem.

Theorem 4.5: Equality of Mixed Partial Derivatives (Clairaut’s Theorem)


Suppose that f (x, y) is defined on an open disk D that contains the point (a, b). If the functions f xy and f yx are
continuous on D, then f xy = f yx.

Clairaut’s theorem guarantees that as long as mixed second-order derivatives are continuous, the order in which we choose
to differentiate the functions (i.e., which variable goes first, then second, and so on) does not matter. It can be extended to
higher-order derivatives as well. The proof of Clairaut’s theorem can be found in most advanced calculus books.
Two other second-order partial derivatives can be calculated for any function f (x, y). The partial derivative f xx is equal
to the partial derivative of f x with respect to x, and f yy is equal to the partial derivative of f y with respect to y.

Partial Differential Equations


In Introduction to Differential Equations (http://cnx.org/content/m53696/latest/) , we studied differential
equations in which the unknown function had one independent variable. A partial differential equation is an equation that
involves an unknown function of more than one independent variable and one or more of its partial derivatives. Examples
of partial differential equations are
u t = c 2 ⎛⎝u xx + u yy⎞⎠ (4.17)

( heat equation in two dimensions)


u tt = c 2 ⎛⎝u xx + u yy⎞⎠ (4.18)

( wave equation in two dimensions)


u xx + u yy = 0 (4.19)

( Laplace’s equation in two dimensions)


In the first two equations, the unknown function u has three independent variables— t, x, and y —and c is an arbitrary
constant. The independent variables x and y are considered to be spatial variables, and the variable t represents time. In
Laplace’s equation, the unknown function u has two independent variables x and y.
380 Chapter 4 | Differentiation of Functions of Several Variables

Example 4.20

A Solution to the Wave Equation

Verify that
u(x, y, t) = 5 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)

is a solution to the wave equation


u tt = 4⎛⎝u xx + u yy⎞⎠. (4.20)

Solution
First, we calculate u tt, u xx, and u yy :

⎡ ⎤
u tt = ∂ ⎣∂ u ⎦
∂t ∂t
= ∂ ⎡⎣5 sin(3πx)sin⎛⎝4πy⎞⎠⎛⎝−10π sin(10πt)⎞⎠⎤⎦
∂t
= ∂ ⎡⎣−50π sin(3πx)sin⎛⎝4πy⎞⎠sin(10πt)⎤⎦
∂t
= −500π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)
⎡ ⎤
u xx = ∂ ⎣∂ u ⎦
∂x ∂x
= ∂ ⎡⎣15π cos(3πx)sin⎛⎝4πy⎞⎠cos(10πt)⎤⎦
∂x
= −45π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)
∂ ⎡∂ u ⎤
∂ y ⎣∂ y ⎦
u yy =

= ∂ ⎡⎣5 sin(3πx)⎛⎝4π cos⎛⎝4πy⎞⎠⎞⎠cos(10πt)⎤⎦


∂y
= ∂ ⎡⎣20π sin(3πx)cos⎛⎝4πy⎞⎠cos(10πt)⎤⎦
∂y
= −80π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt).

Next, we substitute each of these into the right-hand side of Equation 4.20 and simplify:
4⎛⎝u xx + u yy⎞⎠ = 4⎛⎝−45π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt) + − 80π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)⎞⎠
= 4⎛⎝−125π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)⎞⎠
= −500π 2 sin(3πx)sin⎛⎝4πy⎞⎠cos(10πt)
= u tt.

This verifies the solution.

⎛ ⎞ ⎛y ⎞
4.18 Verify that u(x, y, t) = 2 sin⎝ x ⎠sin⎝ ⎠e −25t/16 is a solution to the heat equation
3 4

u t = 9⎛⎝u xx + u yy⎞⎠. (4.21)

Since the solution to the two-dimensional heat equation is a function of three variables, it is not easy to create a visual
representation of the solution. We can graph the solution for fixed values of t, which amounts to snapshots of the heat
distributions at fixed times. These snapshots show how the heat is distributed over a two-dimensional surface as time
progresses. The graph of the preceding solution at time t = 0 appears in the following figure. As time progresses, the
extremes level out, approaching zero as t approaches infinity.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 381

Figure 4.23

If we consider the heat equation in one dimension, then it is possible to graph the solution over time. The heat equation in
one dimension becomes
u t = c 2 u xx,

where c 2 represents the thermal diffusivity of the material in question. A solution of this differential equation can be written
in the form
2 m2 c2 t (4.22)
u m (x, t) = e −π sin(mπx)
where m is any positive integer. A graph of this solution using m = 1 appears in Figure 4.24, where the initial
temperature distribution over a wire of length 1 is given by u(x, 0) = sin πx. Notice that as time progresses, the wire
cools off. This is seen because, from left to right, the highest temperature (which occurs in the middle of the wire) decreases
and changes color from red to blue.
382 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.24 Graph of a solution of the heat equation in one dimension over time.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 383

Lord Kelvin and the Age of Earth

Figure 4.25 (a) William Thomson (Lord Kelvin), 1824-1907, was a British physicist and
electrical engineer; (b) Kelvin used the heat diffusion equation to estimate the age of Earth
(credit: modification of work by NASA).

During the late 1800s, the scientists of the new field of geology were coming to the conclusion that Earth must be
“millions and millions” of years old. At about the same time, Charles Darwin had published his treatise on evolution.
Darwin’s view was that evolution needed many millions of years to take place, and he made a bold claim that the
Weald chalk fields, where important fossils were found, were the result of 300 million years of erosion.
At that time, eminent physicist William Thomson (Lord Kelvin) used an important partial differential equation, known
as the heat diffusion equation, to estimate the age of Earth by determining how long it would take Earth to cool from
molten rock to what we had at that time. His conclusion was a range of 20 to 400 million years, but most likely
about 50 million years. For many decades, the proclamations of this irrefutable icon of science did not sit well with
geologists or with Darwin.
Read Kelvin’s paper (http://www.openstaxcollege.org/l/20_KelEarthAge) on estimating the age of
the Earth.

Kelvin made reasonable assumptions based on what was known in his time, but he also made several assumptions
that turned out to be wrong. One incorrect assumption was that Earth is solid and that the cooling was therefore
via conduction only, hence justifying the use of the diffusion equation. But the most serious error was a forgivable
one—omission of the fact that Earth contains radioactive elements that continually supply heat beneath Earth’s mantle.
The discovery of radioactivity came near the end of Kelvin’s life and he acknowledged that his calculation would have
to be modified.
Kelvin used the simple one-dimensional model applied only to Earth’s outer shell, and derived the age from graphs
and the roughly known temperature gradient near Earth’s surface. Let’s take a look at a more appropriate version of
the diffusion equation in radial coordinates, which has the form

∂ T = K ⎡∂ 2 T + 2 ∂ T ⎤. (4.23)
∂t ⎣ ∂2 r r ∂ r ⎦
384 Chapter 4 | Differentiation of Functions of Several Variables

Here, T(r, t) is temperature as a function of r (measured from the center of Earth) and time t. K is the heat
conductivity—for molten rock, in this case. The standard method of solving such a partial differential equation is by
separation of variables, where we express the solution as the product of functions containing each variable separately.
In this case, we would write the temperature as
T(r, t) = R(r) f (t).
1. Substitute this form into Equation 4.13 and, noting that f (t) is constant with respect to distance (r) and
R(r) is constant with respect to time (t), show that

1 ∂ f = K ⎡∂ 2 R + 2 ∂ R ⎤.
f ∂t R⎣ ∂r2 r ∂r ⎦
2. This equation represents the separation of variables we want. The left-hand side is only a function of t and
the right-hand side is only a function of r, and they must be equal for all values of r and t. Therefore, they
both must be equal to a constant. Let’s call that constant −λ 2. (The convenience of this choice is seen on
substitution.) So, we have

1 ∂ f = −λ 2 K ⎡∂ 2 R + 2 ∂ R ⎤ = −λ 2.
R⎣ ∂r2 r ∂r ⎦
and
f ∂t

2
Now, we can verify through direct substitution for each equation that the solutions are f (t) = Ae −λ t and
⎛ ⎞ 2t
R(r) = B⎝sinrαr ⎠ + C⎛⎝ cosr αr ⎞⎠, where α = λ/ K. Note that f (t) = Ae +λn is also a valid solution, so we

could have chosen +λ 2 for our constant. Can you see why it would not be valid for this case as time increases?
3. Let’s now apply boundary conditions.
a. The temperature must be finite at the center of Earth, r = 0. Which of the two constants, B or C,
must therefore be zero to keep R finite at r = 0 ? (Recall that sin(αr)/r → α = as r → 0, but
cos(αr)/r behaves very differently.)
b. Kelvin argued that when magma reaches Earth’s surface, it cools very rapidly. A person can often touch
the surface within weeks of the flow. Therefore, the surface reached a moderate temperature very early
and remained nearly constant at a surface temperature T s. For simplicity, let’s set T = 0 at r = R E
and find α such that this is the temperature there for all time t. (Kelvin took the value to be
300 K ≈ 80°F. We can add this 300 K constant to our solution later.) For this to be true, the sine
argument must be zero at r = R E. Note that α has an infinite series of values that satisfies this
condition. Each value of α represents a valid solution (each with its own value for A). The total or
general solution is the sum of all these solutions.
c. At t = 0, we assume that all of Earth was at an initial hot temperature T 0 (Kelvin took this to be
about 7000 K.) The application of this boundary condition involves the more advanced application of
Fourier coefficients. As noted in part b. each value of α n represents a valid solution, and the general
solution is a sum of all these solutions. This results in a series solution:
⎛T R ⎞ (−1) n − 1 −λn 2 t sin(α n r)
T(r, t) = ⎝ 0π E ⎠∑ n e r , where α n = nπ/R E.
n

n−1
Note how the values of α n come from the boundary condition applied in part b. The term −1 n is the constant
A n for each term in the series, determined from applying the Fourier method. Letting β = π , examine the first
RE
few terms of this solution shown here and note how λ 2 in the exponential causes the higher terms to decrease quickly
as time progresses:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 385

⎛ −Kβ 2 t ⎛ 1 e −4Kβ t ⎛⎝sin 2βr⎞⎠ + 1 e −9Kβ t ⎛⎝sin 3βr⎞⎠⎞⎟


2 2


T R e ⎝sin βr ⎠ −
2 3
T(r, t) = 0πr E ⎜ ⎟.
⎜ 1 −16Kβ 2t
⎛ ⎞ 1 −25Kβ 2t
⎛ ⎞ ⎟
⎝ − e
4
⎝sin 4βr ⎠ +
5
e ⎝sin 5βr ⎠...

Near time t = 0, many terms of the solution are needed for accuracy. Inserting values for the conductivity K and
β = π/R E for time approaching merely thousands of years, only the first few terms make a significant contribution.
Kelvin only needed to look at the solution near Earth’s surface (Figure 4.26) and, after a long time, determine what
time best yielded the estimated temperature gradient known during his era (1°F increase per 50 ft). He simply chose
a range of times with a gradient close to this value. In Figure 4.26, the solutions are plotted and scaled, with the
300 − K surface temperature added. Note that the center of Earth would be relatively cool. At the time, it was thought
Earth must be solid.

Figure 4.26 Temperature versus radial distance from the center of Earth. (a) Kelvin’s results, plotted to scale. (b) A
close-up of the results at a depth of 4.0 mi below Earth’s surface.

Epilog
On May 20, 1904, physicist Ernest Rutherford spoke at the Royal Institution to announce a revised calculation that
included the contribution of radioactivity as a source of Earth’s heat. In Rutherford’s own words:
“I came into the room, which was half-dark, and presently spotted Lord Kelvin in the audience, and realised that I was
in for trouble at the last part of my speech dealing with the age of the Earth, where my views conflicted with his. To
my relief, Kelvin fell fast asleep, but as I came to the important point, I saw the old bird sit up, open an eye and cock a
baleful glance at me.
Then a sudden inspiration came, and I said Lord Kelvin had limited the age of the Earth, provided no new source [of
heat] was discovered. That prophetic utterance referred to what we are now considering tonight, radium! Behold! The
old boy beamed upon me.”
Rutherford calculated an age for Earth of about 500 million years. Today’s accepted value of Earth’s age is about 4.6
billion years.
386 Chapter 4 | Differentiation of Functions of Several Variables

4.3 EXERCISES
For the following exercises, calculate the partial derivative 125. Let z = tan(2x − y). Find ∂ z and ∂ z .
using the limit definitions only. ∂x ∂y

∂ z for z = x 2 − 3xy + y 2
112.
∂x 126. Let z = sinh⎛⎝2x + 3y⎞⎠. Find ∂ z and ∂ z .
∂x ∂y

113. ∂ z for z = x 2 − 3xy + y 2 ⎛y ⎞


∂y 127. Let f (x, y) = arctan⎝ x ⎠. Evaluate f x(2, −2) and
f y(2, −2).
For the following exercises, calculate the sign of the partial
derivative using the graph of the surface. xy
128. Let f (x, y) = x − y . Find f x(2, −2) and
f y(2, −2).

Evaluate the partial derivatives at point P(0, 1).

129. Find ∂ z at (0, 1) for z = e −x cos(y).


∂x

∂2 f
130. Given f (x, y, z) = x 3 yz 2, find and
∂ x∂ y

114. f x(1, 1) f z(1, 1, 1).

115. f x(−1, 1) 131. Given f (x, y, z) = 2 sin(x + y), find


⎛ ⎞ ⎛ ⎞ ⎛ ⎞
f x ⎝0, π , −4⎠, f y ⎝0, π , −4⎠, and f z ⎝0, π , −4⎠.
116. f y(1, 1) 2 2 2

132. The area of a parallelogram with adjacent side


117. f x(0, 0) lengths that are a and b, and in which the angle between
these two sides is θ, is given by the function
For the following exercises, calculate the partial
derivatives. A(a, b, θ) = ba sin(θ). Find the rate of change of the area
of the parallelogram with respect to the following:
118. ∂ z for z = sin(3x)cos(3y) a. Side a
∂x b. Side b
c. Angle θ
119. ∂ z for z = sin(3x)cos(3y)
∂y
133. Express the volume of a right circular cylinder as a
function of two variables:
∂ z and ∂ z for z = x e 8 3y
120.
∂x ∂y a. its radius r and its height h.
b. Show that the rate of change of the volume of the
∂ z and ∂ z for z = ln⎛x 6 + y 4⎞ cylinder with respect to its radius is the product of
121.
∂x ∂y ⎝ ⎠ its circumference multiplied by its height.
c. Show that the rate of change of the volume of the
xy cylinder with respect to its height is equal to the
122. Find f y(x, y) for f (x, y) = e cos(x)sin(y). area of the circular base.

123. Let z = e . Find ∂ z and ∂ z .


xy 134. Calculate ∂ w for w = z sin(xy 2 + 2z).
∂x ∂y ∂z

⎛ ⎞ Find the indicated higher-order partial derivatives.


124. Let z = ln⎝ xy ⎠. Find ∂ z and ∂ z .
∂x ∂y
135. f xy for z = ln(x − y)

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 387

136. f yx for z = ln(x − y) 150. Show that f (x, y) = ln⎛⎝x 2 + y 2⎞⎠ solves Laplace’s
2 2
2 2 equation ∂ z2 + ∂ z2 = 0.
137. Let z = x 2 + 3xy + 2y 2. Find ∂ z2 and ∂ z2 . ∂x ∂y
∂x ∂y

2 2 151. Show that z = e −t cos⎛⎝ cx ⎞⎠ satisfies the heat equation


138. Given z = e tan y, find ∂ z and ∂ z .
x
∂ x∂ y ∂ y∂ x ∂ z = −e −t cos⎛ x ⎞.
⎝c ⎠
∂t
139. Given f (x, y, z) = xyz, find f xyy, f yxy, and
f (x + Δx) − f (x, y)
f yyx. 152. Find lim for
Δx → 0 Δx
f (x, y) = −7x − 2xy + 7y.
140. Given f (x, y, z) = e −2x sin⎛⎝z 2 y⎞⎠, show that
f (x, y + Δy) − f (x, y)
f xyy = f yxy. 153. Find lim for
Δy → 0 Δy
f (x, y) = −7x − 2xy + 7y.
141. Show that z = 1 ⎛⎝e y − e ⎞⎠sin x is a solution of the
−y
2
2 2 Δf f (x + Δx, y) − f (x, y)
differential equation ∂ z2 + ∂ z2 = 0. 154. Find lim
Δx → 0 Δx
= lim
Δx → 0 Δx
∂x ∂y
for f (x, y) = x 2 y 2 + xy + y.
2 y2
142. Find f xx(x, y) for f (x, y) = 4xy + . Δf f (x + Δx, y) − f (x, y)
2x 155. Find lim = lim
Δx → 0 Δx Δx → 0 Δx
143. Let f (x, y, z) = x 2 y 3 z − 3xy 2 z 3 + 5x 2 z − y 3 z. for f (x, y) = sin(xy).

Find f xyz.
156. The function P(T, V) = nRT gives the pressure at
V
3 2 2 3 a point in a gas as a function of temperature T and volume
144. Let F(x, y, z) = x yz − 2x yz + 3xz − 2y z.
Find F xyz. V. The letters n and R are constants. Find ∂ P and ∂ P ,
∂V ∂T
and explain what these quantities represent.
145. Given f (x, y) = x 2 + x − 3xy + y 3 − 5, find all
points at which f x = f y = 0 simultaneously. 157. The equation for heat flow in the xy-plane is
∂f ∂2 f ∂2 f
= + . Show that
146. Given f (x, y) = 2x 2 + 2xy + y 2 + 2x − 3, find ∂t ∂ x2 ∂ y2
∂f ∂f f (x, y, t) = e −2t sin x sin y is a solution.
all points at which = 0 and = 0 simultaneously.
∂x ∂y
158. The basic wave equation is f tt = f xx. Verify that
147. Given f (x, y) = y 3 − 3yx 2 − 3y 2 − 3x 2 + 1, find f (x, t) = sin(x + t) and f (x, t) = sin(x − t) are
all points on f at which f x = f y = 0 simultaneously. solutions.

148. Given f (x, y) = 15x 3 − 3xy + 15y 3, find all 159. The law of cosines can be thought of as a function
of three variables. Let x, y, and θ be two sides of any
points at which f x(x, y) = f y(x, y) = 0 simultaneously.
triangle where the angle θ is the included angle between

149. Show that z = e x sin y satisfies the equation the two sides. Then, F(x, y, θ) = x 2 + y 2 − 2xy cos θ

∂ 2 z + ∂ 2 z = 0. gives the square of the third side of the triangle. Find ∂ F


∂θ
∂ x2 ∂ y2
and ∂ F when x = 2, y = 3, and θ = π .
∂x 6
388 Chapter 4 | Differentiation of Functions of Several Variables

160. Suppose the sides of a rectangle are changing with


respect to time. The first side is changing at a rate of 2
in./sec whereas the second side is changing at the rate of 4
in/sec. How fast is the diagonal of the rectangle changing
when the first side measures 16 in. and the second side
measures 20 in.? (Round answer to three decimal places.)

161. A Cobb-Douglas production function is


f (x, y) = 200x 0.7 y 0.3, where x and y represent the
amount of labor and capital available. Let x = 500 and
δf δf
y = 1000. Find and at these values, which
δx δy
represent the marginal productivity of labor and capital,
respectively.

162. The apparent temperature index is a measure of how


the temperature feels, and it is based on two variables:
h, which is relative humidity, and t, which is the air
temperature. A = 0.885t − 22.4h + 1.20th − 0.544. Find
∂ A and ∂ A when t = 20°F and h = 0.90.
∂t ∂h

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 389

4.4 | Tangent Planes and Linear Approximations


Learning Objectives
4.4.1 Determine the equation of a plane tangent to a given surface at a point.
4.4.2 Use the tangent plane to approximate a function of two variables at a point.
4.4.3 Explain when a function of two variables is differentiable.
4.4.4 Use the total differential to approximate the change in a function of two variables.

In this section, we consider the problem of finding the tangent plane to a surface, which is analogous to finding the equation
of a tangent line to a curve when the curve is defined by the graph of a function of one variable, y = f (x). The slope of the
tangent line at the point x = a is given by m = f ′(a); what is the slope of a tangent plane? We learned about the equation
of a plane in Equations of Lines and Planes in Space; in this section, we see how it can be applied to the problem at
hand.

Tangent Planes
Intuitively, it seems clear that, in a plane, only one line can be tangent to a curve at a point. However, in three-dimensional
space, many lines can be tangent to a given point. If these lines lie in the same plane, they determine the tangent plane at
that point. A tangent plane at a regular point contains all of the lines tangent to that point. A more intuitive way to think of
a tangent plane is to assume the surface is smooth at that point (no corners). Then, a tangent line to the surface at that point
in any direction does not have any abrupt changes in slope because the direction changes smoothly.

Definition
Let P 0 = (x 0, y 0, z 0) be a point on a surface S, and let C be any curve passing through P 0 and lying entirely in
S. If the tangent lines to all such curves C at P 0 lie in the same plane, then this plane is called the tangent plane to
S at P 0 (Figure 4.27).
390 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.27 The tangent plane to a surface S at a point P 0 contains all the tangent lines
to curves in S that pass through P 0.

For a tangent plane to a surface to exist at a point on that surface, it is sufficient for the function that defines the surface to
be differentiable at that point. We define the term tangent plane here and then explore the idea intuitively.

Definition
Let S be a surface defined by a differentiable function z = f (x, y), and let P 0 = (x 0, y 0) be a point in the domain
of f . Then, the equation of the tangent plane to S at P 0 is given by

z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0). (4.24)

To see why this formula is correct, let’s first find two tangent lines to the surface S. The equation of the tangent
line to the curve that is represented by the intersection of S with the vertical trace given by x = x 0 is
z = f (x 0, y 0) + f y (x 0, y 0)(y − y 0). Similarly, the equation of the tangent line to the curve that is represented by the
intersection of S with the vertical trace given by y = y 0 is z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0). A parallel vector to the
first tangent line is a = j + f y (x 0, y 0)k; a parallel vector to the second tangent line is b = i + f x (x 0, y 0)k. We can take
the cross product of these two vectors:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 391

a × b = ⎛⎝j + f y (x 0, y 0)k⎞⎠ × ⎛⎝i + f x (x 0, y 0)k⎞⎠

| |
i j k
= 0 1 f y (x 0, y 0)
1 0 f x (x 0, y 0)
= f x (x 0, y 0)i + f y (x 0, y 0)j − k.

This vector is perpendicular to both lines and is therefore perpendicular to the tangent plane. We can use this vector as a
normal vector to the tangent plane, along with the point P 0 = ⎛⎝x 0, y 0, f (x 0, y 0)⎞⎠ in the equation for a plane:

n · ⎛⎝(x − x 0)i + (y − y 0)j + ⎛⎝z − f (x 0, y 0)⎞⎠k⎞⎠ = 0



⎝ f x (x 0, y 0)i + f y (x 0, y 0)j-k⎞⎠ · ⎛⎝(x − x 0)i + (y − y 0)j + ⎛⎝z − f (x 0, y 0)⎞⎠k⎞⎠ = 0
f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0) − ⎛⎝z − f (x 0, y 0)⎞⎠ = 0.

Solving this equation for z gives Equation 4.24.

Example 4.21

Finding a Tangent Plane

Find the equation of the


tangent plane to the surface defined by the function
2 2
f (x, y) = 2x − 3xy + 8y + 2x − 4y + 4 at point (2, −1).

Solution
First, we must calculate f x (x, y) and f y (x, y), then use Equation 4.24 with x 0 = 2 and y 0 = −1:

f x (x, y) = 4x − 3y + 2
f y (x, y) = −3x + 16y − 4
f (2, −1) = 2(2) 2 − 3(2)(−1) + 8(−1) 2 + 2(2) − 4(−1) + 4 = 34.
f x (2, −1) = 4(2) − 3(−1) + 2 = 13
f y (2, −1) = −3(2) + 16(−1) − 4 = −26.

Then Equation 4.24 becomes


z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)
z = 34 + 13(x − 2) − 26⎛⎝y − (−1)⎞⎠
z = 34 + 13x − 26 − 26y − 26
z = 13x − 26y − 18.

(See the following figure).


392 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.28 Calculating the equation of a tangent plane to a given surface at a given point.

4.19 Find the equation of the tangent plane to the surface defined by the function
f (x, y) = x 3 − x 2 y + y 2 − 2x + 3y − 2 at point (−1, 3).

Example 4.22

Finding Another Tangent Plane

Find the equation of the tangent plane to the surface defined by the function f (x, y) = sin(2x)cos⎛⎝3y⎞⎠ at the point
(π/3, π/4).

Solution
First, calculate f x (x, y) and f y (x, y), then use Equation 4.24 with x 0 = π/3 and y 0 = π/4:

f x (x, y) = 2 cos(2x)cos⎛⎝3y⎞⎠
f y (x, y) = −3 sin(2x)sin⎛⎝3y⎞⎠
⎛ ⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎞⎛ ⎞
f ⎝π , π ⎠ = sin⎝2⎝π ⎠⎠cos⎝3⎝π ⎠⎠ = ⎝ 3 ⎠⎝− 2 ⎠ = − 6
3 4 3 4 2 2 4
⎛ ⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎞⎛ ⎞
f x ⎝π , π ⎠ = 2 cos⎝2⎝π ⎠⎠cos⎝3⎝π ⎠⎠ = 2⎝− 1 ⎠⎝− 2 ⎠ = 2
3 4 3 4 2 2 2
⎛ ⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞ ⎛ ⎞⎛ ⎞
f y ⎝π , π ⎠ = −3 sin⎝2⎝π ⎠⎠sin⎝3⎝π ⎠⎠ = −3⎝ 3 ⎠⎝ 2 ⎠ = − 3 6 .
3 4 3 4 2 2 4

Then Equation 4.24 becomes

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 393

z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)
⎛ ⎞ ⎛ ⎞
z = − 6 + 2 ⎝x − π ⎠ − 3 6 ⎝y − π ⎠
4 2 3 4 4
z = 2 x − 3 6 y − 6 − π 2 + 3π 6 .
2 4 4 6 16

A tangent plane to a surface does not always exist at every point on the surface. Consider the function
⎧ xy (x, y) ≠ (0, 0)
f (x, y) = ⎨ x 2 + y 2
⎩0 (x, y) = (0, 0).

The graph of this function follows.

Figure 4.29 Graph of a function that does not have a tangent plane at the
origin.

If either x = 0 or y = 0, then f (x, y) = 0, so the value of the function does not change on either the x- or y-axis.
Therefore, f x (x, 0) = f y ⎛⎝0, y⎞⎠ = 0, so as either x or y approach zero, these partial derivatives stay equal to zero.
Substituting them into Equation 4.24 gives z = 0 as the equation of the tangent line. However, if we approach the origin
from a different direction, we get a different story. For example, suppose we approach the origin along the line y = x. If
we put y = x into the original function, it becomes

x(x) 2
f (x, x) = = x = | x| .
2
x + (x) 2
2x 2 2

When x > 0, the slope of this curve is equal to 2/2; when x < 0, the slope of this curve is equal to −⎛⎝ 2/2⎞⎠. This
presents a problem. In the definition of tangent plane, we presumed that all tangent lines through point P (in this case, the
origin) lay in the same plane. This is clearly not the case here. When we study differentiable functions, we will see that this
function is not differentiable at the origin.

Linear Approximations
Recall from Linear Approximations and Differentials (http://cnx.org/content/m53605/latest/) that the formula
394 Chapter 4 | Differentiation of Functions of Several Variables

for the linear approximation of a function f (x) at the point x = a is given by

y ≈ f (a) + f ′(a)(x − a).

The diagram for the linear approximation of a function of one variable appears in the following graph.

Figure 4.30 Linear approximation of a function in one


variable.

The tangent line can be used as an approximation to the function f (x) for values of x reasonably close to x = a. When
working with a function of two variables, the tangent line is replaced by a tangent plane, but the approximation idea is much
the same.

Definition
Given a function z = f (x, y) with continuous partial derivatives that exist at the point (x 0, y 0), the linear
approximation of f at the point (x 0, y 0) is given by the equation

L(x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0). (4.25)

Notice that this equation also represents the tangent plane to the surface defined by z = f (x, y) at the point (x 0, y 0). The
idea behind using a linear approximation is that, if there is a point (x 0, y 0) at which the precise value of f (x, y) is known,
then for values of (x, y) reasonably close to (x 0, y 0), the linear approximation (i.e., tangent plane) yields a value that
is also reasonably close to the exact value of f (x, y) (Figure 4.31). Furthermore the plane that is used to find the linear
approximation is also the tangent plane to the surface at the point (x 0, y 0).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 395

Figure 4.31 Using a tangent plane for linear approximation at a point.

Example 4.23

Using a Tangent Plane Approximation

Given the function f (x, y) = 41 − 4x 2 − y 2, approximate f (2.1, 2.9) using point (2, 3) for (x 0, y 0).
What is the approximate value of f (2.1, 2.9) to four decimal places?

Solution
To apply Equation 4.25, we first must calculate f (x 0, y 0), f x (x 0, y 0), and f y (x 0, y 0) using x 0 = 2 and
y 0 = 3:

f (x 0, y 0) = f (2, 3) = 41 − 4(2) 2 − (3) 2 = 41 − 16 − 9 = 16 = 4


4x 4(2)
f x (x, y) = − so f x (x 0, y 0) = − = −2
2 2
41 − 4x − y 41 − 4(2) 2 − (3) 2
y 3
f y (x, y) = − so f y (x 0, y 0) = − = − 3.
2
41 − 4x − y 2 2
41 − 4(2) − (3) 2 4

Now we substitute these values into Equation 4.25:


396 Chapter 4 | Differentiation of Functions of Several Variables

L(x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)


= 4 − 2(x − 2) − 3 ⎛⎝y − 3⎞⎠
4
= 41 3
− 2x − y.
4 4
Last, we substitute x = 2.1 and y = 2.9 into L(x, y):

L(2.1, 2.9) = 41 − 2(2.1) − 3 (2.9) = 10.25 − 4.2 − 2.175 = 3.875.


4 4
The approximate value of f (2.1, 2.9) to four decimal places is

f (2.1, 2.9) = 41 − 4(2.1) 2 − (2.9) 2 = 14.95 ≈ 3.8665,

which corresponds to a 0.2% error in approximation.

4.20 5 − 2x + 3y
Given the function f (x, y) = e , approximate f (4.1, 0.9) using point (4, 1) for (x 0, y 0).
What is the approximate value of f (4.1, 0.9) to four decimal places?

Differentiability
When working with a function y = f (x) of one variable, the function is said to be differentiable at a point x = a if f ′ (a)
exists. Furthermore, if a function of one variable is differentiable at a point, the graph is “smooth” at that point (i.e., no
corners exist) and a tangent line is well-defined at that point.
The idea behind differentiability of a function of two variables is connected to the idea of smoothness at that point. In this
case, a surface is considered to be smooth at point P if a tangent plane to the surface exists at that point. If a function is
differentiable at a point, then a tangent plane to the surface exists at that point. Recall the formula for a tangent plane at a
point (x 0, y 0) is given by

z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0),

For a tangent plane to exist at the point (x 0, y 0), the partial derivatives must therefore exist at that point. However, this is
not a sufficient condition for smoothness, as was illustrated in Figure 4.29. In that case, the partial derivatives existed at
the origin, but the function also had a corner on the graph at the origin.

Definition
A function f (x, y) is differentiable at a point P(x 0, y 0) if, for all points (x, y) in a δ disk around P, we can
write
f (x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0) + E(x, y), (4.26)

where the error term E satisfies


E(x, y)
lim = 0.
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2

The last term in Equation 4.26 is referred to as the error term and it represents how closely the tangent plane comes to the
surface in a small neighborhood (δ disk) of point P. For the function f to be differentiable at P, the function must be
smooth—that is, the graph of f must be close to the tangent plane for points near P.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 397

Example 4.24

Demonstrating Differentiability

Show that the function f (x, y) = 2x 2 − 4y is differentiable at point (2, −3).

Solution
First, we calculate f (x 0, y 0), f x (x 0, y 0), and f y (x 0, y 0) using x 0 = 2 and y 0 = −3, then we use Equation
4.26:
f (2, −3) = 2(2) 2 − 4(−3) = 8 + 12 = 20
f x (2, −3) = 4(2) = 8
f y (2, −3) = −4.

Therefore m 1 = 8 and m 2 = −4, and Equation 4.26 becomes

f (x, y) = f (2, −3) + f x (2, −3)(x − 2) + f y (2, −3)⎛⎝y + 3⎞⎠ + E(x, y)


2x 2 − 4y = 20 + 8(x − 2) − 4⎛⎝y + 3⎞⎠ + E(x, y)
2x 2 − 4y = 20 + 8x − 16 − 4y − 12 + E(x, y)
2x 2 − 4y = 8x − 4y − 8 + E(x, y)
E(x, y) = 2x 2 − 8x + 8.

E(x, y)
Next, we calculate lim :
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2

lim
E(x, y)
= lim 2x 2 − 8x + 8
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2 (x, y) → (2, −3) (x − 2) 2 + ⎛⎝y + 3⎞⎠ 2

2⎛⎝x 2 − 4x + 4⎞⎠
= lim
(x, y) → (2, −3) (x − 2) 2 + ⎛⎝y + 3⎞⎠ 2
2(x − 2) 2
= lim
(x, y) → (2, −3) (x − 2) 2 + ⎛⎝y + 3⎞⎠ 2
2⎛⎝(x − 2) 2 + ⎛⎝y + 3⎞⎠ 2⎞⎠
≤ lim
(x, y) → (2, −3) (x − 2) 2 + ⎛⎝y + 3⎞⎠ 2
= lim 2 (x − 2) 2 + ⎛⎝y + 3⎞⎠ 2
(x, y) → (2, −3)
= 0.
Since E(x, y) ≥ 0 for any value of x or y, the original limit must be equal to zero. Therefore,
2
f (x, y) = 2x − 4y is differentiable at point (2, −3).

4.21 Show that the function f (x, y) = 3x − 4y 2 is differentiable at point (−1, 2).
398 Chapter 4 | Differentiation of Functions of Several Variables

⎧ xy (x, y) ≠ (0, 0)
The function f (x, y) = ⎨ x 2 + y 2 is not differentiable at the origin. We can see this by calculating
⎩0 (x, y) = (0, 0)
the partial derivatives. This function appeared earlier in the section, where we showed that f x (0, 0) = f y (0, 0) = 0.
Substituting this information into Equation 4.26 using x 0 = 0 and y 0 = 0, we get

f (x, y) = f (0, 0) + f x (0, 0)(x − 0) + f y (0, 0)⎛⎝y − 0⎞⎠ + E(x, y)


xy
E(x, y) = .
x2 + y2

E(x, y)
Calculating lim gives
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2
xy
E(x, y) x + y2
2
lim = lim
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2 (x, y) → (0, 0) x 2 + y 2

xy
= lim .
(x, y) → (0, 0) x 2 + y 2

Depending on the path taken toward the origin, this limit takes different values. Therefore, the limit does not exist and the
function f is not differentiable at the origin as shown in the following figure.

Figure 4.32 This function f (x, y) is not differentiable at the origin.

Differentiability and continuity for functions of two or more variables are connected, the same as for functions of one
variable. In fact, with some adjustments of notation, the basic theorem is the same.

Theorem 4.6: Differentiability Implies Continuity


Let z = f (x, y) be a function of two variables with (x 0, y 0) in the domain of f . If f (x, y) is differentiable at
(x 0, y 0), then f (x, y) is continuous at (x 0, y 0).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 399

Differentiability Implies Continuity shows that if a function is differentiable at a point, then it is continuous there.
However, if a function is continuous at a point, then it is not necessarily differentiable at that point. For example,
⎧ xy (x, y) ≠ (0, 0)
f (x, y) = ⎨ x 2 + y 2
⎩0 (x, y) = (0, 0)

is continuous at the origin, but it is not differentiable at the origin. This observation is also similar to the situation in single-
variable calculus.
Continuity of First Partials Implies Differentiability further explores the connection between continuity and
differentiability at a point. This theorem says that if the function and its partial derivatives are continuous at a point, the
function is differentiable.

Theorem 4.7: Continuity of First Partials Implies Differentiability


Let z = f (x, y) be a function of two variables with (x 0, y 0) in the domain of f . If f (x, y), f x (x, y), and
f y (x, y) all exist in a neighborhood of (x 0, y 0) and are continuous at (x 0, y 0), then f (x, y) is differentiable there.

Recall that earlier we showed that the function


⎧ xy (x, y) ≠ (0, 0)
f (x, y) = ⎨ x 2 + y 2
⎩0 (x, y) = (0, 0)

was not differentiable at the origin. Let’s calculate the partial derivatives f x and f y :

∂f y3 ∂f x3
= and = .
∂x ⎛ 2 ⎞
3/2 ∂y ⎛ 2
3/2
⎝x + y 2⎠ ⎝x + y 2⎞⎠

The contrapositive of the preceding theorem states that if a function is not differentiable, then at least one of the hypotheses
must be false. Let’s explore the condition that f x (0, 0) must be continuous. For this to be true, it must be true that
lim f x (0, 0) = f x (0, 0):
(x, y) → (0, 0)

y3
lim f x (x, y) = lim 3/2
.
(x, y) → (0, 0) (x, y) → (0, 0) ⎛ 2 2⎞
⎝x +y ⎠

Let x = ky. Then

y3 y3
lim 3/2
= lim 3/2
(x, y) → (0, 0) ⎛ 2
+ y 2⎞⎠
y → 0 ⎛⎛
⎝x ⎝⎝ky⎠
⎞ 2
+ y 2⎞⎠

y3
= lim 3/2
y → 0⎛ 2 2
⎝k y + y 2⎞⎠
y3
= lim 3/2
y→0 ⎛ ⎞
|y| 3 ⎝k 2 + 1⎠
y
= 1 lim | | .
3/2 y → 0 y
⎛ 2 ⎞
⎝k + 1⎠

3/2 ⎛ 3/2⎞
If y > 0, then this expression equals 1/⎛⎝k 2 + 1⎞⎠ ; if y < 0, then it equals − 1/⎛⎝k 2 + 1⎞⎠
⎝ ⎠. In either case, the value
400 Chapter 4 | Differentiation of Functions of Several Variables

depends on k, so the limit fails to exist.

Differentials
In Linear Approximations and Differentials (http://cnx.org/content/m53605/latest/) we first studied the concept
of differentials. The differential of y, written dy, is defined as f ′ (x)dx. The differential is used to approximate
Δy = f (x + Δx) − f (x), where Δx = dx. Extending this idea to the linear approximation of a function of two variables
at the point (x 0, y 0) yields the formula for the total differential for a function of two variables.

Definition
Let z = f (x, y) be a function of two variables with (x 0, y 0) in the domain of f , and let Δx and Δy be chosen so
that ⎛⎝x 0 + Δx, y 0 + Δy⎞⎠ is also in the domain of f . If f is differentiable at the point (x 0, y 0), then the differentials
dx and dy are defined as

dx = Δx and dy = Δy.

The differential dz, also called the total differential of z = f (x, y) at (x 0, y 0), is defined as

dz = f x (x 0, y 0)dx + f y (x 0, y 0)dy. (4.27)

Notice that the symbol ∂ is not used to denote the total differential; rather, d appears in front of z. Now, let’s define
Δz = f ⎛⎝x + Δx, y + Δy⎞⎠ − f (x, y). We use dz to approximate Δz, so

Δz ≈ dz = f x (x 0, y 0)dx + f y (x 0, y 0)dy.

Therefore, the differential is used to approximate the change in the function z = f (x 0, y 0) at the point (x 0, y 0) for
given values of Δx and Δy. Since Δz = f ⎛⎝x + Δx, y + Δy⎞⎠ − f (x, y), this can be used further to approximate
f ⎛⎝x + Δx, y + Δy⎞⎠:

f ⎛⎝x + Δx, y + Δy⎞⎠ = f (x, y) + Δz


≈ f (x, y) + f x (x 0, y 0)Δx + f y (x 0, y 0)Δy.

See the following figure.

Figure 4.33 The linear approximation is calculated via the


formula
f ⎛⎝x + Δx, y + Δy⎞⎠ ≈ f (x, y) + f x (x 0, y 0)Δx + f y (x 0, y 0)Δy.

One such application of this idea is to determine error propagation. For example, if we are manufacturing a gadget and are
off by a certain amount in measuring a given quantity, the differential can be used to estimate the error in the total volume

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 401

of the gadget.

Example 4.25

Approximation by Differentials

Find the differential dz of the function f (x, y) = 3x 2 − 2xy + y 2 and use it to approximate Δz at point
(2, −3). Use Δx = 0.1 and Δy = −0.05. What is the exact value of Δz ?

Solution
First, we must calculate f (x 0, y 0), f x (x 0, y 0), and f y (x 0, y 0) using x 0 = 2 and y 0 = −3:

f (x 0, y 0) = f (2, −3) = 3(2) 2 − 2(2)(−3) + (−3) 2 = 12 + 12 + 9 = 33


f x (x, y) = 6x − 2y
f y (x, y) = −2x + 2y
f x (x 0, y 0) = f x (2, −3) = 6(2) − 2(−3) = 12 + 6 = 18
f y (x 0, y 0) = f y (2, −3) = −2(2) + 2(−3) = −4 − 6 = −10.

Then, we substitute these quantities into Equation 4.27:


dz = f x (x 0, y 0)dx + f y (x 0, y 0)dy
dz = 18(0.1) − 10(−0.05) = 1.8 + 0.5 = 2.3.

This is the approximation to Δz = f ⎛⎝x 0 + Δx, y 0 + Δy⎞⎠ − f (x 0, y 0). The exact value of Δz is given by

Δz = f ⎛⎝x 0 + Δx, y 0 + Δy⎞⎠ − f (x 0, y 0)


= f (2 + 0.1, −3 − 0.05) − f (2, −3)
= f (2.1, −3.05) − f (2, −3)
= 2.3425.

4.22 Find the differential dz of the function f (x, y) = 4y 2 + x 2 y − 2xy and use it to approximate Δz at
point (1, −1). Use Δx = 0.03 and Δy = −0.02. What is the exact value of Δz ?

Differentiability of a Function of Three Variables


All of the preceding results for differentiability of functions of two variables can be generalized to functions of three
variables. First, the definition:

Definition
A function f (x, y, z) is differentiable at a point P(x 0, y 0, z 0) if for all points (x, y, z) in a δ disk around P we
can write
f (x, y) = f (x 0, y 0, z 0) + f x (x 0, y 0, z 0)(x − x 0) + f y (x 0, y 0, z 0)(y − y 0) (4.28)
+ f z (x 0, y 0, z 0)(z − z 0) + E(x, y, z),

where the error term E satisfies


402 Chapter 4 | Differentiation of Functions of Several Variables

E(x, y, z)
lim = 0.
(x, y, z) → (x 0, y 0, z 0) 2
(x − x 0) + (y − y 0) 2 + (z − z 0) 2

If a function of three variables is differentiable at a point (x 0, y 0, z 0), then it is continuous there. Furthermore, continuity
of first partial derivatives at that point guarantees differentiability.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 403

4.4 EXERCISES
For the following exercises, find a unit normal vector to the 181. z = x 2 − 2xy + y 2, P(1, 2, 1)
surface at the indicated point.
For the following exercises, find parametric equations for
163. f (x, y) = x 3, (2, −1, 8) the normal line to the surface at the indicated point. (Recall
that to find the equation of a line in space, you need a
⎛ ⎞
x = 0 when x = y = 1 point on the line, P 0 (x 0, y 0, z 0), and a vector
164. ln⎝ y − z⎠
n = 〈 a, b, c 〉 that is parallel to the line. Then the
For the following exercises, as a useful review for equation of the line is
techniques used in this section, find a normal vector and a x − x 0 = at, y − y 0 = bt, z − z 0 = ct.)
tangent vector at point P.
182. −3x + 9y + 4z = −4, P(1, −1, 2)
165. x 2 + xy + y 2 = 3, P(−1, −1)

2
183. z = 5x 2 − 2y 2, P(2, 1, 18)
⎛ 2 2⎞
166. ⎝x +y ⎠ = 9⎛⎝x 2 2⎞
− y ⎠, P( 2, 1)
184. x 2 − 8xyz + y 2 + 6z 2 = 0, P(1, 1, 1)
167. xy 2 − 2x 2 + y + 5x = 6, P(4, 2)
185. z = ln⎛⎝3x 2 + 7y 2 + 1⎞⎠, P(0, 0, 0)
168. 2x 3 − x 2 y 2 = 3x − y − 7, P(1, −2)
4x 2 + 6y 2
186. z = e , P(0, 0, 1)
x2 − y2
169. ze − 3 = 0, P(2, 2, 3)
187. z = x 2 − 2xy + y 2 at point P(1, 2, 1)
For the following exercises, find the equation for the
tangent plane to the surface at the indicated point. (Hint: For the following exercises, use the figure shown here.
Solve for z in terms of x and y.)

170. −8x − 3y − 7z = −19, P(1, −1, 2)

171. z = −9x 2 − 3y 2, P(2, 1, −39)

172. x 2 + 10xyz + y 2 + 8z 2 = 0, P(−1, −1, −1)

173. z = ln(10x 2 + 2y 2 + 1), P(0, 0, 0)

7x 2 + 4y 2
174. z = e , P(0, 0, 1)

175. xy + yz + zx = 11, P(1, 2, 3)

176. x 2 + 4y 2 = z 2, P(3, 2, 5)

⎛ ⎞
177. x 3 + y 3 = 3xyz, P⎝1, 2, 3 ⎠
2
188. The length of line segment AC is equal to what
178. z = axy, P⎛⎝1, 1 , 1⎞
a ⎠
mathematical expression?

189. The length of line segment BC is equal to what


179. z = sin x + sin y + sin(x + y), P(0, 0, 0) mathematical expression?

190. Using the figure, explain what the length of line


180. h(x, y) = ln x 2 + y 2, P(3, 4)
segment AB represents.
404 Chapter 4 | Differentiation of Functions of Several Variables

For the following exercises, complete each task. 200. The centripetal acceleration of a particle moving
2
xy in a circle is given by a(r, v) = vr , where v is the
191. Show that f (x, y) = e x is differentiable at point
(1, 0). velocity and r is the radius of the circle. Approximate
the maximum percent error in measuring the acceleration
192. Find the total differential of the function resulting from errors of 3% in v and 2% in r. (Recall
w = e y cos(x) + z 2. that the percentage error is the ratio of the amount of error
over the original amount. So, in this case, the percentage
error in a is given by da
a .)
193. Show that f (x, y) = x 2 + 3y is differentiable at
every point. In other words, show that
201. The radius r and height h of a right circular
Δz = f (x + Δx, y + Δy) − f (x, y) = f x Δx + f y Δy + ε 1 Δx + ε 2 Δy,
cylinder are measured with possible errors of 4% and 5%,

where both ε 1 and ε 2 approach zero as Δx, Δy⎞⎠

respectively. Approximate the maximum possible
approaches (0, 0). percentage error in measuring the volume (Recall that the
percentage error is the ratio of the amount of error over the
xy original amount. So, in this case, the percentage error in V
194. Find the total differential of the function z = y + x
is given by dV .)
where x changes from 10 to 10.5 and y changes from V
15 to 13.
202. The base radius and height of a right circular cone
y are measured as 10 in. and 25 in., respectively, with
195. Let z = f (x, y) = xe . Compute Δz from P(1, 2)
a possible error in measurement of as much as 0.1 in.
to Q(1.05, 2.1) and then find the approximate change
each. Use differentials to estimate the maximum error in the
in z from point P to point Q. Recall calculated volume of the cone.
Δz = f (x + Δx, y + Δy) − f (x, y), and dz and Δz are
203. The electrical resistance R produced by wiring
approximately equal.
resistors R 1 and R 2 in parallel can be calculated from the
196. The volume of a right circular cylinder is given by formula 1 = 1 + 1 . If R 1 and R 2 are measured to be
V(r, h) = πr 2 h. Find the differential dV. Interpret the R R1 R2
formula geometrically. 7Ω and 6Ω, respectively, and if these measurements are
accurate to within 0.05Ω, estimate the maximum possible
197. See the preceding problem. Use differentials to
error in computing R. (The symbol Ω represents an ohm,
estimate the amount of aluminum in an enclosed aluminum
can with diameter 8.0 cm and height 12 cm if the the unit of electrical resistance.)
aluminum is 0.04 cm thick. 204. The area of an ellipse with axes of length 2a and
2b is given by the formula A = πab. Approximate the
198. Use the differential dz to approximate the change in
percent change in the area when a increases by 2% and
z = 4 − x 2 − y 2 as (x, y) moves from point (1, 1) to b increases by 1.5%.
point (1.01, 0.97). Compare this approximation with the
actual change in the function. 205. The period T of a simple pendulum with small
oscillations is calculated from the formula T = 2π L
g,
199. Let z = f (x, y) = x 2 + 3xy − y 2. Find the exact
where L is the length of the pendulum and g is the
change in the function and the approximate change in the
function as x changes from 2.00 to 2.05 and y changes acceleration resulting from gravity. Suppose that L and g
from 3.00 to 2.96. have errors of, at most, 0.5% and 0.1%, respectively.
Use differentials to approximate the maximum percentage
error in the calculated value of T.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 405

2
206. Electrical power P is given by P = V , where
R
V is the voltage and R is the resistance. Approximate
the maximum percentage error in calculating power if 120
V is applied to a 2000 − Ω resistor and the possible
percent errors in measuring V and R are 3% and 4%,
respectively.

For the following exercises, find the linear approximation


of each function at the indicated point.

207. f (x, y) = x y, P(1, 4)

208. f (x, y) = e x cos y; P(0, 0)

209. f (x, y) = arctan(x + 2y), P(1, 0)

210. f (x, y) = 20 − x 2 − 7y 2, P(2, 1)

211. f (x, y, z) = x 2 + y 2 + z 2, P(3, 2, 6)

212. [T] Find the equation of the tangent plane to the


surface f (x, y) = x 2 + y 2 at point (1, 2, 5), and graph
the surface and the tangent plane at the point.

213. [T] Find the equation for the tangent plane to the
surface at the indicated point, and graph the surface and the
tangent plane: z = ln(10x 2 + 2y 2 + 1), P(0, 0, 0).

214. [T] Find the equation of the tangent plane to the


⎛ ⎞
surface z = f (x, y) = sin(x + y 2) at point ⎝π , 0, 2 ⎠,
4 2
and graph the surface and the tangent plane.
406 Chapter 4 | Differentiation of Functions of Several Variables

4.5 | The Chain Rule


Learning Objectives
4.5.1 State the chain rules for one or two independent variables.
4.5.2 Use tree diagrams as an aid to understanding the chain rule for several independent and
intermediate variables.
4.5.3 Perform implicit differentiation of a function of two or more variables.

In single-variable calculus, we found that one of the most useful differentiation rules is the chain rule, which allows us to
find the derivative of the composition of two functions. The same thing is true for multivariable calculus, but this time we
have to deal with more than one form of the chain rule. In this section, we study extensions of the chain rule and learn how
to take derivatives of compositions of functions of more than one variable.

Chain Rules for One or Two Independent Variables


Recall that the chain rule for the derivative of a composite of two functions can be written in the form
d ⎛⎝ f ⎛⎝g(x)⎞⎠⎞⎠ = f ′⎛⎝g(x)⎞⎠g′(x).
dx
In this equation, both f (x) and g(x) are functions of one variable. Now suppose that f is a function of two variables and
g is a function of one variable. Or perhaps they are both functions of two variables, or even more. How would we calculate
the derivative in these cases? The following theorem gives us the answer for the case of one independent variable.

Theorem 4.8: Chain Rule for One Independent Variable


Suppose that x = g(t) and y = h(t) are differentiable functions of t and z = f (x, y) is a differentiable function of
x and y. Then z = f ⎛⎝x(t), y(t)⎞⎠ is a differentiable function of t and

dz = ∂ z · dx + ∂ z · dy , (4.29)
dt ∂ x dt ∂ y dt
where the ordinary derivatives are evaluated at t and the partial derivatives are evaluated at (x, y).

Proof
The proof of this theorem uses the definition of differentiability of a function of two variables. Suppose that f is
differentiable at the point P(x 0, y 0), where x 0 = g(t 0) and y 0 = h(t 0) for a fixed value of t 0. We wish to prove that
z = f ⎛⎝x(t), y(t)⎞⎠ is differentiable at t = t 0 and that Equation 4.29 holds at that point as well.

Since f is differentiable at P, we know that

z(t) = f (x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0) + E(x, y), (4.30)

E(x, y)
where lim = 0. We then subtract z 0 = f (x 0, y 0) from both sides of this equation:
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2

z(t) − z(t 0) = f ⎛⎝x(t), y(t)⎞⎠ − f ⎛⎝x(t 0), y(t 0)⎞⎠


= f x (x 0, y 0)⎛⎝x(t) − x(t 0)⎞⎠ + f y (x 0, y 0)⎛⎝y(t) − y(t 0)⎞⎠ + E⎛⎝x(t), y(t)⎞⎠.

Next, we divide both sides by t − t 0 :

z(t) − z(t 0) ⎛x(t) − x(t 0) ⎞ ⎛y(t) − y(t 0) ⎞ E⎛⎝x(t), y(t)⎞⎠


t − t 0 = f x (x 0, y 0)⎝ t − t 0 ⎠ + f y (x 0, y 0)⎝ t − t 0 ⎠ + t − t 0 .

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 407

Then we take the limit as t approaches t 0 :

z(t) − z(t 0) ⎛x(t) − x(t ) ⎞ ⎛y(t) − y(t ) ⎞


lim t − t0 = f x (x 0, y 0) lim ⎝ t − t 0 ⎠ + f y (x 0, y 0) lim ⎝ t − t 0 ⎠
t → t0 t → t0 0 t → t 0 0

E⎛⎝x(t), y(t)⎞⎠
+ lim t − t0 .
t → t0

The left-hand side of this equation is equal to dz/dt, which leads to


⎛ ⎞
dz = f (x , y ) dx + f (x , y ) dy + lim E⎝x(t), y(t)⎠ .
x 0 0 y 0 0
dt dt dt t → t 0 t − t 0

The last term can be rewritten as


⎛ (x − x 0) 2 + (y − y 0) 2 ⎞
= lim ⎜ ⎟
E⎛⎝x(t), y(t)⎞⎠ E(x, y)
lim
⎝ (x − x 0) 2 + (y − y 0) 2 ⎠
t → t0 t − t0 t → t0 t − t0

⎛ ⎞ ⎛ (x − x ) 2 + (y − y ) 2 ⎞
= lim ⎜ ⎟ lim ⎜ 0 ⎟.
E(x, y) 0
⎝ (x − x 0) 2 + (y − y 0) 2 ⎠t → t 0⎝ ⎠
t → t0 t − t0

As t approaches t 0, x(t), y(t)⎞⎠ approaches ⎛⎝x(t 0), y(t 0)⎞⎠, so we can rewrite the last product as

⎛ ⎞ ⎛ (x − x ) 2 + (y − y ) 2 ⎞
lim ⎜ E(x, y)
⎟ lim ⎜ 0 0 ⎟.
(x, y) → (x 0, y 0)⎝ (x − x ) 2 + (y − y ) 2 ⎠(x, y) → (x 0, y 0)⎝ t − t0 ⎠
0 0

Since the first limit is equal to zero, we need only show that the second limit is finite:
⎛ (x − x ) 2 + (y − y ) 2 ⎞ ⎛ (x − x ) 2 + (y − y ) 2 ⎞
lim ⎜ 0 0 ⎟ = lim ⎜ 0 0 ⎟
(x, y) → (x 0, y 0)⎝ t − t 0 ⎠ (x, y) → (x 0 0⎝
, y ) (t − t ) 2

0

⎛ x−x 2 y − y 2⎞
= lim ⎜ ⎛⎝ t − t 0 ⎞⎠ + ⎛⎝ t − t 0 ⎞⎠ ⎟
(x, y) → (x 0, y 0)⎝ 0 0 ⎠

⎛ ⎛ x − x 0 ⎞⎞ ⎛ ⎛ y − y 0 ⎞⎞
2 2
=
⎝(x, y) →lim(x 0, y 0)⎝ t − t 0 ⎠⎠ + ⎝(x, y) →lim(x 0, y 0)⎝ t − t 0 ⎠⎠ .
Since x(t) and y(t) are both differentiable functions of t, both limits inside the last radical exist. Therefore, this value
is finite. This proves the chain rule at t = t 0; the rest of the theorem follows from the assumption that all functions are
differentiable over their entire domains.

∂ f dx
Closer examination of Equation 4.29 reveals an interesting pattern. The first term in the equation is · and the
∂ x dt
∂ f dy
second term is · . Recall that when multiplying fractions, cancelation can be used. If we treat these derivatives
∂ y dt
as fractions, then each product “simplifies” to something resembling ∂ f /dt. The variables x and y that disappear in
this simplification are often called intermediate variables: they are independent variables for the function f , but are
dependent variables for the variable t. Two terms appear on the right-hand side of the formula, and f is a function of two
variables. This pattern works with functions of more than two variables as well, as we see later in this section.

Example 4.26
408 Chapter 4 | Differentiation of Functions of Several Variables

Using the Chain Rule

Calculate dz/dt for each of the following functions:

a. z = f (x, y) = 4x 2 + 3y 2, x = x(t) = sin t, y = y(t) = cos t

b. z = f (x, y) = x 2 − y 2, x = x(t) = e 2t, y = y(t) = e −t

Solution
a. To use the chain rule, we need four quantities— ∂ z/∂ x, ∂ z/∂ y, dx/dt, and dy/dt:

∂ z = 8x ∂ z = 6y
∂x ∂y
dx = cos t dy
= −sin t
dt dt

Now, we substitute each of these into Equation 4.29:


dz = ∂ z · dx + ∂ z · dy
dt ∂ x dt ∂ y dt
= (8x)(cos t) + ⎛⎝6y⎞⎠(−sin t)
= 8x cos t − 6y sin t.

This answer has three variables in it. To reduce it to one variable, use the fact that
x(t) = sin t and y(t) = cos t. We obtain

dz = 8x cos t − 6y sin t
dt
= 8(sin t)cos t − 6(cos t)sin t
= 2 sin t cos t.

This derivative can also be calculated by first substituting x(t) and y(t) into f (x, y), then
differentiating with respect to t:
z = f (x, y)
= f ⎛⎝x(t), y(t)⎞⎠
= 4(x(t)) 2 + 3⎛⎝y(t)⎞⎠ 2
= 4sin 2 t + 3cos 2 t.

Then
dz = 2(4 sin t)(cos t) + 2(3 cos t)(−sin t)
dt
= 8 sin t cos t − 6 sin t cos t
= 2 sin t cos t,

which is the same solution. However, it may not always be this easy to differentiate in this form.
b. To use the chain rule, we again need four quantities— ∂ z/∂ x, ∂ z/dy, dx/dt, and dy/dt:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 409

∂z = x ∂z = −y
∂x x − y2
2 ∂y x − y2
2

dx = 2e 2t dx = −e −t.
dt dt

We substitute each of these into Equation 4.29:


dz = ∂ z · dx + ∂ z · dy
dt ∂ x dt ∂ y dt
⎛ ⎞ ⎛ ⎞
=⎜ x ⎟⎛⎝2e 2t⎞⎠ + ⎜ −y ⎟⎛⎝−e −t⎞⎠
⎝ x2 − y2⎠ ⎝ x2 − y2⎠
2xe 2t − ye −t
= .
x2 − y2

To reduce this to one variable, we use the fact that x(t) = e 2t and y(t) = e −t. Therefore,
2t −t
dz = 2xe + ye
dt x2 − y2
2⎛⎝e 2t⎞⎠e 2t + ⎛⎝e −t⎞⎠e −t
=
e 4t − e −2t
4t −2t
= 2e + e .
4t −2t
e −e

To eliminate negative exponents, we multiply the top by e 2t and the bottom by e 4t:

dz = 2e 4t + e −2t · e 2t
dt e 4t − e −2t e 4t
6t
= 2e + 1
e 8t − e 2t
6t
= 2e + 1
e ⎝e − 1⎞⎠
2t ⎛ 6t

6t
= 2e + 1 .
e t e 6t − 1

Again, this derivative can also be calculated by first substituting x(t) and y(t) into f (x, y), then
differentiating with respect to t:
z = f (x, y)
= f ⎛⎝x(t), y(t)⎞⎠
= (x(t)) 2 − ⎛⎝y(t)⎞⎠ 2
= e 4t − e −2t
1/2
= ⎛⎝e 4t − e −2t⎞⎠ .

Then
410 Chapter 4 | Differentiation of Functions of Several Variables

dz = 1 ⎛e 4t − e −2t⎞−1/2 ⎛4e 4t + 2e −2t⎞


dt 2⎝ ⎠ ⎝ ⎠
4t −2t
= 2e + e .
e 4t − e −2t

This is the same solution.

4.23 Calculate dz/dt given the following functions. Express the final answer in terms of t.

z = f (x, y) = x 2 − 3xy + 2y 2, x = x(t) = 3 sin 2t, y = y(t) = 4 cos 2t

It is often useful to create a visual representation of Equation 4.29 for the chain rule. This is called a tree diagram for the
chain rule for functions of one variable and it provides a way to remember the formula (Figure 4.34). This diagram can be
expanded for functions of more than one variable, as we shall see very shortly.

Figure 4.34 Tree diagram for the case


dz = ∂ z · dx + ∂ z · dy .
dt ∂ x dt ∂ y dt

In this diagram, the leftmost corner corresponds to z = f (x, y). Since f has two independent variables, there are two lines
coming from this corner. The upper branch corresponds to the variable x and the lower branch corresponds to the variable
y. Since each of these variables is then dependent on one variable t, one branch then comes from x and one branch
comes from y. Last, each of the branches on the far right has a label that represents the path traveled to reach that branch.
The top branch is reached by following the x branch, then the t branch; therefore, it is labeled (∂ z/∂ x) × (dx/dt). The
bottom branch is similar: first the y branch, then the t branch. This branch is labeled ⎛⎝∂ z/∂ y⎞⎠ × ⎛⎝dy/dt⎞⎠. To get the formula
for dz/dt, add all the terms that appear on the rightmost side of the diagram. This gives us Equation 4.29.

In Chain Rule for Two Independent Variables, z = f (x, y) is a function of x and y, and both x = g(u, v) and
y = h(u, v) are functions of the independent variables u and v.

Theorem 4.9: Chain Rule for Two Independent Variables


Suppose x = g(u, v) and y = h(u, v) are differentiable functions of u and v, and z = f (x, y) is a differentiable
function of x and y. Then, z = f ⎛⎝g(u, v), h(u, v)⎞⎠ is a differentiable function of u and v, and

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 411

∂z = ∂z ∂x + ∂z ∂x (4.31)
∂u ∂x ∂u ∂y ∂u

and
∂ z = ∂ z ∂ x + ∂ z ∂ y. (4.32)
∂v ∂x ∂v ∂y ∂v

We can draw a tree diagram for each of these formulas as well as follows.

∂y
Figure 4.35 Tree diagram for ∂ z = ∂ z · ∂ x + ∂ z · and
∂u ∂x ∂u ∂y ∂u
∂ z = ∂ z · ∂ x + ∂ z · ∂ y.
∂v ∂x ∂v ∂y ∂v

To derive the formula for ∂ z/∂ u, start from the left side of the diagram, then follow only the branches that end with u
and add the terms that appear at the end of those branches. For the formula for ∂ z/∂ v, follow only the branches that end
with v and add the terms that appear at the end of those branches.
There is an important difference between these two chain rule theorems. In Chain Rule for One Independent Variable,
the left-hand side of the formula for the derivative is not a partial derivative, but in Chain Rule for Two Independent
Variables it is. The reason is that, in Chain Rule for One Independent Variable, z is ultimately a function of t
alone, whereas in Chain Rule for Two Independent Variables, z is a function of both u and v.

Example 4.27

Using the Chain Rule for Two Variables

Calculate ∂ z/∂ u and ∂ z/∂ v using the following functions:

z = f (x, y) = 3x 2 − 2xy + y 2, x = x(u, v) = 3u + 2v, y = y(u, v) = 4u − v.

Solution
To implement the chain rule for two variables, we need six partial derivatives—
∂ z/∂ x, ∂ z/∂ y, ∂ x/∂ u, ∂ x/∂ v, ∂ y/∂ u, and ∂ y/∂ v:
412 Chapter 4 | Differentiation of Functions of Several Variables

∂ z = 6x − 2y ∂ z = −2x + 2y
∂x ∂y
∂x = 3 ∂x = 2
∂u ∂v
∂y ∂y
=4 = −1.
∂u ∂v
To find ∂ z/∂ u, we use Equation 4.31:

∂z = ∂z · ∂x + ∂z · ∂y
∂u ∂x ∂u ∂y ∂u
= 3⎛⎝6x − 2y⎞⎠ + 4⎛⎝−2x + 2y⎞⎠
= 10x + 2y.

Next, we substitute x(u, v) = 3u + 2v and y(u, v) = 4u − v:

∂ z = 10x + 2y
∂u
= 10(3u + 2v) + 2(4u − v)
= 38u + 18v.
To find ∂ z/∂ v, we use Equation 4.32:

∂z = ∂z ∂x + ∂z ∂y
∂v ∂x ∂v ∂y ∂v
= 2⎛⎝6x − 2y⎞⎠ + (−1)⎛⎝−2x + 2y⎞⎠
= 14x − 6y.

Then we substitute x(u, v) = 3u + 2v and y(u, v) = 4u − v:

∂ z = 14x − 6y
∂v
= 14(3u + 2v) − 6(4u − v)
= 18u + 34v.

4.24 Calculate ∂ z/∂ u and ∂ z/∂ v given the following functions:


2x − y
z = f (x, y) = , x(u, v) = e 2u cos 3v, y(u, v) = e 2u sin 3v.
x + 3y

The Generalized Chain Rule


Now that we’ve see how to extend the original chain rule to functions of two variables, it is natural to ask: Can we extend
the rule to more than two variables? The answer is yes, as the generalized chain rule states.

Theorem 4.10: Generalized Chain Rule


Let w = f (x 1, x 2 ,…, x m) be a differentiable function of m independent variables, and for each i ∈ {1,…, m}, let
x i = x i(t 1, t 2 ,…, t n) be a differentiable function of n independent variables. Then

∂ w = ∂ w ∂ x1 + ∂ w ∂ x2 + ⋯ + ∂ w ∂ xm (4.33)
∂ t j ∂ x1 ∂ t j ∂ x2 ∂ t j ∂ xm ∂ t j

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 413

for any j ∈ 1, 2,…, n .


⎧ ⎫
⎨ ⎬
⎩ ⎭

In the next example we calculate the derivative of a function of three independent variables in which each of the three
variables is dependent on two other variables.

Example 4.28

Using the Generalized Chain Rule

Calculate ∂ w/∂ u and ∂ w/∂ v using the following functions:

w = f (x, y, z) = 3x 2 − 2xy + 4z 2
x = x(u, v) = e u sin v
y = y(u, v) = e u cos v
z = z(u, v) = e u.

Solution
The formulas for ∂ w/∂ u and ∂ w/∂ v are
∂w = ∂w · ∂x + ∂w · ∂y + ∂w · ∂z
∂u ∂x ∂u ∂y ∂u ∂z ∂u
∂w = ∂w · ∂ x + ∂w · ∂ y + ∂w · ∂z.
∂v ∂x ∂v ∂y ∂v ∂z ∂v

Therefore, there are nine different partial derivatives that need to be calculated and substituted. We need to
calculate each of them:
∂ w = 6x − 2y ∂ w = −2x ∂ w = 8z
∂x ∂y ∂z
∂ x = e u sin v ∂y ∂ z = eu
= e u cos v
∂u ∂u ∂u
∂ x = e u cos v ∂y ∂ z = 0.
= −e u sin v
∂v ∂v ∂v
Now, we substitute each of them into the first formula to calculate ∂ w/∂ u:

∂w = ∂w · ∂x + ∂w · ∂y + ∂w · ∂z
∂u ∂x ∂u ∂y ∂u ∂z ∂u
= ⎝6x − 2y⎞⎠e u sin v − 2xe u cos v + 8ze u,

then substitute x(u, v) = e u sin v, y(u, v) = e u cos v, and z(u, v) = e u into this equation:

∂ w = ⎛⎝6x − 2y⎞⎠e u sin v − 2xe u cos v + 8ze u


∂u
= (6e u sin v − 2e u cos v)e u sin v − 2(e u sin v)e u cos v + 8e 2u
= 6e 2u sin 2 v − 4e 2u sin v cos v + 8e 2u
= 2e 2u ⎛⎝3 sin 2 v − 2 sin v cos v + 4⎞⎠.

Next, we calculate ∂ w/∂ v:


414 Chapter 4 | Differentiation of Functions of Several Variables

∂w = ∂w · ∂x + ∂w · ∂y + ∂w · ∂z
∂v ∂x ∂v ∂y ∂v ∂z ∂v
= ⎝6x − 2y⎞⎠e u cos v − 2x(−e u sin v) + 8z(0),

then we substitute x(u, v) = e u sin v, y(u, v) = e u cos v, and z(u, v) = e u into this equation:

∂ w = ⎛⎝6x − 2y⎞⎠e u cos v − 2x(−e u sin v)


∂v
= (6e u sin v − 2e u cos v)e u cos v + 2(e u sin v)(e u sin v)
= 2e 2u sin 2 v + 6e 2u sin v cos v − 2e 2u cos 2 v
= 2e 2u ⎛⎝sin 2 v + sin v cos v − cos 2 v⎞⎠.

4.25 Calculate ∂ w/∂ u and ∂ w/∂ v given the following functions:

x + 2y − 4z
w = f (x, y, z) =
2x − y + 3z
x = x(u, v) = e 2u cos 3v
y = y(u, v) = e 2u sin 3v
z = z(u, v) = e 2u.

Example 4.29

Drawing a Tree Diagram

Create a tree diagram for the case when


w = f (x, y, z), x = x(t, u, v), y = y(t, u, v), z = z(t, u, v)

and write out the formulas for the three partial derivatives of w.

Solution
Starting from the left, the function f has three independent variables: x, y, and z. Therefore, three branches
must be emanating from the first node. Each of these three branches also has three branches, for each of the
variables t, u, and v.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 415

Figure 4.36 Tree diagram for a function of three variables, each of which is
a function of three independent variables.

The three formulas are


∂w = ∂w ∂x + ∂w ∂y + ∂w ∂z
∂t ∂x ∂t ∂y ∂t ∂z ∂t
∂ y
∂w = ∂w ∂x + ∂w + ∂w ∂z
∂u ∂x ∂u ∂y ∂u ∂z ∂u
∂w = ∂w ∂ x + ∂w ∂ y + ∂w ∂z.
∂v ∂x ∂v ∂y ∂v ∂z ∂v

4.26 Create a tree diagram for the case when


w = f (x, y), x = x(t, u, v), y = y(t, u, v)

and write out the formulas for the three partial derivatives of w.

Implicit Differentiation
Recall from Implicit Differentiation (http://cnx.org/content/m53585/latest/) that implicit differentiation provides a
method for finding dy/dx when y is defined implicitly as a function of x. The method involves differentiating both sides
of the equation defining the function with respect to x, then solving for dy/dx. Partial derivatives provide an alternative
to this method.
Consider the ellipse defined by the equation x 2 + 3y 2 + 4y − 4 = 0 as follows.
416 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.37 Graph of the ellipse defined by


x 2 + 3y 2 + 4y − 4 = 0.

This equation implicitly defines y as a function of x. As such, we can find the derivative dy/dx using the method of
implicit differentiation:
d ⎛x 2 + 3y 2 + 4y − 4⎞ = d (0)
dx ⎝ ⎠
dx
dy dy
2x + 6y + 4 = 0
dx dx
⎛ ⎞ dy
⎝6y + 4⎠ = −2x
dx
dy
= − x .
dx 3y + 2

We can also define a function z = f (x, y) by using the left-hand side of the equation defining the ellipse. Then
f (x, y) = x 2 + 3y 2 + 4y − 4. The ellipse x 2 + 3y 2 + 4y − 4 = 0 can then be described by the equation f (x, y) = 0.
Using this function and the following theorem gives us an alternative approach to calculating dy/dx.

Theorem 4.11: Implicit Differentiation of a Function of Two or More Variables


Suppose the function z = f (x, y) defines y implicitly as a function y = g(x) of x via the equation f (x, y) = 0.
Then
dy ∂ f /∂ x (4.34)
= −
dx ∂ f /∂ y

provided f y (x, y) ≠ 0.

If the equation f (x, y, z) = 0 defines z implicitly as a differentiable function of x and y, then

∂z = − ∂ f /∂ x and ∂z = − ∂ f /∂ y (4.35)
∂x ∂ f /∂ z ∂y ∂ f /∂ z

as long as f z (x, y, z) ≠ 0.

Equation 4.34 is a direct consequence of Equation 4.31. In particular, if we assume that y is defined implicitly as a
function of x via the equation f (x, y) = 0, we can apply the chain rule to find dy/dx:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 417

d f (x, y) = d (0)
dx dx
∂ f dx ∂ f dy
· + · = 0
∂ x dx ∂ y dx
∂ f ∂ f dy
+ · = 0.
∂ x ∂ y dx

Solving this equation for dy/dx gives Equation 4.34. Equation 4.35 can be derived in a similar fashion.

Let’s now return to the problem that we started before the previous theorem. Using Implicit Differentiation of a
Function of Two or More Variables and the function f (x, y) = x 2 + 3y 2 + 4y − 4, we obtain

∂f
= 2x
∂x
∂f
= 6y + 4.
∂y

Then Equation 4.34 gives


dy ∂ f /∂ x
= − = − 2x = − x ,
dx ∂ f /∂ y 6y + 4 3y + 2

which is the same result obtained by the earlier use of implicit differentiation.

Example 4.30

Implicit Differentiation by Partial Derivatives

a. Calculate dy/dx if y is defined implicitly as a function of x via the equation


3x 2 − 2xy + y 2 + 4x − 6y − 11 = 0. What is the equation of the tangent line to the graph of this curve
at point (2, 1) ?

b. Calculate ∂ z/∂ x and ∂ z/∂ y, given x 2 e y − yze x = 0.

Solution
f x = 6x − 2y + 4
a. Set f (x, y) = 3x 2 − 2xy + y 2 + 4x − 6y − 11 = 0, then calculate f x and f y :
f y = −2x + 2y − 6.
The derivative is given by
dy ∂ f /∂ x 6x − 2y + 4 3x − y + 2
= − = − = .
dx ∂ f /∂ y −2x + 2y − 6 x−y+3

The slope of the tangent line at point (2, 1) is given by

dy
dx | (x, y) = (2, 1) =
3(2) − 1 + 2 7
2−1+3
= .
4

To find the equation of the tangent line, we use the point-slope form (Figure 4.38):
y − y 0 = m(x − x 0)
y − 1 = 7 (x − 2)
4
y = 7x − 7 + 1
4 2
y = x − 5.
7
4 2
418 Chapter 4 | Differentiation of Functions of Several Variables

Figure 4.38 Graph of the rotated ellipse defined by


3x 2 − 2xy + y 2 + 4x − 6y − 11 = 0.

b. We have f (x, y, z) = x 2 e y − yze x. Therefore,

∂f
= 2xe y − yze x
∂x
∂f
= x 2 e y − ze x
∂y
∂f
= −ye x.
∂z

Using Equation 4.35,


∂ z = − ∂ f /∂ x ∂ z = − ∂ f /∂ y
∂x ∂ f /∂ y ∂y ∂ f /∂ z
2xe y − yze x 2 y x
= − and = − x e −xze
−ye x −ye
2xe y − yze x 2 y x
= = x e −x ze .
ye x ye

4.27 Find dy/dx if y is defined implicitly as a function of x by the equation


2 2
x + xy − y + 7x − 3y − 26 = 0. What is the equation of the tangent line to the graph of this curve at point
(3, −2) ?

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 419

4.5 EXERCISES
For the following exercises, use the information provided 228. Let z = x 2 y, where x = t 2 and y = t 3. Find dz .
to solve the problem. dt

215. Let w(x, y, z) = xy cos z, where x = t, y = t 2,


229. Let u = e x sin y, where x = t 2 and y = πt. Find
and z = arcsin t. Find dw .
dt du when x = ln 2 and y = π .
dt 4
216. Let w(t, v) = e tv where t = r + s and v = rs.
dy
Find ∂ w and ∂ w . For the following exercises, find
dx
using partial
∂r ∂s
derivatives.
2 2
217. If w = 5x + 2y , x = −3s + t, and y = s − 4t,
230. sin(6x) + tan⎛⎝8y⎞⎠ + 5 = 0
find ∂ w and ∂ w .
∂s ∂t
231. x 3 + y 2 x − 3 = 0
218. If w = xy 2, x = 5 cos(2t), and y = 5 sin(2t),
232. sin(x + y) + cos(x − y) = 4
find ∂ w .
∂t
233. x 2 − 2xy + y 4 = 4
219. If f (x, y) = xy, x = r cos θ, and y = r sin θ,

find
∂f
and express the answer in terms of r and θ. 234. xe y + ye x − 2x 2 y = 0
∂r
235. x 2/3 + y 2/3 = a 2/3
220. Suppose f (x, y) = x + y, u = e x sin y, x = t 2,
and y = πt, where x = r cos θ and y = r sin θ. Find 236. x cos(xy) + y cos x = 2
∂f
. xy
∂θ 237. e + ye y = 1

df
For the following exercises, find using the chain rule 238. x 2 y 3 + cos y = 0
dt
and direct substitution.
239. Find dz using the chain rule where
dt
221. f (x, y) = x 2 + y 2, x = t, y = t 2
z = 3x 2 y 3, x = t 4, and y = t 2.
222. f (x, y) = x 2 + y 2, y = t 2, x = t
240. Let z = 3 cos x − sin(xy), x = 1t , and y = 3t.
f (x, y) = xy, x = 1 − t, y = 1 + t
Find dz .
223.
dt
224. f (x, y) = xy , x = e t, y = 2e t
, x = t 1/3, and y = t 3. Find dz .
1 − xy
241. Let z = e
dt
225. f (x, y) = ln(x + y), x = e t, y = e t
242. Find dz by the chain rule where
4 dt
226. f (x, y) = x , x = t, y = t
z = cosh 2(xy), x = 1 t, and y = e t.
2
227. Let w(x, y, z) = x 2 + y 2 + z 2,
x = cos t, y = sin t, and z = e t. Express w as a 243. Let z = xy , x = 2 cos u, and y = 3 sin v. Find ∂ z
∂u
function of t and find dw directly. Then, find dw using and ∂ z .
dt dt ∂v
the chain rule.
420 Chapter 4 | Differentiation of Functions of Several Variables

x2 y 253. The radius of a right circular cone is increasing at 3


244. Let z = e , where x = uv and y = 1v . Find
cm/min whereas the height of the cone is decreasing at 2
∂ z and ∂ z . cm/min. Find the rate of change of the volume of the cone
∂u ∂v when the radius is 13 cm and the height is 18 cm.
x/y
245. If z = xye , x = r cos θ, and y = r sin θ, find 254. The volume of a frustum of a cone is given by the
∂ z and ∂ z when r = 2 and θ = π . formula V = 1 πz⎛⎝x 2 + y 2 + xy⎞⎠, where x is the radius
3
∂r ∂θ 6
of the smaller circle, y is the radius of the larger circle,
246. Find ∂w if and z is the height of the frustum (see figure). Find the
∂s
rate of change of the volume of this frustum when
w = 4x + y 2 + z 3, x = e rs , y = ln⎛⎝r + s⎞
2
x = 10 in., y = 12 in., and z = 18 in.
t ⎠, and

z = rst 2.

247. If w = sin(xyz), x = 1 − 3t, y = e 1 − t, and


z = 4t, find ∂ w .
∂t

For the following exercises, use this information: A


function f (x, y) is said to be homogeneous of degree n 255. A closed box is in the shape of a rectangular solid
if f (tx, ty) = t n f (x, y). For all homogeneous functions with dimensions x, y, and z. (Dimensions are in inches.)
of degree n, the following equation is true: Suppose each dimension is changing at the rate of 0.5
∂f ∂f in./min. Find the rate of change of the total surface area of
x +y = n f (x, y). Show that the given function is the box when x = 2 in., y = 3 in., and z = 1 in.
∂x ∂y
∂f ∂f
homogeneous and verify that x +y = n f (x, y). 256. The total resistance in a circuit that has three
∂x ∂y
individual resistances represented by x, y, and z is given
xyz
248. f (x, y) = 3x 2 + y 2 by the formula R(x, y, z) = yz + xz + xy . Suppose at a

given time the x resistance is 100Ω, the y resistance


249. f (x, y) = x 2 + y 2 is 200Ω, and the z resistance is 300Ω. Also, suppose
the x resistance is changing at a rate of 2Ω/min, the y
250. f (x, y) = x 2 y − 2y 3
resistance is changing at the rate of 1Ω/min, and the z
251. The volume of a right circular cylinder is given by resistance has no change. Find the rate of change of the
total resistance in this circuit at this time.
V(x, y) = πx 2 y, where x is the radius of the cylinder
and y is the cylinder height. Suppose x and y are 257. The temperature T at a point (x, y) is T(x, y) and
functions of t given by x = 1 t and y = 1 t so that is measured using the Celsius scale. A fly crawls so that
2 3 its position after t seconds is given by x = 1 + t and
x and y are both increasing with time. How fast is the
y = 2 + 1 t, where x and y are measured in centimeters.
volume increasing when x = 2 and y = 5 ? 3
The temperature function satisfies T x (2, 3) = 4 and
252. The pressure P of a gas is related to the volume and T y (2, 3) = 3. How fast is the temperature increasing on
temperature by the formula PV = kT, where temperature
the fly’s path after 3 sec?
is expressed in kelvins. Express the pressure of the gas as
a function of both V and T. Find dP when k = 1,
dt
dV = 2 cm3/min, dT = 1 K/min, V = 20 cm3, and
dt dt 2
T = 20°F.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 421

258. The x and y components of a fluid moving in two


dimensions are given by the following functions:
u(x, y) = 2y and v(x, y) = −2x; x ≥ 0; y ≥ 0. The
speed of the fluid at the point (x, y) is

s(x, y) = u(x, y) 2 + v(x, y) 2. Find ∂ s and ∂ s using


∂x ∂y
the chain rule.

259. Let u = u(x, y, z), where


x = x(w, t), y = y(w, t), z = z(w, t), w = w(r, s), and t = t(r, s).
Use a tree diagram and the chain rule to find an expression
for ∂ u .
∂r
422 Chapter 4 | Differentiation of Functions of Several Variables

4.6 | Directional Derivatives and the Gradient


Learning Objectives
4.6.1 Determine the directional derivative in a given direction for a function of two variables.
4.6.2 Determine the gradient vector of a given real-valued function.
4.6.3 Explain the significance of the gradient vector with regard to direction of change along a
surface.
4.6.4 Use the gradient to find the tangent to a level curve of a given function.
4.6.5 Calculate directional derivatives and gradients in three dimensions.

In Partial Derivatives we introduced the partial derivative. A function z = f (x, y) has two partial derivatives: ∂ z/∂ x
and ∂ z/∂ y. These derivatives correspond to each of the independent variables and can be interpreted as instantaneous rates
of change (that is, as slopes of a tangent line). For example, ∂ z/∂ x represents the slope of a tangent line passing through
a given point on the surface defined by z = f (x, y), assuming the tangent line is parallel to the x-axis. Similarly, ∂ z/∂ y
represents the slope of the tangent line parallel to the y-axis. Now we consider the possibility of a tangent line parallel to
neither axis.

Directional Derivatives
We start with the graph of a surface defined by the equation z = f (x, y). Given a point (a, b) in the domain of
f , we choose a direction to travel from that point. We measure the direction using an angle θ, which is measured
counterclockwise in the x, y-plane, starting at zero from the positive x-axis (Figure 4.39). The distance we travel is h and
the direction we travel is given by the unit vector u = (cos θ)i + (sin θ)j. Therefore, the z-coordinate of the second point
on the graph is given by z = f (a + h cos θ, b + h sin θ).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 423

Figure 4.39 Finding the directional derivative at a point on the graph of z = f (x, y). The
slope of the black arrow on the graph indicates the value of the directional derivative at that
point.

We can calculate the slope of the secant line by dividing the difference in z-values by the length of the line segment
connecting the two points in the domain. The length of the line segment is h. Therefore, the slope of the secant line is
f (a + h cos θ, b + h sin θ) − f (a, b)
m sec = .
h
To find the slope of the tangent line in the same direction, we take the limit as h approaches zero.

Definition
Suppose z = f (x, y) is a function of two variables with a domain of D. Let (a, b) ∈ D and define
u = cos θi + sin θj. Then the directional derivative of f in the direction of u is given by

f (a + h cos θ, b + h sin θ) − f (a, b) (4.36)


D u f (a, b) = lim ,
h→0 h
provided the limit exists.

Equation 4.36 provides a formal definition of the directional derivative that can be used in many cases to calculate a
directional derivative.

Example 4.31

Finding a Directional Derivative from the Definition


424 Chapter 4 | Differentiation of Functions of Several Variables

Let θ = arccos(3/5). Find the directional derivative D u f (x, y) of f (x, y) = x 2 − xy + 3y 2 in the direction of
u = (cos θ)i + (sin θ)j. What is D u f (−1, 2) ?

Solution
First of all, since cos θ = 3/5 and θ is acute, this implies

⎛ ⎞
2
sin θ = 1 − ⎝3 ⎠ = 16 = 4 .
5 25 5

Using f (x, y) = x 2 − xy + 3y 2, we first calculate f ⎛⎝x + h cos θ, y + h sin θ⎞⎠:

f ⎛⎝x + h cos θ, y + h sin θ⎞⎠ = (x + h cos θ) 2 − (x + h cos θ)⎛⎝y + h sin θ⎞⎠ + 3⎛⎝y + h sin θ⎞⎠ 2
= x 2 + 2xh cos θ + h 2 cos 2 θ − xy − xh sin θ − yh cos θ
−h 2 sin θ cos θ + 3y 2 + 6yh sin θ + 3h 2 sin 2 θ
⎛ ⎞ 2 3yh 12h 2
= x 2 + 2xh⎝3 ⎠ + 9h − xy − 4xh − − + 3y 2
5 25 5 5 25
⎛ ⎞ ⎛ ⎞
+6yh⎝4 ⎠ + 3h 2 ⎝16 ⎠
5 25
2 21yh
= x 2 − xy + 3y 2 + 2xh + 9h + .
5 5 5
We substitute this expression into Equation 4.36:
f (a + h cos θ, b + h sin θ) − f (a, b)
D u f (a, b) = lim
h→0 h
⎛ 2 2 2xh 9h 2 21yh ⎞ ⎛ 2 2⎞
⎝x − xy + 3y + 5 + 5 + 5 ⎠ − ⎝x − xy + 3y ⎠
= lim
h→0 h
2 21yh
+ 9h5 + 5
2xh
5
= lim
h→0 h
2x 9h 21y
= lim + +
h→0 5 5 5
2x + 21y
= .
5
To calculate D u f (−1, 2), we substitute x = −1 and y = 2 into this answer:

2(−1) + 21(2)
D u f (−1, 2) =
5
= −2 + 42
5
= 8.
(See the following figure.)

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 425

Figure 4.40 Finding the directional derivative in a given direction u at a given point on a surface.
The plane is tangent to the surface at the given point (−1, 2, 15).

Another approach to calculating a directional derivative involves partial derivatives, as outlined in the following theorem.

Theorem 4.12: Directional Derivative of a Function of Two Variables


Let z = f (x, y) be a function of two variables x and y, and assume that f x and f y exist. Then the directional
derivative of f in the direction of u = cos θi + sin θj is given by

D u f (x, y) = f x (x, y)cos θ + f y (x, y)sin θ. (4.37)

Proof
Equation 4.36 states that the directional derivative of f in the direction of u = cos θi + sin θj is given by

f (a + t cos θ, b + t sin θ) − f (a, b)


D u f (a, b) = lim t .
t→0

Let x = a + t cos θ and y = b + t sin θ, and define g(t) = f (x, y). Since f x and f y both exist, we can use the chain
rule for functions of two variables to calculate g′ (t):

∂ f dx ∂ f dy
g′ (t) = +
∂ x dt ∂ y dt
= f x (x, y)cos θ + f y (x, y)sin θ.

If t = 0, then x = x 0 and y = y 0, so

g′ (0) = f x (x 0, y 0)cos θ + f y (x 0, y 0)sin θ.


426 Chapter 4 | Differentiation of Functions of Several Variables

By the definition of g′ (t), it is also true that

g(t) − g(0)
g′ (0) = lim t
t→0
f ⎛⎝x 0 + t cos θ, y 0 + t sin θ⎞⎠ − f (x 0, y 0)
= lim t .
t→0

Therefore, D u f (x 0, y 0) = f x (x, y)cos θ + f y (x, y)sin θ.

Example 4.32

Finding a Directional Derivative: Alternative Method

Let θ = arccos(3/5). Find the directional derivative D u f (x, y) of f (x, y) = x 2 − xy + 3y 2 in the direction of
u = (cos θ)i + (sin θ)j. What is D u f (−1, 2) ?

Solution
First, we must calculate the partial derivatives of f :

f x = 2x − y
f y = −x + 6y,

Then we use Equation 4.37 with θ = arccos(3/5):

D u f (x, y) = f x (x, y)cos θ + f y (x, y)sin θ


= ⎛⎝2x − y⎞⎠ 3 + ⎛⎝−x + 6y⎞⎠ 4
5 5
6x 3y 4x 24y
= − − +
5 5 5 5
2x + 21y
= .
5
To calculate D u f (−1, 2), let x = −1 and y = 2:

2(−1) + 21(2) −2 + 42
D u f (−1, 2) = = = 8.
5 5
This is the same answer obtained in Example 4.31.

4.28 Find the directional derivative D u f (x, y) of f (x, y) = 3x 2 y − 4xy 3 + 3y 2 − 4x in the direction of
⎛ ⎞ ⎛ ⎞
u = ⎝cos π ⎠i + ⎝sin π ⎠j using Equation 4.37. What is D u f (3, 4) ?
3 3

If the vector that is given for the direction of the derivative is not a unit vector, then it is only necessary to divide by the norm
of the vector. For example, if we wished to find the directional derivative of the function in Example 4.32 in the direction
of the vector 〈 −5, 12 〉 , we would first divide by its magnitude to get u. This gives us u = 〈 −(5/13), 12/13 〉 .
Then

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 427

D u f (x, y) = ∇ f (x, y) · u
= − 5 ⎛⎝2x − y⎞⎠ + 12 ⎛⎝−x + 6y⎞⎠
13 13
22
= − x + y. 17
13 13
Gradient
The right-hand side of Equation 4.37 is equal to f x (x, y)cos θ + f y (x, y)sin θ, which can be written as the dot
product of two vectors. Define the first vector as ∇ f (x, y) = f x (x, y)i + f y (x, y)j and the second vector as
u = (cos θ)i + (sin θ)j. Then the right-hand side of the equation can be written as the dot product of these two vectors:

D u f (x, y) = ∇ f (x, y) · u. (4.38)

The first vector in Equation 4.38 has a special name: the gradient of the function f . The symbol ∇ is called nabla and
the vector ∇ f is read “del f .”

Definition
Let z = f (x, y) be a function of x and y such that f x and f y exist. The vector ∇ f (x, y) is called the gradient of
f and is defined as

∇ f (x, y) = f x (x, y)i + f y (x, y)j. (4.39)

The vector ∇ f (x, y) is also written as “grad f .”

Example 4.33

Finding Gradients

Find the gradient ∇ f (x, y) of each of the following functions:

a. f (x, y) = x 2 − xy + 3y 2

b. f (x, y) = sin 3x cos 3y

Solution
For both parts a. and b., we first calculate the partial derivatives f x and f y, then use Equation 4.39.

a.
f x (x, y) = 2x − y and f y (x, y) = −x + 6y, so
∇ f (x, y) = f x (x, y)i + f y (x, y)j
= ⎛⎝2x − y⎞⎠i + ⎛⎝−x + 6y⎞⎠j.

b.
f x (x, y) = 3 cos 3x cos 3y and f y (x, y) = −3 sin 3x sin 3y, so
∇ f (x, y) = f x (x, y)i + f y (x, y)j
= ⎛⎝3 cos 3x cos 3y⎞⎠i − ⎛⎝3 sin 3x sin 3y⎞⎠j.
428 Chapter 4 | Differentiation of Functions of Several Variables

4.29 Find the gradient ∇ f (x, y) of f (x, y) = ⎛⎝x 2 − 3y 2⎞⎠/⎛⎝2x + y⎞⎠.

The gradient has some important properties. We have already seen one formula that uses the gradient: the formula for
the directional derivative. Recall from The Dot Product that if the angle between two vectors a and b is φ, then
a · b = ‖ a ‖ ‖ b ‖ cos φ. Therefore, if the angle between ∇ f (x 0, y 0) and u = (cos θ)i + (sin θ)j is φ, we have

D u f (x 0, y 0) = ∇ f (x 0, y 0) · u = ‖ ∇ f (x 0, y 0) ‖ ‖ u ‖ cos φ = ‖ ∇ f (x 0, y 0) ‖ cos φ.

The ‖ u ‖ disappears because u is a unit vector. Therefore, the directional derivative is equal to the magnitude of the
gradient evaluated at (x 0, y 0) multiplied by cos φ. Recall that cos φ ranges from −1 to 1. If φ = 0, then cos φ = 1
and ∇ f (x 0, y 0) and u both point in the same direction. If φ = π, then cos φ = −1 and ∇ f (x 0, y 0) and u point in
opposite directions. In the first case, the value of D u f (x 0, y 0) is maximized; in the second case, the value of D u f (x 0, y 0)
is minimized. If ∇ f (x 0, y 0) = 0, then D u f (x 0, y 0) = ∇ f (x 0, y 0) · u = 0 for any vector u. These three cases are
outlined in the following theorem.

Theorem 4.13: Properties of the Gradient


Suppose the function z = f (x, y) is differentiable at (x 0, y 0) (Figure 4.41).

i. If ∇ f (x 0, y 0) = 0, then D u f (x 0, y 0) = 0 for any unit vector u.

ii. If ∇ f (x 0, y 0) ≠ 0, then D u f (x 0, y 0) is maximized when u points in the same direction as ∇ f (x 0, y 0).


The maximum value of D u f (x 0, y 0) is ‖ ∇ f (x 0, y 0) ‖ .

iii. If ∇ f (x 0, y 0) ≠ 0, then D u f (x 0, y 0) is minimized when u points in the opposite direction from


∇ f (x 0, y 0). The minimum value of D u f (x 0, y 0) is − ‖ ∇ f (x 0, y 0) ‖ .

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 429

Figure 4.41 The gradient indicates the maximum and minimum values of the
directional derivative at a point.

Example 4.34

Finding a Maximum Directional Derivative

Find the direction for which the directional derivative of f (x, y) = 3x 2 − 4xy + 2y 2 at (−2, 3) is a maximum.
What is the maximum value?

Solution
The maximum value of the directional derivative occurs when ∇ f and the unit vector point in the same direction.
Therefore, we start by calculating ∇ f (x, y):

f x (x, y) = 6x − 4y and f y (x, y) = −4x + 4y, so


∇ f (x, y) = f x (x, y)i + f y (x, y)j = ⎛⎝6x − 4y⎞⎠i + ⎛⎝−4x + 4y⎞⎠j.

Next, we evaluate the gradient at (−2, 3):

∇ f (−2, 3) = ⎛⎝6(−2) − 4(3)⎞⎠i + ⎛⎝−4(−2) + 4(3)⎞⎠ j = −24i + 20j.

We need to find a unit vector that points in the same direction as ∇ f (−2, 3), so the next step is to divide

∇ f (−2, 3) by its magnitude, which is (−24) 2 + (20) 2 = 976 = 4 61. Therefore,

∇ f (−2, 3)
= −24 i + 20 j = −6 61 i + 5 61 j.
‖ ∇ f (−2, 3) ‖ 4 61 4 61 61 61

This is the unit vector that points in the same direction as ∇ f (−2, 3). To find the angle corresponding to this
430 Chapter 4 | Differentiation of Functions of Several Variables

unit vector, we solve the equations

cos θ = −6 61 and sin θ = 5 61


61 61
for θ. Since cosine is negative and sine is positive, the angle must be in the second quadrant. Therefore,
θ = π − arcsin⎛⎝⎛⎝5 61⎞⎠/61⎞⎠ ≈ 2.45 rad.

The maximum value of the directional derivative at (−2, 3) is ‖ ∇ f (−2, 3) ‖ = 4 61 (see the following
figure).

Figure 4.42 The maximum value of the directional derivative at


(−2, 3) is in the direction of the gradient.

4.30 Find the direction for which the directional derivative of g(x, y) = 4x − xy + 2y 2 at (−2, 3) is a
maximum. What is the maximum value?

Figure 4.43 shows a portion of the graph of the function f (x, y) = 3 + sin x sin y. Given a point (a, b) in the domain
of f , the maximum value of the gradient at that point is given by ‖ ∇ f (a, b) ‖ . This would equal the rate of greatest
ascent if the surface represented a topographical map. If we went in the opposite direction, it would be the rate of greatest
descent.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 431

Figure 4.43 A typical surface in ℝ 3. Given a point on the surface, the directional derivative
can be calculated using the gradient.

When using a topographical map, the steepest slope is always in the direction where the contour lines are closest together
(see Figure 4.44). This is analogous to the contour map of a function, assuming the level curves are obtained for equally
spaced values throughout the range of that function.

Figure 4.44 Contour map for the function


f (x, y) = x 2 − y 2 using level values between −5 and 5.

Gradients and Level Curves


Recall that if a curve is defined parametrically by the function pair ⎛⎝x(t), y(t)⎞⎠, then the vector x′ (t)i + y′ (t)j is tangent
to the curve for every value of t in the domain. Now let’s assume z = f (x, y) is a differentiable function of x and y, and
(x 0, y 0) is in its domain. Let’s suppose further that x 0 = x(t 0) and y 0 = y(t 0) for some value of t, and consider the
level curve f (x, y) = k. Define g(t) = f ⎛⎝x(t), y(t)⎞⎠ and calculate g′ (t) on the level curve. By the chain Rule,

g′ (t) = f x ⎛⎝x(t), y(t)⎞⎠x′ (t) + f y ⎛⎝x(t), y(t)⎞⎠y′ (t).


432 Chapter 4 | Differentiation of Functions of Several Variables

But g′ (t) = 0 because g(t) = k for all t. Therefore, on the one hand,

f x ⎛⎝x(t), y(t)⎞⎠x′ (t) + f y ⎛⎝x(t), y(t)⎞⎠y′ (t) = 0;

on the other hand,


f x ⎛⎝x(t), y(t)⎞⎠x′ (t) + f y ⎛⎝x(t), y(t)⎞⎠y′ (t) = ∇ f (x, y) · 〈 x′ (t), y′ (t) 〉 .

Therefore,
∇ f (x, y) · 〈 x′ (t), y′ (t) 〉 = 0.

Thus, the dot product of these vectors is equal to zero, which implies they are orthogonal. However, the second vector is
tangent to the level curve, which implies the gradient must be normal to the level curve, which gives rise to the following
theorem.

Theorem 4.14: Gradient Is Normal to the Level Curve


Suppose the function z = f (x, y) has continuous first-order partial derivatives in an open disk centered at a point
(x 0, y 0). If ∇ f (x 0, y 0) ≠ 0, then ∇ f (x 0, y 0) is normal to the level curve of f at (x 0, y 0).

We can use this theorem to find tangent and normal vectors to level curves of a function.

Example 4.35

Finding Tangents to Level Curves

For the function f (x, y) = 2x 2 − 3xy + 8y 2 + 2x − 4y + 4, find a tangent vector to the level curve at point
(−2, 1). Graph the level curve corresponding to f (x, y) = 18 and draw in ∇ f (−2, 1) and a tangent vector.

Solution
First, we must calculate ∇ f (x, y):

f x (x, y) = 4x − 3y + 2 and f y = −3x + 16y − 4 so ∇ f (x, y) = ⎛⎝4x − 3y + 2⎞⎠i + ⎛⎝−3x + 16y − 4⎞⎠j.

Next, we evaluate ∇ f (x, y) at (−2, 1):

∇ f (−2, 1) = ⎛⎝4(−2) − 3(1) + 2⎞⎠i + ⎛⎝−3(−2) + 16(1) − 4⎞⎠ j = −9i + 18j.

This vector is orthogonal to the curve at point (−2, 1). We can obtain a tangent vector by reversing the
components and multiplying either one by −1. Thus, for example, −18i − 9j is a tangent vector (see the
following graph).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 433

Figure 4.45 Tangent and normal vectors to


2x 2 − 3xy + 8y 2 + 2x − 4y + 4 = 18 at point (−2, 1).

4.31 For the function f (x, y) = x 2 − 2xy + 5y 2 + 3x − 2y + 4, find the tangent to the level curve at point
(1, 1). Draw the graph of the level curve corresponding to f (x, y) = 8 and draw ∇ f (1, 1) and a tangent
vector.

Three-Dimensional Gradients and Directional Derivatives


The definition of a gradient can be extended to functions of more than two variables.

Definition
Let w = f (x, y, z) be a function of three variables such that f x, f y, and f z exist. The vector ∇ f (x, y, z) is called
the gradient of f and is defined as

∇ f (x, y, z) = f x (x, y, z)i + f y (x, y, z)j + f z (x, y, z)k. (4.40)

∇ f (x, y, z) can also be written as grad f (x, y, z).

Calculating the gradient of a function in three variables is very similar to calculating the gradient of a function in two
variables. First, we calculate the partial derivatives f x, f y, and f z, and then we use Equation 4.40.

Example 4.36

Finding Gradients in Three Dimensions

Find the gradient ∇ f (x, y, z) of each of the following functions:

a. f (x, y) = 5x 2 − 2xy + y 2 − 4yz + z 2 + 3xz

b. f (x, y, z) = e −2z sin 2x cos 2y

Solution
434 Chapter 4 | Differentiation of Functions of Several Variables

For both parts a. and b., we first calculate the partial derivatives f x, f y, and f z, then use Equation 4.40.

a.
f z (x, y, z) = 10x − 2y + 3z, f y (x, y, z) = −2x + 2y − 4z and f z (x, y, z) = 3x − 4y + 2z, so
∇ f (x, y, z) = f x (x, y, z)i + f y (x, y, z)j + f z (x, y, z)k
= ⎛⎝10x − 2y + 3z⎞⎠i + ⎛⎝−2x + 2y − 4z⎞⎠j + ⎛⎝−4x + 3y + 2z⎞⎠k.

b.
f x (x, y, z) = −2e −2z cos 2x cos 2y, f y (x, y, z) = −2e −2z sin 2x sin 2y and
f z (x, y, z) = −2e −2z sin 2x cos 2y, so
∇ f (x, y, z) = f x (x, y, z)i + f y (x, y, z)j + f z (x, y, z)k
⎛ −2z
= ⎝2e cos 2x cos 2y⎞⎠i + ⎛⎝−2e −2z⎞⎠j + ⎛⎝−2e −2z⎞⎠

= 2e −2z ⎛⎝cos 2x cos 2y i − sin 2x sin 2y j − sin 2x cos 2y k⎞⎠.

4.32 x 2 − 3y 2 + z 2
Find the gradient ∇ f (x, y, z) of f (x, y, z) = .
2x + y − 4z

The directional derivative can also be generalized to functions of three variables. To determine a direction in three
dimensions, a vector with three components is needed. This vector is a unit vector, and the components of the unit vector are
called directional cosines. Given a three-dimensional unit vector u in standard form (i.e., the initial point is at the origin),
this vector forms three different angles with the positive x − , y − , and z-axes. Let’s call these angles α, β, and γ.
Then the directional cosines are given by cos α, cos β, and cos γ. These are the components of the unit vector u; since
u is a unit vector, it is true that cos 2 α + cos 2 β + cos 2 γ = 1.

Definition
Suppose w = f (x, y, z) is a function of three variables with a domain of D. Let (x 0, y 0, z 0) ∈ D and let
u = cos αi + cos βj + cos γk be a unit vector. Then, the directional derivative of f in the direction of u is given by

f ⎛⎝x 0 + t cos α, y 0 + t cos β, z 0 + t cos γ⎞⎠ − f (x 0, y 0, z 0) (4.41)


D u f (x 0, y 0, z 0) = lim t ,
t→0

provided the limit exists.

We can calculate the directional derivative of a function of three variables by using the gradient, leading to a formula that is
analogous to Equation 4.38.

Theorem 4.15: Directional Derivative of a Function of Three Variables


Let f (x, y, z) be a differentiable function of three variables and let u = cos αi + cos βj + cos γk be a unit vector.
Then, the directional derivative of f in the direction of u is given by

D u f (x, y, z) = ∇ f (x, y, z) · u (4.42)


= f x (x, y, z)cos α + f y (x, y, z)cos β + f z (x, y, z)cos γ.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 435

The three angles α, β, and γ determine the unit vector u. In practice, we can use an arbitrary (nonunit) vector, then divide
by its magnitude to obtain a unit vector in the desired direction.

Example 4.37

Finding a Directional Derivative in Three Dimensions

Calculate D u f (1, −2, 3) in the direction of v = −i + 2j + 2k for the function

f (x, y, z) = 5x 2 − 2xy + y 2 − 4yz + z 2 + 3xz.

Solution
First, we find the magnitude of v:

‖ v ‖ = (−1) 2 + (2) 2 = 3.

Therefore, v = −i + 2j + 2k = − 1 i + 2 j + 2 k is a unit vector in the direction of v, so


‖v‖ 3 3 3 3
cos α = − 1 , cos β = 2 , and cos γ = 2 . Next, we calculate the partial derivatives of f :
3 3 3
f x (x, y, z) = 10x − 2y + 3z
f y (x, y, z) = −2x + 2y − 4z
f z (x, y, z) = −4y + 2z + 3x,

then substitute them into Equation 4.42:


D u f (x, y, z) = f x (x, y, z)cos α + f y (x, y, z)cos β + f z (x, y, z)cos γ
⎛ ⎞ ⎛ ⎞ ⎛ ⎞
= ⎛⎝10x − 2y + 3z⎞⎠⎝− 1 ⎠ + ⎛⎝−2x + 2y − 4z⎞⎠⎝2 ⎠ + ⎛⎝−4y + 2z + 3x⎞⎠⎝2 ⎠
3 3 3
10x 2y 3z 4x 4y 8z 8y 4z 6x
= − + − − + − − + +
3 3 3 3 3 3 3 3 3
8x 2y 7z
= − − − .
3 3 3
Last, to find D u f (1, −2, 3), we substitute x = 1, y = −2, and z = 3:

8(1) 2(−2) 7(3)


D u f (1, −2, 3) = − − −
3 3 3
8
= − + −4 21
3 3 3
25
= − .
3

4.33 Calculate D u f (x, y, z) and D u f (0, −2, 5) in the direction of v = −3i + 12j − 4k for the function
f (x, y, z) = 3x 2 + xy − 2y 2 + 4yz − z 2 + 2xz.
436 Chapter 4 | Differentiation of Functions of Several Variables

4.6 EXERCISES
y
For the following exercises, find the directional derivative 275. f (x, y) = ,θ= −π
using the limit definition only. x + 2y 4

260. f (x, y) = 5 − 2x 2 − 1 y 2 at point P(3, 4) in the 276. f (x, y) = cos⎛⎝3x + y⎞⎠, θ = π


2 4
⎛ ⎞ ⎛ ⎞
direction of u = ⎝cos π ⎠i + ⎝sin π ⎠j
4 4 277. w(x, y) = ye x, θ = π
3
⎛ ⎞
261. f (x, y) = y 2 cos(2x) at point P⎝π , 2⎠ in the f (x, y) = x arctan(y), θ = π
3 278. 2
⎛ π ⎞ ⎛ π ⎞
direction of u = ⎝cos ⎠i + ⎝sin ⎠j
4 4
279. f (x, y) = ln(x + 2y), θ = π
3
262. Find the directional derivative of
⎛ ⎞ For the following exercises, find the gradient.
f (x, y) = y sin(2x) at point P⎝π , 2⎠ in the direction of
2
4
u = 5i + 12j. 14 − x 2 − y 2
280. Find the gradient of f (x, y) = . Then,
3
For the following exercises, find the directional derivative find the gradient at point P(1, 2).
of the function at point P in the direction of v.
281. Find the gradient of f (x, y, z) = xy + yz + xz at
263. f (x, y) = xy, P(0, −2), v = 1 i + 3 j point P(1, 2, 3).
2 2

⎛ ⎞ 282. Find the gradient of f (x, y, z) at P and in the


264. h(x, y) = e x sin y, P⎝1, π ⎠, v = −i
2 direction of u:
f (x, y, z) = ln(x 2 + 2y 2 + 3z 2), P(2, 1, 4), u = −3 i − 4 j − 12 k.
265. h(x, y, z) = xyz, P(2, 1, 1), v = 2i + j − k 13 13 13

266. f (x, y) = xy, P(1, 1), u = 〈 2 , 2 〉 283.


2 2
f (x, y, z) = 4x 5 y 2 z 3, P(2, −1, 1), u = 1 i + 2 j − 2 k
3 3 3
267. f (x, y) = x 2 − y 2, u = 〈 3 , 1 〉 , P(1, 0)
2 2
For the following exercises, find the directional derivative
⎛ ⎞
268. f (x, y) = 3x + 4y + 7, u = 〈 3 , 4 〉 , P⎝0, π ⎠ of the function at point P in the direction of Q.
5 5 2

⎛ ⎞ f (x, y) = x 2 + 3y 2, P(1, 1), Q(4, 5)


269. f (x, y) = e x cos y, u = 〈 0, 1 〉 , P = ⎝0, π ⎠ 284.
2
y
10 285. f (x, y, z) = x + z , P(2, 1, −1), Q(−1, 2, 0)
270. f (x, y) = y , u = 〈 0, −1 〉 , P = (1, −1)

For the following exercises, find the derivative of the


271. f (x, y) = ln(x 2 + y 2), u = 〈 3 , 4 〉 , P(1, 2) function at P in the direction of u.
5 5

286. f (x, y) = −7x + 2y, P(2, −4), u = 4i − 3j


272. f (x, y) = x 2 y, P(−5, 5), v = 3i − 4j
287. f (x, y) = ln(5x + 4y), P(3, 9), u = 6i + 8j
273. f (x, y) = y 2 + xz, P(1, 2, 2), v = 〈 2, −1, 2 〉
288. [T] Use technology to sketch the level curve of
For the following exercises, find the directional derivative f (x, y) = 4x − 2y + 3 that passes through P(1, 2) and
of the function in the direction of the unit vector
u = cos θi + sin θj. draw the gradient vector at P.

274. f (x, y) = x 2 + 2y 2, θ = π
6

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 437

289. [T] Use technology to sketch the level curve of 303. f (x, y, z) = xy + yz + xz = 3 at point (1, 1, 1)
f (x, y) = x 2 + 4y 2 that passes through P(−2, 0) and
draw the gradient vector at P. 304. f (x, y, z) = xyz = 6 at point (1, 2, 3)

For the following exercises, find the gradient vector at the 305. f (x, y, z) = xe y cos z − z = 1 at point (1, 0, 0)
indicated point.
For the following exercises, solve the problem.
290. f (x, y) = xy 2 − yx 2, P(−1, 1)
306. The temperature T in a metal sphere is inversely
y proportional to the distance from the center of the sphere
291. f (x, y) = xe − ln(x), P(−3, 0)
(the origin: (0, 0, 0)). The temperature at point (1, 2, 2)
292. f (x, y, z) = xy − ln(z), P(2, −2, 2) is 120°C.
a. Find the rate of change of the temperature at point
(1, 2, 2) in the direction toward point (2, 1, 3).
293. f (x, y, z) = x y 2 + z 2, P(−2, −1, −1)
b. Show that, at any point in the sphere, the direction
For the following exercises, find the derivative of the of greatest increase in temperature is given by a
function. vector that points toward the origin.

307. The electrical potential (voltage) in a certain region


294. f (x, y) = x 2 + xy + y 2 at point (−5, −4) in the of space is given by the function
direction the function increases most rapidly V(x, y, z) = 5x 2 − 3xy + xyz.
xy a. Find the rate of change of the voltage at point
295. f (x, y) = e at point (6, 7) in the direction the
(3, 4, 5) in the direction of the vector
function increases most rapidly
〈 1, 1, −1 〉 .
arctan⎛⎝ x ⎞⎠
y b. In which direction does the voltage change most
296. f (x, y) = at point (−9, 9) in the
rapidly at point (3, 4, 5) ?
direction the function increases most rapidly
c. What is the maximum rate of change of the voltage
297. f (x, y, z) = ln(xy + yz + zx) at point at point (3, 4, 5) ?
(−9, −18, −27) in the direction the function increases
308. If the electric potential at a point (x, y) in the
most rapidly
xy-plane is V(x, y) = e −2x cos(2y), then the electric
y
298. f (x, y, z) = xy + z + xz at point (5, −5, 5) in the intensity vector at (x, y) is E = −∇ V(x, y).
⎛ ⎞
direction the function increases most rapidly a. Find the electric intensity vector at ⎝π , 0⎠.
4
For the following exercises, find the maximum rate of b. Show that, at each point in the plane, the electric
change of f at the given point and the direction in which potential decreases most rapidly in the direction of
the vector E.
it occurs.
−y 309. In two dimensions, the motion of an ideal fluid is
299. f (x, y) = xe , (1, 0)
governed by a velocity potential φ. The velocity
components of the fluid u in the x-direction and v in
300. f (x, y) = x 2 + 2y, (4, 10)
the y-direction, are given by 〈 u, v 〉 = ∇ φ. Find the
⎛ ⎞ velocity components associated with the velocity potential
301. f (x, y) = cos(3x + 2y), ⎝π , − π ⎠ φ(x, y) = sin πx sin 2πy.
6 8

For the following exercises, find equations of


a. the tangent plane and
b. the normal line to the given surface at the given
point.

302. The level curve f (x, y, z) = 12 for


f (x, y, z) = 4x 2 − 2y 2 + z 2 at point (2, 2, 2).
438 Chapter 4 | Differentiation of Functions of Several Variables

4.7 | Maxima/Minima Problems


Learning Objectives
4.7.1 Use partial derivatives to locate critical points for a function of two variables.
4.7.2 Apply a second derivative test to identify a critical point as a local maximum, local minimum,
or saddle point for a function of two variables.
4.7.3 Examine critical points and boundary points to find absolute maximum and minimum values
for a function of two variables.

One of the most useful applications for derivatives of a function of one variable is the determination of maximum and/or
minimum values. This application is also important for functions of two or more variables, but as we have seen in earlier
sections of this chapter, the introduction of more independent variables leads to more possible outcomes for the calculations.
The main ideas of finding critical points and using derivative tests are still valid, but new wrinkles appear when assessing
the results.

Critical Points
For functions of a single variable, we defined critical points as the values of the function when the derivative equals zero
or does not exist. For functions of two or more variables, the concept is essentially the same, except for the fact that we are
now working with partial derivatives.

Definition
Let z = f (x, y) be a function of two variables that is defined on an open set containing the point (x 0, y 0). The point
(x 0, y 0) is called a critical point of a function of two variables f if one of the two following conditions holds:

1. f x (x 0, y 0) = f y (x 0, y 0) = 0

2. Either f x (x 0, y 0) or f y (x 0, y 0) does not exist.

Example 4.38

Finding Critical Points

Find the critical points of each of the following functions:

a. f (x, y) = 4y 2 − 9x 2 + 24y + 36x + 36

b. g(x, y) = x 2 + 2xy − 4y 2 + 4x − 6y + 4

Solution
a. First, we calculate f x (x, y) and f y (x, y):

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 439

−1/2
f x (x, y) = 1 (−18x + 36)⎛⎝4y 2 − 9x 2 + 24y + 36x + 36⎞⎠
2
= −9x + 18
4y − 9x 2 + 24y + 36x + 36
2

−1/2
f y (x, y) = 1 ⎛⎝8y + 24⎞⎠⎛⎝4y 2 − 9x 2 + 24y + 36x + 36⎞⎠
2
4y + 12
= .
2 2
4y − 9x + 24y + 36x + 36

Next, we set each of these expressions equal to zero:


−9x + 18 = 0
4y − 9x 2 + 24y + 36x + 36
2

4y + 12
= 0.
2 2
4y − 9x + 24y + 36x + 36

Then, multiply each equation by its common denominator:


−9x + 18 = 0
4y + 12 = 0.

Therefore, x = 2 and y = −3, so (2, −3) is a critical point of f .


We must also check for the possibility that the denominator of each partial derivative can equal zero, thus
causing the partial derivative not to exist. Since the denominator is the same in each partial derivative, we
need only do this once:
4y 2 − 9x 2 + 24y + 36x + 36 = 0.

This equation represents a hyperbola. We should also note that the domain of f consists of points
satisfying the inequality
4y 2 − 9x 2 + 24y + 36x + 36 ≥ 0.

Therefore, any points on the hyperbola are not only critical points, they are also on the boundary of the
domain. To put the hyperbola in standard form, we use the method of completing the square:
4y 2 − 9x 2 + 24y + 36x + 36 = 0
4y 2 − 9x 2 + 24y + 36x = −36
4y 2 + 24y − 9x 2 + 36x = −36
4⎛⎝y 2 + 6y⎞⎠ − 9⎛⎝x 2 − 4x⎞⎠ = −36
4⎛⎝y 2 + 6y + 9⎞⎠ − 9⎛⎝x 2 − 4x + 4⎞⎠ = −36 + 36 − 36
4⎛⎝y + 3⎞⎠ 2 − 9(x − 2) 2 = −36.

Dividing both sides by −36 puts the equation in standard form:


440 Chapter 4 | Differentiation of Functions of Several Variables

4⎛⎝y + 3⎞⎠ 2 9(x − 2) 2


− = 1
−36 −36
(x − 2) 2 ⎛⎝y + 3⎞⎠ 2
− = 1.
4 9

Notice that point (2, −3) is the center of the hyperbola.

b. First, we calculate g x (x, y) and g y (x, y):

g x (x, y) = 2x + 2y + 4
g y (x, y) = 2x − 8y − 6.

Next, we set each of these expressions equal to zero, which gives a system of equations in x and y:

2x + 2y + 4 = 0
2x − 8y − 6 = 0.

Subtracting the second equation from the first gives 10y + 10 = 0, so y = −1. Substituting this into
the first equation gives 2x + 2(−1) + 4 = 0, so x = −1. Therefore (−1, −1) is a critical point of g
(Figure 4.46). There are no points in ℝ 2 that make either partial derivative not exist.

Figure 4.46 The function g(x, y) has a critical point at (−1, −1, 6).

4.34 Find the critical point of the function f (x, y) = x 3 + 2xy − 2x − 4y.

The main purpose for determining critical points is to locate relative maxima and minima, as in single-variable calculus.
When working with a function of one variable, the definition of a local extremum involves finding an interval around the
critical point such that the function value is either greater than or less than all the other function values in that interval.
When working with a function of two or more variables, we work with an open disk around the point.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 441

Definition
Let z = f (x, y) be a function of two variables that is defined and continuous on an open set containing the point
(x 0, y 0). Then f has a local maximum at (x 0, y 0) if

f (x 0, y 0) ≥ f (x, y)

for all points (x, y) within some disk centered at (x 0, y 0). The number f (x 0, y 0) is called a local maximum value.
If the preceding inequality holds for every point (x, y) in the domain of f , then f has a global maximum (also
called an absolute maximum) at (x 0, y 0).

The function f has a local minimum at (x 0, y 0) if

f (x 0, y 0) ≤ f (x, y)

for all points (x, y) within some disk centered at (x 0, y 0). The number f (x 0, y 0) is called a local minimum value. If
the preceding inequality holds for every point (x, y) in the domain of f , then f has a global minimum (also called
an absolute minimum) at (x 0, y 0).

If f (x 0, y 0) is either a local maximum or local minimum value, then it is called a local extremum (see the following
figure).

Figure 4.47 The graph of z = 16 − x 2 − y 2 has a


maximum value when (x, y) = (0, 0). It attains its minimum
value at the boundary of its domain, which is the circle
x 2 + y 2 = 16.

In Maxima and Minima (http://cnx.org/content/m53611/latest/) , we showed that extrema of functions of one


variable occur at critical points. The same is true for functions of more than one variable, as stated in the following theorem.

Theorem 4.16: Fermat’s Theorem for Functions of Two Variables


Let z = f (x, y) be a function of two variables that is defined and continuous on an open set containing the point
442 Chapter 4 | Differentiation of Functions of Several Variables

(x 0, y 0). Suppose f x and f y each exists at (x 0, y 0). If f has a local extremum at (x 0, y 0), then (x 0, y 0) is a
critical point of f .

Second Derivative Test


Consider the function f (x) = x 3. This function has a critical point at x = 0, since f ′(0) = 3(0) 2 = 0. However, f
does not have an extreme value at x = 0. Therefore, the existence of a critical value at x = x 0 does not guarantee a local
extremum at x = x 0. The same is true for a function of two or more variables. One way this can happen is at a saddle
point. An example of a saddle point appears in the following figure.

Figure 4.48 Graph of the function z = x 2 − y 2. This graph


has a saddle point at the origin.

In this graph, the origin is a saddle point. This is because the first partial derivatives of f (x, y) = x 2 − y 2 are both equal to
zero at this point, but it is neither a maximum nor a minimum for the function. Furthermore the vertical trace corresponding
to y = 0 is z = x 2 (a parabola opening upward), but the vertical trace corresponding to x = 0 is z = −y 2 (a parabola
opening downward). Therefore, it is both a global maximum for one trace and a global minimum for another.

Definition
Given the function z = f (x, y), the point ⎛⎝x 0, y 0, f (x 0, y 0)⎞⎠ is a saddle point if both f 0 (x 0, y 0) = 0 and
f y (x 0, y 0) = 0, but f does not have a local extremum at (x 0, y 0).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 443

The second derivative test for a function of one variable provides a method for determining whether an extremum occurs at
a critical point of a function. When extending this result to a function of two variables, an issue arises related to the fact that
there are, in fact, four different second-order partial derivatives, although equality of mixed partials reduces this to three.
The second derivative test for a function of two variables, stated in the following theorem, uses a discriminant D that
replaces f ″(x 0) in the second derivative test for a function of one variable.

Theorem 4.17: Second Derivative Test


Let z = f (x, y) be a function of two variables for which the first- and second-order partial derivatives are continuous
on some disk containing the point (x 0, y 0). Suppose f x (x 0, y 0) = 0 and f y (x 0, y 0) = 0. Define the quantity

D = f xx (x 0, y 0) f yy (x 0, y 0) − ⎛⎝ f xy (x 0, y 0)⎞⎠ 2. (4.43)

i. If D > 0 and f xx (x 0, y 0) > 0, then f has a local minimum at (x 0, y 0).

ii. If D > 0 and f xx (x 0, y 0) < 0, then f has a local maximum at (x 0, y 0).

iii. If D < 0, , then f has a saddle point at (x 0, y 0).

iv. If D = 0, then the test is inconclusive.

See Figure 4.49.

Figure 4.49 The second derivative test can often determine whether a function of two variables has a local minima (a), a
local maxima (b), or a saddle point (c).

To apply the second derivative test, it is necessary that we first find the critical points of the function. There are several
steps involved in the entire procedure, which are outlined in a problem-solving strategy.

Problem-Solving Strategy: Using the Second Derivative Test for Functions of Two Variables
Let z = f (x, y) be a function of two variables for which the first- and second-order partial derivatives are continuous
on some disk containing the point (x 0, y 0). To apply the second derivative test to find local extrema, use the following
steps:
1. Determine the critical points (x 0, y 0) of the function f where f x (x 0, y 0) = f y (x 0, y 0) = 0. Discard any
points where at least one of the partial derivatives does not exist.
2. Calculate the discriminant D = f xx (x 0, y 0) f yy (x 0, y 0) − ⎛⎝ f xy (x 0, y 0)⎞⎠ 2 for each critical point of f .
444 Chapter 4 | Differentiation of Functions of Several Variables

3. Apply Second Derivative Test to determine whether each critical point is a local maximum, local
minimum, or saddle point, or whether the theorem is inconclusive.

Example 4.39

Using the Second Derivative Test

Find the critical points for each of the following functions, and use the second derivative test to find the local
extrema:
a. f (x, y) = 4x 2 + 9y 2 + 8x − 36y + 24

b. g(x, y) = 1 x 3 + y 2 + 2xy − 6x − 3y + 4
3

Solution
a. Step 1 of the problem-solving strategy involves finding the critical points of f . To do this, we first
calculate f x (x, y) and f y (x, y), then set each of them equal to zero:

f x (x, y) = 8x + 8
f y (x, y) = 18y − 36.

Setting them equal to zero yields the system of equations


8x + 8 = 0
18y − 36 = 0.

The solution to this system is x = −1 and y = 2. Therefore (−1, 2) is a critical point of f .


Step 2 of the problem-solving strategy involves calculating D. To do this, we first calculate the second
partial derivatives of f :

f xx (x, y) = 8
f xy (x, y) = 0
f yy (x, y) = 18.

Therefore, D = f xx (−1, 2) f yy (−1, 2) − ⎛⎝ f xy (−1, 2)⎞⎠ 2 = (8)(18) − (0) 2 = 144.


Step 3 states to check Fermat’s Theorem for Functions of Two Variables. Since D > 0 and
f xx (−1, 2) > 0, this corresponds to case 1. Therefore, f has a local minimum at (−1, 2) as shown in
the following figure.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 445

Figure 4.50 The function f (x, y) has a local minimum at (−1, 2, −16).

b. For step 1, we first calculate g x (x, y) and g y (x, y), then set each of them equal to zero:

g x (x, y) = x 2 + 2y − 6
g y (x, y) = 2y + 2x − 3.

Setting them equal to zero yields the system of equations


x 2 + 2y − 6 = 0
2y + 2x − 3 = 0.

To solve this system, first solve the second equation for y. This gives y = 3 − 2x . Substituting this into
2
the first equation gives
x 2 + 3 − 2x − 6 = 0
x 2 − 2x − 3 = 0
(x − 3)(x + 1) = 0.
Therefore, x = −1 or x = 3. Substituting these values into the equation y = 3 − 2x yields the critical
2
⎛ ⎞ ⎛ ⎞
points ⎝−1, 5 ⎠ and ⎝3, − 3 ⎠.
2 2
Step 2 involves calculating the second partial derivatives of g:

g xx (x, y) = 2x
g xy (x, y) = 2
g yy (x, y) = 2.

Then, we find a general formula for D:


D = g xx (x 0, y 0)g yy (x 0, y 0) − ⎛⎝g xy (x 0, y 0)⎞⎠ 2
= ⎛⎝2x 0⎞⎠(2) − 2 2
= 4x 0 − 4.
446 Chapter 4 | Differentiation of Functions of Several Variables

Next, we substitute each critical point into this formula:


⎛ ⎞
D⎝−1, 5 ⎠ = ⎛⎝2(−1)⎞⎠(2) − (2) 2 = −4 − 4 = −8
2
⎛ ⎞
D⎝3, − 3 ⎠ = ⎛⎝2(3)⎞⎠(2) − (2) 2 = 12 − 4 = 8.
2

In step 3, we note that, applying Fermat’s Theorem for Functions of Two Variables to point
⎛ 5⎞ ⎛ 5⎞
⎝−1, 2 ⎠ leads to case 3, which means that ⎝−1, 2 ⎠ is a saddle point. Applying the theorem to point
⎛ 3⎞ ⎛ 3⎞
⎝3, − 2 ⎠ leads to case 1, which means that ⎝3, − 2 ⎠ corresponds to a local minimum as shown in the
following figure.

Figure 4.51 The function g(x, y) has a local minimum and a saddle point.

4.35 Use the second derivative to find the local extrema of the function
f (x, y) = x 3 + 2xy − 6x − 4y 2.

Absolute Maxima and Minima


When finding global extrema of functions of one variable on a closed interval, we start by checking the critical values over
that interval and then evaluate the function at the endpoints of the interval. When working with a function of two variables,
the closed interval is replaced by a closed, bounded set. A set is bounded if all the points in that set can be contained within
a ball (or disk) of finite radius. First, we need to find the critical points inside the set and calculate the corresponding critical
values. Then, it is necessary to find the maximum and minimum value of the function on the boundary of the set. When
we have all these values, the largest function value corresponds to the global maximum and the smallest function value
corresponds to the absolute minimum. First, however, we need to be assured that such values exist. The following theorem
does this.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 447

Theorem 4.18: Extreme Value Theorem


A continuous function f (x, y) on a closed and bounded set D in the plane attains an absolute maximum value at
some point of D and an absolute minimum value at some point of D.

Now that we know any continuous function f defined on a closed, bounded set attains its extreme values, we need to know
how to find them.

Theorem 4.19: Finding Extreme Values of a Function of Two Variables


Assume z = f (x, y) is a differentiable function of two variables defined on a closed, bounded set D. Then f will
attain the absolute maximum value and the absolute minimum value, which are, respectively, the largest and smallest
values found among the following:
i. The values of f at the critical points of f in D.

ii. The values of f on the boundary of D.

The proof of this theorem is a direct consequence of the extreme value theorem and Fermat’s theorem. In particular, if
either extremum is not located on the boundary of D, then it is located at an interior point of D. But an interior point
(x 0, y 0) of D that’s an absolute extremum is also a local extremum; hence, (x 0, y 0) is a critical point of f by Fermat’s
theorem. Therefore the only possible values for the global extrema of f on D are the extreme values of f on the interior
or boundary of D.

Problem-Solving Strategy: Finding Absolute Maximum and Minimum Values


Let z = f (x, y) be a continuous function of two variables defined on a closed, bounded set D, and assume f is
differentiable on D. To find the absolute maximum and minimum values of f on D, do the following:

1. Determine the critical points of f in D.

2. Calculate f at each of these critical points.

3. Determine the maximum and minimum values of f on the boundary of its domain.

4. The maximum and minimum values of f will occur at one of the values obtained in steps 2 and 3.

Finding the maximum and minimum values of f on the boundary of D can be challenging. If the boundary is a rectangle
or set of straight lines, then it is possible to parameterize the line segments and determine the maxima on each of these
segments, as seen in Example 4.40. The same approach can be used for other shapes such as circles and ellipses.
If the boundary of the set D is a more complicated curve defined by a function g(x, y) = c for some constant c, and
the first-order partial derivatives of g exist, then the method of Lagrange multipliers can prove useful for determining the
extrema of f on the boundary. The method of Lagrange multipliers is introduced in Lagrange Multipliers.

Example 4.40

Finding Absolute Extrema


448 Chapter 4 | Differentiation of Functions of Several Variables

Use the problem-solving strategy for finding absolute extrema of a function to determine the absolute extrema of
each of the following functions:
a. f (x, y) = x 2 − 2xy + 4y 2 − 4x − 2y + 24 on the domain defined by 0 ≤ x ≤ 4 and 0 ≤ y ≤ 2

b. g(x, y) = x 2 + y 2 + 4x − 6y on the domain defined by x 2 + y 2 ≤ 16

Solution
a. Using the problem-solving strategy, step 1 involves finding the critical points of f on its domain.
Therefore, we first calculate f x (x, y) and f y (x, y), then set them each equal to zero:

f x (x, y) = 2x − 2y − 4
f y (x, y) = −2x + 8y − 2.

Setting them equal to zero yields the system of equations


2x − 2y − 4 = 0
−2x + 8y − 2 = 0.

The solution to this system is x = 3 and y = 1. Therefore (3, 1) is a critical point of f . Calculating
f (3, 1) gives f (3, 1) = 17.
The next step involves finding the extrema of f on the boundary of its domain. The boundary of its
domain consists of four line segments as shown in the following graph:

Figure 4.52 Graph of the domain of the function


f (x, y) = x 2 − 2xy + 4y 2 − 4x − 2y + 24.

L 1 is the line segment connecting (0, 0) and (4, 0), and it can be parameterized by the equations
x(t) = t, y(t) = 0 for 0 ≤ t ≤ 4. Define g(t) = f ⎛⎝x(t), y(t)⎞⎠. This gives g(t) = t 2 − 4t + 24.
Differentiating g leads to g′ (t) = 2t − 4. Therefore, g has a critical value at t = 2, which corresponds
to the point (2, 0). Calculating f (2, 0) gives the z-value 20.
L 2 is the line segment connecting (4, 0) and (4, 2), and it can be parameterized by the equations
x(t) = 4, y(t) = t for 0 ≤ t ≤ 2. Again, define g(t) = f ⎛⎝x(t), y(t)⎞⎠. This gives g(t) = 4t 2 − 10t + 24.
⎛ ⎞
Then, g′ (t) = 8t − 10. g has a critical value at t = 5 , which corresponds to the point ⎝0, 5 ⎠.
4 4

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 449

⎛ ⎞
Calculating f ⎝0, 5 ⎠ gives the z-value 27.75.
4
L 3 is the line segment connecting (0, 2) and (4, 2), and it can be parameterized by the equations
x(t) = t, y(t) = 2 for 0 ≤ t ≤ 4. Again, define g(t) = f ⎛⎝x(t), y(t)⎞⎠. This gives g(t) = t 2 − 8t + 36.
The critical value corresponds to the point (4, 2). So, calculating f (4, 2) gives the z-value 20.
L 4 is the line segment connecting (0, 0) and (0, 2), and it can be parameterized by the equations
x(t) = 0, y(t) = t for 0 ≤ t ≤ 2. This time, g(t) = 4t 2 − 2t + 24 and the critical value t = 1
4
⎛ 1⎞ ⎛ 1⎞
correspond to the point ⎝0, ⎠. Calculating f ⎝0, ⎠ gives the z-value 23.75.
4 4
We also need to find the values of f (x, y) at the corners of its domain. These corners are located at
(0, 0), (4, 0), (4, 2) and (0, 2):

f (0, 0) = (0) 2 − 2(0)(0) + 4(0) 2 − 4(0) − 2(0) + 24 = 24


f (4, 0) = (4) 2 − 2(4)(0) + 4(0) 2 − 4(4) − 2(0) + 24 = 24
f (4, 2) = (4) 2 − 2(4)(2) + 4(2) 2 − 4(4) − 2(2) + 24 = 20
f (0, 2) = (0) 2 − 2(0)(2) + 4(2) 2 − 4(0) − 2(2) + 24 = 36.

The absolute maximum value is 36, which occurs at (0, 2), and the global minimum value is 20,
which occurs at both (4, 2) and (2, 0) as shown in the following figure.

Figure 4.53 The function f (x, y) has two global minima and one global maximum over its
domain.
450 Chapter 4 | Differentiation of Functions of Several Variables

b. Using the problem-solving strategy, step 1 involves finding the critical points of g on its domain.
Therefore, we first calculate g x (x, y) and g y (x, y), then set them each equal to zero:

g x (x, y) = 2x + 4
g y (x, y) = 2y − 6.

Setting them equal to zero yields the system of equations


2x + 4 = 0
2y − 6 = 0.

The solution to this system is x = −2 and y = 3. Therefore, (−2, 3) is a critical point of g.


Calculating g(−2, 3), we get

g(−2, 3) = (−2) 2 + 3 2 + 4(−2) − 6(3) = 4 + 9 − 8 − 18 = −13.

The next step involves finding the extrema of g on the boundary of its domain. The boundary of its
domain consists of a circle of radius 4 centered at the origin as shown in the following graph.

Figure 4.54 Graph of the domain of the function


g(x, y) = x 2 + y 2 + 4x − 6y.

The boundary of the domain of g can be parameterized using the functions x(t) = 4 cos t, y(t) = 4 sin t
for 0 ≤ t ≤ 2π. Define h(t) = g⎛⎝x(t), y(t)⎞⎠:

h(t) = g⎛⎝x(t), y(t)⎞⎠


= (4 cos t) 2 + (4 sin t) 2 + 4(4 cos t) − 6(4 sin t)
= 16cos 2 t + 16sin 2 t + 16 cos t − 24 sin t
= 16 + 16 cos t − 24 sin t.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 451

Setting h′ (t) = 0 leads to

−16 sin t − 24 cos t = 0


−16 sin t = 24 cos t
−16 sin t = 24 cos t
−16 cos t −16 cos t
tan t = − 3 .
2

⎛ ⎞
This equation has two solutions over the interval 0 ≤ t ≤ 2π. One is t = π − arctan⎝3 ⎠ and the other is
2
⎛ ⎞
t = 2π − arctan⎝3 ⎠. For the first angle,
2
⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞
sin t = sin⎝π − arctan⎝3 ⎠⎠ = sin⎝arctan⎝3 ⎠⎠ = 3 13
2 2 13
⎛ ⎛3 ⎞⎞ ⎛ ⎛3 ⎞⎞
cos t = cos⎝π − arctan⎝ ⎠⎠ = −cos⎝arctan⎝ ⎠⎠ = − 2 13 .
2 2 13

⎛ ⎞
Therefore, x(t) = 4 cos t = − 8 13 and y(t) = 4 sin t = 12 13 , so ⎝− 8 13 , 12 13 ⎠ is a critical
13 13 13 13
point on the boundary and

⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2 2
g⎝− 8 13 , 12 13 ⎠ = ⎝− 8 13 ⎠ + ⎝12 13 ⎠ + 4⎝− 8 13 ⎠ − 6⎝12 13 ⎠
13 13 13 13 13 13

= 144 + 64 − 32 13 − 72 13
13 13 13 13
= 208 − 104 13 ≈ −12.844.
13

For the second angle,


⎛ ⎛ ⎞⎞ ⎛ ⎛ ⎞⎞
sin t = sin⎝2π − arctan⎝3 ⎠⎠ = −sin⎝arctan⎝3 ⎠⎠ = − 3 13
2 2 13
⎛ ⎛3 ⎞⎞ ⎛ ⎛3 ⎞⎞ 2 13
cos t = cos⎝2π − arctan⎝ ⎠⎠ = cos⎝arctan⎝ ⎠⎠ = .
2 2 13

⎛ ⎞
Therefore, x(t) = 4 cos t = 8 13 and y(t) = 4 sin t = − 12 13 , so ⎝8 13 , − 12 13 ⎠ is a critical
13 13 13 13
point on the boundary and

⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2 2
g⎝8 13 , − 12 13 ⎠ = ⎝8 13 ⎠ + ⎝− 12 13 ⎠ + 4⎝8 13 ⎠ − 6⎝− 12 13 ⎠
13 13 13 13 13 13

= 144 + 64 + 32 13 + 72 13
13 13 13 13
= 208 + 104 13 ≈ 44.844.
13

The absolute minimum of g is −13, which is attained at the point (−2, 3), which is an interior point
of D. The absolute maximum of g is approximately equal to 44.844, which is attained at the boundary
452 Chapter 4 | Differentiation of Functions of Several Variables

⎛ ⎞
point ⎝8 13 , − 12 13 ⎠. These are the absolute extrema of g on D as shown in the following figure.
13 13

Figure 4.55 The function f (x, y) has a local minimum and a local maximum.

4.36 Use the problem-solving strategy for finding absolute extrema of a function to find the absolute extrema
of the function
f (x, y) = 4x 2 − 2xy + 6y 2 − 8x + 2y + 3

on the domain defined by 0 ≤ x ≤ 2 and −1 ≤ y ≤ 3.

Example 4.41

Chapter Opener: Profitable Golf Balls

Figure 4.56 (credit: modification of work by oatsy40, Flickr)

Pro- T company has developed a profit model that depends on the number x of golf balls sold per month

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 453

(measured in thousands), and the number of hours per month of advertising y, according to the function
z = f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2,

where z is measured in thousands of dollars. The maximum number of golf balls that can be produced and sold
is 50,000, and the maximum number of hours of advertising that can be purchased is 25. Find the values of x
and y that maximize profit, and find the maximum profit.

Solution
Using the problem-solving strategy, step 1 involves finding the critical points of f on its domain. Therefore, we
first calculate f x (x, y) and f y (x, y), then set them each equal to zero:

f x (x, y) = 48 − 2x − 2y
f y (x, y) = 96 − 2x − 18y.

Setting them equal to zero yields the system of equations


48 − 2x − 2y = 0
96 − 2x − 18y = 0.

The solution to this system is x = 21 and y = 3. Therefore (21, 3) is a critical point of f . Calculating
f (21, 3) gives f (21, 3) = 48(21) + 96(3) − 21 2 − 2(21)(3) − 9(3) 2 = 648.

The domain of this function is 0 ≤ x ≤ 50 and 0 ≤ y ≤ 25 as shown in the following graph.

Figure 4.57 Graph of the domain of the function


f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2.

L 1 is the line segment connecting (0, 0) and (50, 0), and it can be parameterized by the equations
x(t) = t, y(t) = 0 for 0 ≤ t ≤ 50. We then define g(t) = f x(t), y(t)⎞⎠:

g(t) = f ⎛⎝x(t), y(t)⎞⎠


= f (t, 0)
= 48t + 96(0) − y 2 − 2(t)(0) − 9(0) 2
= 48t − t 2.
Setting g′ (t) = 0 yields the critical point t = 24, which corresponds to the point (24, 0) in the domain of f .
454 Chapter 4 | Differentiation of Functions of Several Variables

Calculating f (24, 0) gives 576.

L 2 is the line segment connecting and (50, 25), and it can be parameterized by the equations
x(t) = 50, y(t) = t for 0 ≤ t ≤ 25. Once again, we define g(t) = f ⎛⎝x(t), y(t)⎞⎠:

g(t) = f ⎛⎝x(t), y(t)⎞⎠


= f (50, t)
= 48(50) + 96t − 50 2 − 2(50)t − 9t 2
= −9t 2 − 4t − 100.
⎛ ⎞
This function has a critical point at t = − 2 , which corresponds to the point ⎝50, − 2 ⎠. This point is not in
9 9
the domain of f .

L 3 is the line segment connecting (0, 25) and (50, 25), and it can be parameterized by the equations
x(t) = t, y(t) = 25 for 0 ≤ t ≤ 50. We define g(t) = f x(t), y(t)⎞⎠: ⎛

g(t) = f ⎛⎝x(t), y(t)⎞⎠


= f (t, 25)
= 48t + 96(25) − t 2 − 2t(25) − 9⎛⎝25 2⎞⎠
= −t 2 − 2t − 3225.
This function has a critical point at t = −1, which corresponds to the point (−1, 25), which is not in the
domain.
L 4 is the line segment connecting (0, 0) to (0, 25), and it can be parameterized by the equations
x(t) = 0, y(t) = t for 0 ≤ t ≤ 25. We define g(t) = f x(t), y(t)⎞⎠: ⎛

g(t) = f ⎛⎝x(t), y(t)⎞⎠


= f (0, t)
= 48(0) + 96t − (0) 2 − 2(0)t − 9t 2
= 96t − t 2.
⎛ ⎞
This function has a critical point at t = 16 , which corresponds to the point ⎝0, 16 ⎠, which is on the boundary
3 3
⎛ ⎞
of the domain. Calculating f ⎝0, 16 ⎠ gives 256.
3
We also need to find the values of f (x, y) at the corners of its domain. These corners are located at
(0, 0), (50, 0), (50, 25) and (0, 25):

f (0, 0) = 48(0) + 96(0) − (0) 2 − 2(0)(0) − 9(0) 2 = 0


f (50, 0) = 48(50) + 96(0) − (50) 2 − 2(50)(0) − 9(0) 2 = −100
f (50, 25) = 48(50) + 96(25) − (50) 2 − 2(50)(25) − 9(25) 2 = −5825
f (0, 25) = 48(0) + 96(25) − (0) 2 − 2(0)(25) − 9(25) 2 = −3225.

The maximum critical value is 648, which occurs at (21, 3). Therefore, a maximum profit of $648,000 is
realized when 21,000 golf balls are sold and 3 hours of advertising are purchased per month as shown in the
following figure.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 455

Figure 4.58 The profit function f (x, y) has a maximum at (21, 3, 648).
456 Chapter 4 | Differentiation of Functions of Several Variables

4.7 EXERCISES
For the following exercises, find all critical points. 329. f (x, y) = y 2 + xy + 3y + 2x + 3

310. f (x, y) = 1 + x 2 + y 2
330. f (x, y) = x 2 + xy + y 2 − 3x

311. f (x, y) = (3x − 2) 2 + (y − 4) 2


331. f (x, y) = x 2 + 2y 2 − x 2 y

312. f (x, y) = x 4 + y 4 − 16xy


332. f (x, y) = x 2 + y − e y

313. f (x, y) = 15x 3 − 3xy + 15y 3


−(x 2 + y 2 + 2x)
333. f (x, y) = e
For the following exercises, find the critical points of the
function by using algebraic techniques (completing the 334. f (x, y) = x 2 + xy + y 2 − x − y + 1
square) or by examining the form of the equation. Verify
your results using the partial derivatives test.
335. f (x, y) = x 2 + 10xy + y 2
314. f (x, y) = x 2 + y 2 + 1
336. f (x, y) = −x 2 − 5y 2 + 10x − 30y − 62
315. f (x, y) = −x 2 − 5y 2 + 8x − 10y − 13
337. f (x, y) = 120x + 120y − xy − x 2 − y 2
316. f (x, y) = x 2 + y 2 + 2x − 6y + 6
338. f (x, y) = 2x 2 + 2xy + y 2 + 2x − 3
317. f (x, y) = x 2 + y 2 + 1
339. f (x, y) = x 2 + x − 3xy + y 3 − 5
For the following exercises, use the second derivative test
to identify any critical points and determine whether each −x 2 − y 2
340. f (x, y) = 2xye
critical point is a maximum, minimum, saddle point, or
none of these.
For the following exercises, determine the extreme values
3 and the saddle points. Use a CAS to graph the function.
318. f (x, y) = −x + 4xy − 2y 2 + 1
341. [T] f (x, y) = ye x − e y
319. f (x, y) = x 2 y 2
342. [T] f (x, y) = x sin(y)
320. f (x, y) = x 2 − 6x + y 2 + 4y − 8
343. [T]
321. f (x, y) = 2xy + 3x + 4y f (x, y) = sin(x)sin(y), x ∈ (0, 2π), y ∈ (0, 2π)

322. f (x, y) = 8xy(x + y) + 7 Find the absolute extrema of the given function on the
indicated closed and bounded set R.
323. f (x, y) = x 2 + 4xy + y 2 344. f (x, y) = xy − x − 3y; R is the triangular region
with vertices (0, 0), (0, 4), and (5, 0).
324. f (x, y) = x 3 + y 3 − 300x − 75y − 3
345. Find the absolute maximum and minimum values
325. f (x, y) = 9 − x 4 y 4 of f (x, y) = x 2 + y 2 − 2y + 1 on the region

|
⎧ ⎫
R = ⎨⎩(x, y) x 2 + y 2 ≤ 4⎬⎭.
326. f (x, y) = 7x 2 y + 9xy 2

327. f (x, y) = 3x 2 − 2xy + y 2 − 8y 346. f (x, y) = x 3 − 3xy − y 3 on


R = (x, y): −2 ≤ x ≤ 2, −2 ≤ y ≤ 2
⎧ ⎫
⎨ ⎬
⎩ ⎭

2 2
328. f (x, y) = 3x + 2xy + y

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 457

−2y
347. f (x, y) = on
x + y2 + 1
2
⎧ ⎫
R = ⎨⎩(x, y): x 2 + y 2 ≤ 4⎬⎭

348. Find three positive numbers the sum of which is


27, such that the sum of their squares is as small as
possible.

349. Find the points on the surface x 2 − yz = 5 that are


closest to the origin.

350. Find the maximum volume of a rectangular box with


three faces in the coordinate planes and a vertex in the first
octant on the plane x + y + z = 1.

351. The sum of the length and the girth (perimeter of a


cross-section) of a package carried by a delivery service
cannot exceed 108 in. Find the dimensions of the
rectangular package of largest volume that can be sent.

352. A cardboard box without a lid is to be made with


a volume of 4 ft3. Find the dimensions of the box that
requires the least amount of cardboard.

353. Find the point on the surface


2 2
f (x, y) = x + y + 10 nearest the plane
x + 2y − z = 0. Identify the point on the plane.

354. Find the point in the plane 2x − y + 2z = 16 that is


closest to the origin.

355. A company manufactures two types of athletic shoes:


jogging shoes and cross-trainers. The total revenue from
x units of jogging shoes and y units of cross-trainers
is given by R(x, y) = −5x 2 − 8y 2 − 2xy + 42x + 102y,
where x and y are in thousands of units. Find the values
of x and y to maximize the total revenue.

356. A shipping company handles rectangular boxes


provided the sum of the length, width, and height of the box
does not exceed 96 in. Find the dimensions of the box that
meets this condition and has the largest volume.

357. Find the maximum volume of a cylindrical soda can


such that the sum of its height and circumference is 120
cm.
458 Chapter 4 | Differentiation of Functions of Several Variables

4.8 | Lagrange Multipliers


Learning Objectives
4.8.1 Use the method of Lagrange multipliers to solve optimization problems with one constraint.
4.8.2 Use the method of Lagrange multipliers to solve optimization problems with two
constraints.

Solving optimization problems for functions of two or more variables can be similar to solving such problems in single-
variable calculus. However, techniques for dealing with multiple variables allow us to solve more varied optimization
problems for which we need to deal with additional conditions or constraints. In this section, we examine one of the more
common and useful methods for solving optimization problems with constraints.

Lagrange Multipliers
Example 4.41 was an applied situation involving maximizing a profit function, subject to certain constraints. In that
example, the constraints involved a maximum number of golf balls that could be produced and sold in 1 month (x),
and a maximum number of advertising hours that could be purchased per month (y). Suppose these were combined
into a budgetary constraint, such as 20x + 4y ≤ 216, that took into account the cost of producing the golf balls
and the number of advertising hours purchased per month. The goal is, still, be to maximize profit, but now there
is a different type of constraint on the values of x and y. This constraint, when combined with the profit function
f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2, is an example of an optimization problem, and the function f (x, y) is called
the objective function. A graph of various level curves of the function f (x, y) follows.

Figure 4.59 Graph of level curves of the function


f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2 corresponding to
c = 150, 250, 350, and 400.

In Figure 4.59, the value c represents different profit levels (i.e., values of the function f ). As the value of c increases,
the curve shifts to the right. Since our goal is to maximize profit, we want to choose a curve as far to the right as possible.
If there was no restriction on the number of golf balls the company could produce, or the number of units of advertising
available, then we could produce as many golf balls as we want, and advertise as much as we want, and there would be
not be a maximum profit for the company. Unfortunately, we have a budgetary constraint that is modeled by the inequality
20x + 4y ≤ 216. To see how this constraint interacts with the profit function, Figure 4.60 shows the graph of the line
20x + 4y = 216 superimposed on the previous graph.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 459

Figure 4.60 Graph of level curves of the function


f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2 corresponding to
c = 150, 250, 350, and 395. The red graph is the constraint
function.

As mentioned previously, the maximum profit occurs when the level curve is as far to the right as possible. However, the
level of production corresponding to this maximum profit must also satisfy the budgetary constraint, so the point at which
this profit occurs must also lie on (or to the left of) the red line in Figure 4.60. Inspection of this graph reveals that this
point exists where the line is tangent to the level curve of f . Trial and error reveals that this profit level seems to be
around 395, when x and y are both just less than 5. We return to the solution of this problem later in this section.
From a theoretical standpoint, at the point where the profit curve is tangent to the constraint line, the gradient of both of
the functions evaluated at that point must point in the same (or opposite) direction. Recall that the gradient of a function
of more than one variable is a vector. If two vectors point in the same (or opposite) directions, then one must be a constant
multiple of the other. This idea is the basis of the method of Lagrange multipliers.

Theorem 4.20: Method of Lagrange Multipliers: One Constraint


Let f and g be functions of two variables with continuous partial derivatives at every point of some open set
containing the smooth curve g(x, y) = 0. Suppose that f , when restricted to points on the curve g(x, y) = 0,
has a local extremum at the point (x 0, y 0) and that ∇ g(x 0, y 0) ≠ 0. Then there is a number λ called a Lagrange
multiplier, for which
∇ f (x 0, y 0) = λ∇ g(x 0, y 0).

Proof
Assume that a constrained extremum occurs at the point (x 0, y 0). Furthermore, we assume that the equation g(x, y) = 0
can be smoothly parameterized as
x = x(s) and y = y(s)

where s is an arc length parameter with reference point (x 0, y 0) at s = 0. Therefore, the quantity z = f ⎛⎝x(s), y(s)⎞⎠ has a

relative maximum or relative minimum at s = 0, and this implies that dz = 0 at that point. From the chain rule,
ds
dz = ∂ f · ∂ x + ∂ f · ∂ y = ⎛∂ f i + j ∂ x ⎞ + ⎛∂ f · ∂ y ⎞ = 0,
ds ∂ x ∂ s ∂ y ∂ s ⎝ ∂ x ∂ s ⎠ ⎝∂ y ∂ s ⎠

where the derivatives are all evaluated at s = 0. However, the first factor in the dot product is the gradient of f , and the
second factor is the unit tangent vector T(0) to the constraint curve. Since the point (x 0, y 0) corresponds to s = 0, it
follows from this equation that
460 Chapter 4 | Differentiation of Functions of Several Variables

∇ f (x 0, y 0) · T(0) = 0,

which implies that the gradient is either 0 or is normal to the constraint curve at a constrained relative extremum. However,
the constraint curve g(x, y) = 0 is a level curve for the function g(x, y) so that if ∇ g(x 0, y 0) ≠ 0 then ∇ g(x 0, y 0) is
normal to this curve at (x 0, y 0) It follows, then, that there is some scalar λ such that

∇ f (x 0, y 0) = λ∇ g(x 0, y 0)


To apply Method of Lagrange Multipliers: One Constraint to an optimization problem similar to that for the golf
ball manufacturer, we need a problem-solving strategy.

Problem-Solving Strategy: Steps for Using Lagrange Multipliers


1. Determine the objective function f (x, y) and the constraint function g(x, y). Does the optimization problem
involve maximizing or minimizing the objective function?
2. Set up a system of equations using the following template:
∇ f (x 0, y 0) = λ∇ g(x 0, y 0)
g(x 0, y 0) = 0.
3. Solve for x 0 and y 0.

4. The largest of the values of f at the solutions found in step 3 maximizes f ; the smallest of those values
minimizes f .

Example 4.42

Using Lagrange Multipliers

Use the method of Lagrange multipliers to find the minimum value of f (x, y) = x 2 + 4y 2 − 2x + 8y subject to
the constraint x + 2y = 7.

Solution
Let’s follow the problem-solving strategy:
1. The optimization function is f (x, y) = x 2 + 4y 2 − 2x + 8y. To determine the constraint function, we
must first subtract 7 from both sides of the constraint. This gives x + 2y − 7 = 0. The constraint
function is equal to the left-hand side, so g(x, y) = x + 2y − 7. The problem asks us to solve for the
minimum value of f , subject to the constraint (see the following graph).

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 461

Figure 4.61 Graph of level curves of the function


f (x, y) = x 2 + 4y 2 − 2x + 8y corresponding to c = 10 and
26. The red graph is the constraint function.

2. We then must calculate the gradients of both f and g:


∇ f (x, y) = (2x − 2)i + ⎛⎝8y + 8⎞⎠j
∇ g(x, y) = i + 2j.

The equation ∇ f (x 0, y 0) = λ∇ g(x 0, y 0) becomes



2x 0 − 2⎞⎠i + ⎛⎝8y 0 + 8⎞⎠j = λ⎛⎝i + 2j⎞⎠,

which can be rewritten as



⎝ 2x 0 − 2⎞⎠i + ⎛⎝8y 0 + 8⎞⎠j = λi + 2λj.

Next, we set the coefficients of i and j equal to each other:

2x 0 − 2 = λ
8y 0 + 8 = 2λ.

The equation g(x 0, y 0) = 0 becomes x 0 + 2y 0 − 7 = 0. Therefore, the system of equations that needs
to be solved is
2x 0 − 2 = λ
8y 0 + 8 = 2λ
x 0 + 2y 0 − 7 = 0.
3. This is a linear system of three equations in three variables. We start by solving the second equation for
λ and substituting it into the first equation. This gives λ = 4y 0 + 4, so substituting this into the first
equation gives
2x 0 − 2 = 4y 0 + 4.

Solving this equation for x 0 gives x 0 = 2y 0 + 3. We then substitute this into the third equation:
462 Chapter 4 | Differentiation of Functions of Several Variables


2y 0 + 3⎞⎠ + 2y 0 − 7 = 0

4y 0 − 4 = 0
y 0 = 1.

Since x 0 = 2y 0 + 3, this gives x 0 = 5.

4. Next, we substitute (5, 1) into f (x, y) = x 2 + 4y 2 − 2x + 8y, gives


f (5, 1) = 5 2 + 4(1) 2 − 2(5) + 8(1) = 27. To ensure this corresponds to a minimum value on the
constraint function, let’s try some other values, such as the intercepts of g(x, y) = 0, Which are (7, 0)
and (0, 3.5). We get f (7, 0) = 35 and f (0, 3.5) = 77, so it appears f has a minimum at (5, 1).

4.37 Use the method of Lagrange multipliers to find the maximum value of
f (x, y) = 9x 2 + 36xy − 4y 2 − 18x − 8y subject to the constraint 3x + 4y = 32.

Let’s now return to the problem posed at the beginning of the section.

Example 4.43

Golf Balls and Lagrange Multipliers

The golf ball manufacturer, Pro-T, has developed a profit model that depends on the number x of golf balls sold
per month (measured in thousands), and the number of hours per month of advertising y, according to the function
z = f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2,

where z is measured in thousands of dollars. The budgetary constraint function relating the cost of the production
of thousands golf balls and advertising units is given by 20x + 4y = 216. Find the values of x and y that
maximize profit, and find the maximum profit.

Solution
Again, we follow the problem-solving strategy:
1. The optimization function is f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2. To determine the constraint
function, we first subtract 216 from both sides of the constraint, then divide both sides by 4, which gives
5x + y − 54 = 0. The constraint function is equal to the left-hand side, so g(x, y) = 5x + y − 54. The
problem asks us to solve for the maximum value of f , subject to this constraint.

2. So, we calculate the gradients of both f and g:

∇ f (x, y) = ⎛⎝48 − 2x − 2y⎞⎠i + ⎛⎝96 − 2x − 18y⎞⎠j


∇ g(x, y) = 5i + j.

The equation ∇ f (x 0, y 0) = λ∇ g(x 0, y 0) becomes



⎝48 − 2x 0 − 2y 0⎞⎠i + ⎛⎝96 − 2x 0 − 18y 0⎞⎠j = λ⎛⎝5i + j⎞⎠,

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 463

which can be rewritten as



⎝48 − 2x 0 − 2y 0⎞⎠i + ⎛⎝96 − 2x 0 − 18y 0⎞⎠j = λ5i + λj.

We then set the coefficients of i and j equal to each other:

48 − 2x 0 − 2y 0 = 5λ
96 − 2x 0 − 18y 0 = λ.

The equation g(x 0, y 0) = 0 becomes 5x 0 + y 0 − 54 = 0. Therefore, the system of equations that needs
to be solved is
48 − 2x 0 − 2y 0 = 5λ
96 − 2x 0 − 18y 0 = λ
5x 0 + y 0 − 54 = 0.
3. We use the left-hand side of the second equation to replace λ in the first equation:

48 − 2x 0 − 2y 0 = 5⎛⎝96 − 2x 0 − 18y 0⎞⎠


48 − 2x 0 − 2y 0 = 480 − 10x 0 − 90y 0
8x 0 = 432 − 88y 0
x0 = 54 − 11y 0.

Then we substitute this into the third equation:


5⎛⎝54 − 11y 0⎞⎠ + y 0 − 54 = 0
270 − 55y 0 + y 0 = 0
216 − 54y 0 = 0
y 0 = 4.

Since x 0 = 54 − 11y 0, this gives x 0 = 10.

4. We then substitute (10, 4) into f (x, y) = 48x + 96y − x 2 − 2xy − 9y 2, which gives

f (10, 4) = 48(10) + 96(4) − (10) 2 − 2(10)(4) − 9(4) 2


= 480 + 384 − 100 − 80 − 144 = 540.

Therefore the maximum profit that can be attained, subject to budgetary constraints, is $540,000 with
a production level of 10,000 golf balls and 4 hours of advertising bought per month. Let’s check to
make sure this truly is a maximum. The endpoints of the line that defines the constraint are (10.8, 0) and
(0, 54) Let’s evaluate f at both of these points:

f (10.8, 0) = 48(10.8) + 96(0) − 10.8 2 − 2(10.8)(0) − 9⎛⎝0 2⎞⎠ = 401.76


f (0, 54) = 48(0) + 96(54) − 0 2 − 2(0)(54) − 9⎛⎝54 2⎞⎠ = −21, 060.

The second value represents a loss, since no golf balls are produced. Neither of these values exceed 540,
so it seems that our extremum is a maximum value of f .
464 Chapter 4 | Differentiation of Functions of Several Variables

4.38 A company has determined that its production level is given by the Cobb-Douglas function
f (x, y) = 2.5x 0.45 y 0.55 where x represents the total number of labor hours in 1 year and y represents the total
capital input for the company. Suppose 1 unit of labor costs $40 and 1 unit of capital costs $50. Use the
method of Lagrange multipliers to find the maximum value of f (x, y) = 2.5x 0.45 y 0.55 subject to a budgetary
constraint of $500,000 per year.

In the case of an optimization function with three variables and a single constraint function, it is possible to use the method
of Lagrange multipliers to solve an optimization problem as well. An example of an optimization function with three
variables could be the Cobb-Douglas function in the previous example: f (x, y, z) = x 0.2 y 0.4 z 0.4, where x represents
the cost of labor, y represents capital input, and z represents the cost of advertising. The method is the same as for the
method with a function of two variables; the equations to be solved are
∇ f (x, y, z) = λ∇ g(x, y, z)
g(x, y, z) = 0.

Example 4.44

Lagrange Multipliers with a Three-Variable Optimization Function

Maximize the function f (x, y, z) = x 2 + y 2 + z 2 subject to the constraint x + y + z = 1.

Solution
1. The optimization function is f (x, y, z) = x 2 + y 2 + z 2. To determine the constraint function, we
subtract 1 from each side of the constraint: x + y + z − 1 = 0 which gives the constraint function as
g(x, y, z) = x + y + z − 1.

2. Next, we calculate ∇ f (x, y, z) and ∇ g(x, y, z):

∇ f (x, y, z) = 〈 2x, 2y, 2z 〉


∇ g(x, y, z) = 〈 1, 1, 1 〉 .

This leads to the equations


〈 2x 0, 2y 0, 2z 0 〉 = λ 〈 1, 1, 1 〉
x0 + y0 + z0 − 1 = 0

which can be rewritten in the following form:


2x 0 = λ
2y 0 = λ
2z 0 = λ
x0 + y0 + z0 − 1 = 0.
3. Since each of the first three equations has λ on the right-hand side, we know that 2x 0 = 2y 0 = 2z 0
and all three variables are equal to each other. Substituting y 0 = x 0 and z 0 = x 0 into the last equation

yields 3x 0 − 1 = 0, so x 0 = 1 and y 0 = 1 and z 0 = 1 which corresponds to a critical point on the


3 3 3
constraint curve.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 465

⎛ ⎞
4. Then, we evaluate f at the point ⎝1 , 1 , 1 ⎠:
3 3 3

⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2 2 2
f ⎝1 , 1 , 1 ⎠ = ⎝1 ⎠ + ⎝1 ⎠ + ⎝1 ⎠ = 3 = 1 .
3 3 3 3 3 3 9 3

Therefore, an extremum of the function is 1 . To verify it is a minimum, choose other points that satisfy
3
the constraint and calculate f at that point. For example,

f (1, 0, 0) = 1 2 + 0 2 + 0 2 = 1
f (0, −2, 3) = 0 2 + + (−2) 2 + 3 2 = 13.

Both of these values are greater than 1 , leading us to believe the extremum is a minimum.
3

4.39 Use the method of Lagrange multipliers to find the minimum value of the function
f (x, y, z) = x + y + z

subject to the constraint x 2 + y 2 + z 2 = 1.

Problems with Two Constraints


The method of Lagrange multipliers can be applied to problems with more than one constraint. In this case the optimization
function, w is a function of three variables:
w = f (x, y, z)

and it is subject to two constraints:


g(x, y, z) = 0 and h(x, y, z) = 0.

There are two Lagrange multipliers, λ 1 and λ 2, and the system of equations becomes

∇ f (x 0, y 0, z 0) = λ 1∇ g(x 0, y 0, z 0) + λ 2∇ h(x 0, y 0, z 0)
g(x 0, y 0, z 0) = 0
h(x 0, y 0, z 0) = 0.

Example 4.45

Lagrange Multipliers with Two Constraints

Find the maximum and minimum values of the function


f (x, y, z) = x 2 + y 2 + z 2

subject to the constraints z 2 = x 2 + y 2 and x + y − z + 1 = 0.

Solution
466 Chapter 4 | Differentiation of Functions of Several Variables

Let’s follow the problem-solving strategy:


1. The optimization function is f (x, y, z) = x 2 + y 2 + z 2. To determine the constraint functions, we
first subtract z 2 from both sides of the first constraint, which gives x 2 + y 2 − z 2 = 0, so
g(x, y, z) = x 2 + y 2 − z 2. The second constraint function is h(x, y, z) = x + y − z + 1.

2. We then calculate the gradients of f , g, and h:

∇ f (x, y, z) = 2xi + 2yj + 2zk


∇ g(x, y, z) = 2xi + 2yj − 2zk
∇ h(x, y, z) = i + j − k.

The equation ∇ f (x 0, y 0, z 0) = λ 1∇ g(x 0, y 0, z 0) + λ 2∇ h(x 0, y 0, z 0) becomes

2x 0 i + 2y 0 j + 2z 0 k = λ 1 ⎛⎝2x 0 i + 2y 0 j − 2z 0 k⎞⎠ + λ 2 ⎛⎝i + j − k⎞⎠,

which can be rewritten as


2x 0 i + 2y 0 j + 2z 0 k = ⎛⎝2λ 1 x 0 + λ 2⎞⎠i + ⎛⎝2λ 1 y 0 + λ 2⎞⎠j − ⎛⎝2λ 1 z 0 + λ 2⎞⎠k.

Next, we set the coefficients of i and j equal to each other:

2x 0 = 2λ 1 x 0 + λ 2
2y 0 = 2λ 1 y 0 + λ 2
2z 0 = −2λ 1 z 0 − λ 2.

The two equations that arise from the constraints are z 0 2 = x 0 2 + y 0 2 and x 0 + y 0 − z 0 + 1 = 0.
Combining these equations with the previous three equations gives
2x 0 = 2λ 1 x 0 + λ 2
2y 0 = 2λ 1 y 0 + λ 2
2z 0 = −2λ 1 z 0 − λ 2
z0 2 = x0 2 + y0 2
x 0 + y 0 − z 0 + 1 = 0.
3. The first three equations contain the variable λ 2. Solving the third equation for λ 2 and replacing into
the first and second equations reduces the number of equations to four:
2x 0 = 2λ 1 x 0 − 2λ 1 z 0 − 2z 0
2y 0 = 2λ 1 y 0 − 2λ 1 z 0 − 2z 0
z0 2 = x0 2 + y0 2
x 0 + y 0 − z 0 + 1 = 0.

x +z
Next, we solve the first and second equation for λ 1. The first equation gives λ 1 = x 0 − z 0 , the second
0 0
y +z
equation gives λ 1 = y 0 − z 0 . We set the right-hand side of each equation equal to each other and cross-
0 0
multiply:

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 467

x0 + z0 y0 + z0
x0 − z0 = y0 − z0
(x 0 + z 0)(y 0 − z 0) = (x 0 − z 0)(y 0 + z 0)
x 0 y 0 − x 0 z 0 + y 0 z 0 − z 0 2 = x 0 y 0 + x 0 z 0 − y 0 z 0 − z 0 2.
2y 0 z 0 − 2x 0 z 0 = 0
2z 0 (y 0 − x 0) = 0.

Therefore, either z 0 = 0 or y 0 = x 0. If z 0 = 0, then the first constraint becomes 0 = x 0 2 + y 0 2.


The only real solution to this equation is x 0 = 0 and y 0 = 0, which gives the ordered triple (0, 0, 0).
This point does not satisfy the second constraint, so it is not a solution.
Next, we consider y 0 = x 0, which reduces the number of equations to three:
y0 = x0
z0 2 = x0 2 + y0 2
x 0 + y 0 − z 0 + 1 = 0.

We substitute the first equation into the second and third equations:
z0 2 = x0 2 + x0 2
x 0 + x 0 − z 0 + 1 = 0.

Then, we solve the second equation for z 0, which gives z 0 = 2x 0 + 1. We then substitute this into the
first equation,
z 0 2 = 2x 0 2

⎝2x 0 + 1⎞⎠ 2 = 2x 0 2
4x 0 2 + 4x 0 + 1 = 2x 0 2
2x 0 2 + 4x 0 + 1 = 0,

and use the quadratic formula to solve for x 0 :

−4 ± 4 2 − 4(2)(1) −4 ± 8 −4 ± 2 2
x0 = = = = −1 ± 2 .
2(2) 4 4 2

Recall y 0 = x 0, so this solves for y 0 as well. Then, z 0 = 2x 0 + 1, so

⎛ ⎞
z 0 = 2x 0 + 1 = 2⎝−1 ± 2 ⎠ + 1 = −2 + 1 ± 2 = −1 ± 2.
2

Therefore, there are two ordered triplet solutions:


⎛ 2 2 ⎞ ⎛ ⎞
⎝−1 + 2 , −1 + 2 , −1 + 2⎠ and ⎝−1 − 2 , −1 − 2 , −1 − 2⎠.
2 2
⎛ ⎞
4. We substitute ⎝−1 + 2 , −1 + 2 , −1 + 2⎠ into f (x, y, z) = x 2 + y 2 + z 2, which gives
2 2
468 Chapter 4 | Differentiation of Functions of Several Variables

⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2 2
f ⎝−1 + 2 , −1 + 2 , −1 + 2⎠ = ⎝−1 + 2 ⎠ + ⎝−1 + 2 ⎠ + ⎛⎝−1 + 2⎞⎠ 2
2 2 2 2
⎛ ⎞ ⎛ ⎞
= ⎝1 − 2 + 1 ⎠ + ⎝1 − 2 + 1 ⎠ + ⎛⎝1 − 2 2 + 2⎞⎠
2 2
= 6 − 4 2.

⎛ ⎞
Then, we substitute ⎝−1 − 2 , −1 − 2 , −1 − 2⎠ into f (x, y, z) = x 2 + y 2 + z 2, which gives
2 2

⎛ ⎞ ⎛ ⎞ ⎛ ⎞
2 2
f ⎝−1 − 2 , −1 − 2 , −1 − 2⎠ = ⎝−1 − 2 ⎠ + ⎝−1 − 2 ⎠ + (−1 − 2) 2
2 2 2 2
⎛ ⎞ ⎛ ⎞
= ⎝1 + 2 + 1 ⎠ + ⎝1 + 2 + 1 ⎠ + ⎛⎝1 + 2 2 + 2⎞⎠
2 2
= 6 + 4 2.

6 + 4 2 is the maximum value and 6 − 4 2 is the minimum value of f (x, y, z), subject to the given
constraints.

4.40 Use the method of Lagrange multipliers to find the minimum value of the function
f (x, y, z) = x 2 + y 2 + z 2

subject to the constraints 2x + y + 2z = 9 and 5x + 5y + 7z = 29.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 469

4.8 EXERCISES
For the following exercises, use the method of Lagrange 376. Maximize f (x, y) = 6 − x 2 − y 2, x + y − 2 = 0.
multipliers to find the maximum and minimum values of
the function subject to the given constraints.
377. Minimize
2 2 2
358. f (x, y) = x 2 y; x 2 + 2y 2 = 6 f (x, y, z) = x + y + z , x + y + z = 1.

359. f (x, y, z) = xyz, x 2 + 2y 2 + 3z 2 = 6 378. Minimize f (x, y) = x 2 − y 2 subject to the


constraint x − 2y + 6 = 0.
360. f (x, y) = xy; 4x 2 + 8y 2 = 16
379. Minimize f (x, y, z) = x 2 + y 2 + z 2 when
3 2 2 2
361. f (x, y) = 4x + y ; 2x + y = 1 x + y + z = 9 and x + 2y + 3z = 20.

362. f (x, y, z) = x 2 + y 2 + z 2, x 4 + y 4 + z 4 = 1 For the next group of exercises, use the method of Lagrange
multipliers to solve the following applied problems.
363. f (x, y, z) = yz + xy, xy = 1, y 2 + z 2 = 1 380. A pentagon is formed by placing an isosceles triangle
on a rectangle, as shown in the diagram. If the perimeter of
364. f (x, y) = x 2 + y 2, (x − 1) 2 + 4y 2 = 4 the pentagon is 10 in., find the lengths of the sides of the
pentagon that will maximize the area of the pentagon.
2 y2
365. f (x, y) = 4xy, x + =1
9 16

366. f (x, y, z) = x + y + z, 1x + 1y + 1z = 1

367. f (x, y, z) = x + 3y − z, x 2 + y 2 + z 2 = 4

368. f (x, y, z) = x 2 + y 2 + z 2, xyz = 4

369. Minimize f (x, y) = x 2 + y 2 on the hyperbola


xy = 1.
381. A rectangular box without a top (a topless box) is
370. Minimize f (x, y) = xy on the ellipse to be made from 12 ft2 of cardboard. Find the maximum
b 2 x 2 + a 2 y 2 = a 2 b 2. volume of such a box.

382. Find the minimum and maximum distances between


371. Maximize f (x, y, z) = 2x + 3y + 5z on the sphere
the ellipse x 2 + xy + 2y 2 = 1 and the origin.
x 2 + y 2 + z 2 = 19.
383. Find the
point on the surface
f (x, y) = x 2 − y 2; x > 0, y > 0; 2 2
372. Maximize g(x, y) = y − x 2 = 0 x − 2xy + y − x + y = 0 closest to the point
(1, 2, −3).

373. The curve x 3 − y 3 = 1 is asymptotic to the line


y = x. Find the point(s) on the curve x 3 − y 3 = 1 farthest
from the line y = x.

374. Maximize U(x, y) = 8x 4/5 y 1/5; 4x + 2y = 12

375. Minimize f (x, y) = x 2 + y 2, x + 2y − 5 = 0.


470 Chapter 4 | Differentiation of Functions of Several Variables

384. Show that, of all the triangles inscribed in a circle 393. [T] By investing x units of labor and y units of
of radius R (see diagram), the equilateral triangle has the capital, a watch manufacturer can produce
0.4 0.6
largest perimeter. P(x, y) = 50x y watches. Find the maximum
number of watches that can be produced on a budget of
$20,000 if labor costs $100/unit and capital costs $200/
unit. Use a CAS to sketch a contour plot of the function.

385. Find the minimum distance from point (0, 1) to the


parabola x 2 = 4y.

386. Find the minimum distance from the parabola


2
y = x to point (0, 3).

387. Find the minimum distance from the plane


x + y + z = 1 to point (2, 1, 1).

388. A large container in the shape of a rectangular solid


must have a volume of 480 m3. The bottom of the
container costs $5/m2 to construct whereas the top and
sides cost $3/m2 to construct. Use Lagrange multipliers to
find the dimensions of the container of this size that has the
minimum cost.

389. Find the point on the line y = 2x + 3 that is closest


to point (4, 2).

390. Find the point on the plane 4x + 3y + z = 2 that is


closest to the point (1, −1, 1).

391. Find the maximum value of f (x, y) = sin x sin y,


where x and y denote the acute angles of a right triangle.
Draw the contours of the function using a CAS.

392. A rectangular solid is contained within a tetrahedron


with vertices at (1, 0, 0), (0, 1, 0), (0, 0, 1), and the
origin. The base of the box has dimensions x, y, and
the height of the box is z. If the sum of x, y, and z is
1.0, find the dimensions that maximizes the volume of the
rectangular solid.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 471

CHAPTER 4 REVIEW
KEY TERMS
boundary point a point P 0 of R is a boundary point if every δ disk centered around P 0 contains points both inside
and outside R

closed set a set S that contains all its boundary points

connected set an open set S that cannot be represented as the union of two or more disjoint, nonempty open subsets

constraint an inequality or equation involving one or more variables that is used in an optimization problem; the
constraint enforces a limit on the possible solutions for the problem
contour map a plot of the various level curves of a given function f (x, y)

critical point of a function of two variables the point (x 0, y 0) is called a critical point of f (x, y) if one of the two
following conditions holds:
1. f x (x 0, y 0) = f y (x 0, y 0) = 0

2. At least one of f x (x 0, y 0) and f y (x 0, y 0) do not exist

differentiable a function f (x, y) is differentiable at (x 0, y 0) if f (x, y) can be expressed in the form


f (x, y) = f (x 0, y 0) + f x(x 0, y 0)(x − x 0) + f y(x 0, y 0)(y − y 0) + E(x, y),
E(x, y)
where the error term E(x, y) satisfies lim =0
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2

directional derivative the derivative of a function in the direction of a given unit vector
discriminant the discriminant of the function f (x, y) is given by the formula
D = f xx(x 0, y 0) f yy(x 0, y 0) − ⎛⎝ f xy(x 0, y 0)⎞⎠ 2

function of two variables a function z = f (x, y) that maps each ordered pair (x, y) in a subset D of ℝ 2 to a unique
real number z

generalized chain rule the chain rule extended to functions of more than one independent variable, in which each
independent variable may depend on one or more other variables
gradient the gradient of the function f (x, y) is defined to be ∇ f (x, y) = ⎛⎝∂ f /∂ x⎞⎠i + ⎛⎝∂ f /∂ y⎞⎠ j, which can be
generalized to a function of any number of independent variables
graph of a function of two variables a set of ordered triples (x, y, z) that satisfies the equation z = f (x, y) plotted
in three-dimensional Cartesian space
higher-order partial derivatives second-order or higher partial derivatives, regardless of whether they are mixed
partial derivatives
interior point a point P 0 of R is a boundary point if there is a δ disk centered around P 0 contained completely in R

intermediate variable given a composition of functions (e.g., f ⎛⎝x(t), y(t)⎞⎠), the intermediate variables are the
variables that are independent in the outer function but dependent on other variables as well; in the function
f ⎛⎝x(t), y(t)⎞⎠, the variables x and y are examples of intermediate variables

Lagrange multiplier the constant (or constants) used in the method of Lagrange multipliers; in the case of one constant,
it is represented by the variable λ

level curve of a function of two variables the set of points satisfying the equation f (x, y) = c for some real
472 Chapter 4 | Differentiation of Functions of Several Variables

number c in the range of f

level surface of a function of three variables the set of points satisfying the equation f (x, y, z) = c for some real
number c in the range of f

linear approximation given a function f (x, y) and a tangent plane to the function at a point (x 0, y 0), we can
approximate f (x, y) for points near (x 0, y 0) using the tangent plane formula

method of Lagrange multipliers a method of solving an optimization problem subject to one or more constraints
mixed partial derivatives second-order or higher partial derivatives, in which at least two of the differentiations are
with respect to different variables
objective function the function that is to be maximized or minimized in an optimization problem
open set a set S that contains none of its boundary points

optimization problem calculation of a maximum or minimum value of a function of several variables, often using
Lagrange multipliers
partial derivative a derivative of a function of more than one independent variable in which all the variables but one are
held constant
partial differential equation an equation that involves an unknown function of more than one independent variable
and one or more of its partial derivatives
region an open, connected, nonempty subset of ℝ 2

saddle point given the function z = f (x, y), the point ⎛⎝x 0, y 0, f (x 0, y 0)⎞⎠ is a saddle point if both f x (x 0, y 0) = 0
and f y (x 0, y 0) = 0, but f does not have a local extremum at (x 0, y 0)

surface the graph of a function of two variables, z = f (x, y)

tangent plane given a function f (x, y) that is differentiable at a point (x 0, y 0), the equation of the tangent plane to
the surface z = f (x, y) is given by z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)

total differential the total differential of the function f (x, y) at (x 0, y 0) is given by the formula
dz = f x (x 0, y 0)dx + f y (x 0, y 0)dy

tree diagram illustrates and derives formulas for the generalized chain rule, in which each independent variable is
accounted for
vertical trace the set of ordered triples (c, y, z) that solves the equation f (c, y) = z for a given constant x = c or the
set of ordered triples (x, d, z) that solves the equation f (x, d) = z for a given constant y = d

δ ball all points in ℝ 3 lying at a distance of less than δ from (x , y , z )


0 0 0

δ disk an open disk of radius δ centered at point (a, b)

KEY EQUATIONS
• Vertical trace
f (a, y) = z for x = a or f (x, b) = z for y = b

• Level surface of a function of three variables


f (x, y, z) = c

• Partial derivative of f with respect to x


∂f f ⎛x + h, y⎞⎠ − f (x, y)
= lim ⎝
∂x h → 0 h

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 473

• Partial derivative of f with respect to y


∂f f ⎛x, y + k⎞⎠ − f (x, y)
= lim ⎝
∂y k → 0 k

• Tangent plane
z = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)

• Linear approximation
L(x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0)

• Total differential
dz = f x (x 0, y 0)dx + f y (x 0, y 0)dy.

• Differentiability (two variables)


f (x, y) = f (x 0, y 0) + f x (x 0, y 0)(x − x 0) + f y (x 0, y 0)(y − y 0) + E(x, y),
where the error term E satisfies
E(x, y)
lim = 0.
(x, y) → (x 0, y 0) (x − x 0) 2 + (y − y 0) 2

• Differentiability (three variables)


f (x, y) = f (x 0, y 0, z 0) + f x (x 0, y 0, z 0)(x − x 0) + f y (x 0, y 0, z 0)(y − y 0)
+ f z (x 0, y 0, z 0)(z − z 0) + E(x, y, z),
where the error term E satisfies
E(x, y, z)
lim = 0.
(x, y, z) → (x 0, y 0, z 0) (x − x 0) + (y − y 0) 2 + (z − z 0) 2
2

• Chain rule, one independent variable


dz = ∂ z · dx + ∂ z · dy
dt ∂ x dt ∂ y dt

• Chain rule, two independent variables


dz = ∂ z · ∂ x + ∂ z · ∂ y
du ∂ x ∂ u ∂ y ∂ u
dz = ∂ z · ∂ x + ∂ z · ∂ y
dv ∂ x ∂ v ∂ y ∂ v

• Generalized chain rule


∂ w = ∂ w ∂ x1 + ∂ w ∂ x1 + ⋯ + ∂ w ∂ xm
∂ t j ∂ x1 ∂ t j ∂ x2 ∂ t j ∂ xm ∂ t j

• directional derivative (two dimensions)


f (a + h cos θ, b + h sin θ) − f (a, b)
D u f (a, b) = lim
h→0 h
or
D u f (x, y) = f x (x, y)cos θ + f y (x, y)sin θ

• gradient (two dimensions)


∇ f (x, y) = f x (x, y)i + f y (x, y)j

• gradient (three dimensions)


∇ f (x, y, z) = f x (x, y, z)i + f y (x, y, z)j + f z (x, y, z)k

• directional derivative (three dimensions)


D u f (x, y, z) = ∇ f (x, y, z) · u
= f x (x, y, z)cos α + f y (x, y, z)cos β + f x (x, y, z)cos γ

• Discriminant
474 Chapter 4 | Differentiation of Functions of Several Variables

D = f xx (x 0, y 0) f yy (x 0, y 0) − ⎛⎝ f xy (x 0, y 0)⎞⎠ 2

• Method of Lagrange multipliers, one constraint


∇ f (x 0, y 0) = λ∇ g(x 0, y 0)
g(x 0, y 0) = 0

• Method of Lagrange multipliers, two constraints


∇ f (x 0, y 0, z 0) = λ 1∇ g(x 0, y 0, z 0) + λ 2∇ h(x 0, y 0, z 0)
g(x 0, y 0, z 0) = 0
h(x 0, y 0, z 0) = 0

KEY CONCEPTS
4.1 Functions of Several Variables

• The graph of a function of two variables is a surface in ℝ 3 and can be studied using level curves and vertical traces.
• A set of level curves is called a contour map.

4.2 Limits and Continuity

• To study limits and continuity for functions of two variables, we use a δ disk centered around a given point.
• A function of several variables has a limit if for any point in a δ ball centered at a point P, the value of the
function at that point is arbitrarily close to a fixed value (the limit value).
• The limit laws established for a function of one variable have natural extensions to functions of more than one
variable.
• A function of two variables is continuous at a point if the limit exists at that point, the function exists at that point,
and the limit and function are equal at that point.

4.3 Partial Derivatives

• A partial derivative is a derivative involving a function of more than one independent variable.
• To calculate a partial derivative with respect to a given variable, treat all the other variables as constants and use the
usual differentiation rules.
• Higher-order partial derivatives can be calculated in the same way as higher-order derivatives.

4.4 Tangent Planes and Linear Approximations

• The analog of a tangent line to a curve is a tangent plane to a surface for functions of two variables.
• Tangent planes can be used to approximate values of functions near known values.
• A function is differentiable at a point if it is ”smooth” at that point (i.e., no corners or discontinuities exist at that
point).
• The total differential can be used to approximate the change in a function z = f (x 0, y 0) at the point (x 0, y 0) for
given values of Δx and Δy.

4.5 The Chain Rule

• The chain rule for functions of more than one variable involves the partial derivatives with respect to all the
independent variables.
• Tree diagrams are useful for deriving formulas for the chain rule for functions of more than one variable, where
each independent variable also depends on other variables.

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2


Chapter 4 | Differentiation of Functions of Several Variables 475

4.6 Directional Derivatives and the Gradient

• A directional derivative represents a rate of change of a function in any given direction.


• The gradient can be used in a formula to calculate the directional derivative.
• The gradient indicates the direction of greatest change of a function of more than one variable.

4.7 Maxima/Minima Problems

• A critical point of the function f (x, y) is any point (x 0, y 0) where either f x (x 0, y 0) = f y (x 0, y 0) = 0, or at


least one of f x (x 0, y 0) and f y (x 0, y 0) do not exist.

• A saddle point is a point (x 0, y 0) where f x (x 0, y 0) = f y (x 0, y 0) = 0, but (x 0, y 0) is neither a maximum nor a


minimum at that point.
• To find extrema of functions of two variables, first find the critical points, then calculate the discriminant and apply
the second derivative test.

4.8 Lagrange Multipliers

• An objective function combined with one or more constraints is an example of an optimization problem.
• To solve optimization problems, we apply the method of Lagrange multipliers using a four-step problem-solving
strategy.

CHAPTER 4 REVIEW EXERCISES


For the following exercises, determine whether the For the following exercises, evaluate the following limits,
statement is true or false. Justify your answer with a proof if they exist. If they do not exist, prove it.
or a counterexample. 4xy
3
400. lim
394. The domain of f (x, y) = x sin −1
(y) is x = all (x, y) → (1, 1) x − 2y 2

real numbers, and −π ≤ y ≤ π.


4xy
401. lim
395. If the function f (x, y) is continuous everywhere, (x, y) → (0, 0) x − 2y 2

then f xy = f yx.
For the following exercises, find the largest interval of
continuity for the function.
396. The linear approximation to the function of
f (x, y) = 5x 2 + x tan(y)at (2, π) is given by 402. f (x, y) = x 3 sin −1 (y)
L(x, y) = 22 + 21(x − 2) + (y − π).
403. g(x, y) = ln⎛⎝4 − x 2 − y 2⎞⎠
⎛3 9 ⎞
397. ⎝4 , 16 ⎠ is a critical point of
For the following exercises, find all first partial derivatives.
g(x, y) = 4x 3 − 2x 2 y + y 2 − 2.
404. f (x, y) = x 2 − y 2
For the following exercises, sketch the function in one
graph and, in a second, sketch several level curves. 405. u(x, y) = x 4 − 3xy + 1, x = 2t, y = t 3
⎛ ⎞
−⎝x 2 + 2y 2⎠
398. f (x, y) = e .
For the following exercises, find all second partial
derivatives.
399. f (x, y) = x + 4y 2. 406. g(t, x) = 3t 2 − sin(x + t)
476 Chapter 4 | Differentiation of Functions of Several Variables

3 2y 419. A machinist is constructing a right circular cone out


407. h(x, y, z) = x ze of a block of aluminum. The machine gives an error of 5%
in height and 2% in radius. Find the maximum error in the
For the following exercises, find the equation of the tangent volume of the cone if the machinist creates a cone of height
plane to the specified surface at the given point. 6 cm and radius 2 cm.
408. z = x 3 − 2y 2 + y − 1 at point (1, 1, −1)
420. A trash compactor is in the shape of a cuboid.
Assume the trash compactor is filled with incompressible
409. 3z 3 = e x + 2y at point (0, 1, 3) liquid. The length and width are decreasing at rates of 2
ft/sec and 3 ft/sec, respectively. Find the rate at which the
liquid level is rising when the length is 14 ft, the width is
2
410. Approximate f (x, y) = e x + y at (0.1, 9.1). 10 ft, and the height is 4 ft.
Write down your linear approximation function L(x, y).
How accurate is the approximation to the exact answer,
rounded to four digits?

411. Find the differential dz of


2
h(x, y) = 4x + 2xy − 3y and approximate Δz at the
point (1, −2). Let Δx = 0.1 and Δy = 0.01.

412. Find the


directional derivative of
2 2
f (x, y) = x + 6xy − y in the direction v = i + 4j.

413. Find the maximal directional derivative magnitude


and direction for the function
f (x, y) = x 3 + 2xy − cos(πy) at point (3, 0).

For the following exercises, find the gradient.


414. c(x, t) = e(t − x) 2 + 3 cos(t)

x + y2
415. f (x, y) = xy

For the following exercises, find and classify the critical


points.
416. z = x 3 − xy + y 2 − 1

For the following exercises, use Lagrange multipliers to


find the maximum and minimum values for the functions
with the given constraints.
417. f (x, y) = x 2 y, x 2 + y 2 = 4

418. f (x, y) = x 2 − y 2, x + 6y = 4

This OpenStax book is available for free at http://cnx.org/content/col11966/1.2

You might also like