15.2 Partial Derivatives

15.2 Partial Derivatives
Question 1: How do you take a first partial derivative of a function?
Question 2: What do the first partial derivatives of a function tell us?
Question 3: How do you take the second partial derivative of a function?
In earlier chapters we learned how to take the derivative of a function of one variable.
This process helped us to the rate at which these functions changed. For instance,
suppose a business’s profit function for a product is
P( x)  11x 2  220 x  100 thousand dollars where x is the number of units sold in thousands. The derivative if this function is
P  x   22 x  220 If the derivative is evaluated at some point like x  6 , it indicates how fast the profit is
changing when that many units are sold. In this case,
P  6   22  6   220  88 means that profit is increasing by $88 per unit.
If a business’s profit comes from more than one product, the profit function will be a
function of several variables. If the business produces x thousand units of one product
and y thousand units of another, its profit function might be
P( x, y )  11x 2  220 x  16 y 2  160 y  500 thousand dollars Despite this extra variable, we can still determine the rate at which this function is
changing using partial derivatives.
1
Question 1: How do you take a first partial derivative of a function?
When we take the derivative of a multivariable function, we have a choice as to which
variable we will take the derivative with respect to. If z  f  x, y  , we may take the
derivative with respect to x or with respect to y. To symbolize that we will take a
derivative with respect to a particular variable, we’ll modify the
d
notation we used in
dx
earlier chapters. Derivatives of functions of several variables are called partial
derivatives.
Partial Derivative Notation
If z  f  x, y  is a function of two variables, the partial
derivatives of the function are indicated using


and
.
y
x
1. The partial derivative with respect to x may be written as
f z

,
, or
 f  x, y   .
x 
x x
2. The partial derivative with respect to y may be written as

f z
, or
 f  x, y   .
,
y y
y 
When we take the derivative with respect to a particular variable, all other variables are
held constant. For instance, let’s examine the partial derivatives of z  x 2 y 3 . When we
take the partial derivative with respect to x, the variables y is held constant. This means
that we can treat it like constants and move it through the derivative operation.
2
z  2 3
  x y 
x x 
 y3 
 2
x 
x    y3  2x
Since y is a constant, it may be moved through
the derivative just like any number
Use the Power Rule for Derivatives to take the
derivative with respect to x
 2 xy 3
The partial derivative with respect to y is calculated by assuming that x is a constant.
z  2 3
  x y 
y y 
 x2 
 3
y 
y    x2  3 y2
Since x is a constant, it may be moved through
the derivative
Use the Power Rule for Derivatives to take the
derivative with respect to y
 3x 2 y 2
With some practice, you may be able to carry out the calculation without showing each
of these steps. However, initially it is a good idea to show them to emphasize what is
being held constant.
When we hold all variables but one constant, we turn the problem into problems similar
to what we carried out in earlier chapters. This means all of the rules and techniques we
used to compute derivatives in those chapters may be applied to partial derivatives.
Example 1
Partial Derivatives
If z  2 x 2  5 xy  y 2  12 , find
z
z
and
.
y
x
Solution To find the partial derivative with respect to x, assume that y is
a constant. Apply the usual derivative rules to yield
3
z 
  2 x 2  5 xy  y 2  12 
x x




  2 x 2   5 xy    y 2   12
x
x
x
x
 2
 2

 x   5 y   x   0  0
x
x
 2  2 x  5 y 1
Apply Sum and Difference
Rules for Derivatives to take
the derivative of each term.
Move constants outside of
derivatives. The last two terms
are zero since they consist of
derivatives of constants.
 4x  5 y
To find the partial derivative with respect to y, assume that x is a
constant.
z 
  2 x 2  5 xy  y 2  12 
y y




  2 x 2   5 xy    y 2   12
y
y
y
y
 0  5x 


 y    y 2   0
y
y
 5 x 1  2 y
 5 x  2 y
Apply Sum and Difference
Rules for Derivatives to take
the derivative of each term.
Move constants outside of
derivatives. The first and last
terms are zero since they
consist of derivatives of
constants.
The ∂ notation for partial derivatives is not universal. Several other notations are also
used in business, finance, and economics.
4
Alternate Notation for Partial Derivatives
If z  f  x, y  , subscripts may be used to indicate partial
derivatives.
1. The partial derivative with respect to x is also called f x ,
f x  x, y  , or z x .
2. The partial derivative with respect to y is also called f y ,
f y  x, y  , or z y .
The subscript notation is useful when we want to evaluate the partial derivative at some
value of x and y. If we want to evaluate the partial derivative, the values are put in place
of x and y:
f x  2,1  the partial derivative with respect to x evaluated at x  2, y  1 Using the other notations, we can indicate the same thing,
z
z
 2,1 ,
x
x
, or
 2,1
z
x
x 2
y 1
In each case, find then partial derivative indicated first. Then substitute the appropriate
values for each variable.
Example 2
Partial Derivatives
Suppose f  x, y  
x2
 2x  4 y .
y
a. Find f x  x, y  .
5
Solution Apply the derivative rules to find the partial derivative with
respect to x. Remember that y is assumed to be constant.
f x  x, y  

  x2
 2x  4 y

x  y


  x2  

 2 x  4 y 


x  y  x
x

1  2

  x   2   x   0
y x
x

1
 2 x  2 1
y

2x
2
y
Use the Sum and Difference
Rules for Derivatives
Move all constants outside of
the derivatives. Note that the
third term is constant with
respect to x so its derivative
is 0
b. Find f x  2,1
Solution Set x  2 and y  1 to give
f x  2,1 
2  2
26
1
c. Find f y  x, y  .
Solution Hold x constant to give
6
f y  x, y  


  x2
 2x  4 y

y  y

  x2  

   2 x  4 y 
y  y  y
y
 1

 x     0  4   y
y  y 
y
Think of
2
 x2 

Use the Sum and Difference
Rules for Derivatives
1
y
1
as y . Note that
the second term is constant with
respect to y so its derivative is 0
1
4
y2
x2
4
y2
d. Find f y  2,1 .
Solution Set x  2 and y  1 to give
f y  2,1  
22
 4  8
12
Other derivative rules may also be used to find derivatives involving products, quotients,
or compositions.
Example 3
Product Rule
Suppose g ( x, y )   x  y  e x .
a. Find g x  x, y  .
Solution Assume y is a constant and apply the Product Rule for
Derivatives. Start by defining the two parts of the product:
g ( x, y )   x  y   e x   
u
v
7
The derivatives in the Product Rule are evaluated assuming that y is a
constant.
u  x y
v  ex

u  1
v  e x
The Product Rule results in
g x  x, y    e x    1    x  y  e x 
  


v
u
u
v
b. Find g y  x, y  .
Solution Even though it appears that the Product Rule might be needed,
remember that x is a constant when taking the partial derivative with
respect to y. This means that e x is constant and may be brought outside
of the derivative,
g y  x, y  

 x  y  e x 
y
 ex 

 x  y
y
x
Move the constant e outside of the
derivative since it is a constant.
 


 ex   x   y  
y
 y

 e x  0  1
The derivative with respect to y of x is
zero since it is a constant.
 ex
Example 4
Apply the Sum Rule for Derivative.
Chain Rule
If w  x, y    x 3  2 xy  , find
3
w
.
y
8
Solution In a partial derivative derivative with respect to y, x is assumed
to be constant. The function can be viewed as a composition f  g  y  
where g  y   x3  2 xy and f  y   y 3 . The derivatives of each function
are
g y   2x
f  y   3y2
Apply the Chain Rule to give
2
w
 3  x 3  2 xy   2 x 




y 
f  g  y  
g  y 
9
Question 2: What do the partial derivatives of a function tell us?
In the last question, we calculated the partial derivatives of f ( x, y ) 
x2
 2x  4 y . A
y
portion of this surface is graphed in Figure 1.
Figure 1 – The surface
f ( x, y ) 
x2
 2 x  4 y and the point (2, 1, 4) on
y
that surface.
The partial derivatives with respect to x at x  2 and y  1 is
f x  x, y  
2x
2
y

f x  2,1 
2  2
 2  6 1
The sign of the partial derivative is positive. Following what we learned in earlier
chapters, this must indicate that the function is increasing in one direction. To see this,
let’s look at a slice of this function.
The blue line represents a slice of the function in the x direction located at y  1 . As x
values increase (moving right to left), the function gets larger. This can be seen more
clearly by setting y  1 in the function,
10
f  x,1  x 2  2 x  4 The slope of the tangent line at x  2 is 6.
z
f  x,1
x
Figure 2 - The slope of the tangent line at x = 2 is equal to
f x  2,1 .
This is the value of the partial derivative with respect to x at the point x  2 and y  1 . It
also indicates the rate at which z changes along the slice where y is fixed.
Rate of Change
If y is held constant on the function z  f  x, y  , then
f x  x, y  gives the rate of change of z with respect to x.
If x is held constant on the function z  f  x, y  , then
f y  x, y  gives the rate of change of z with respect to y.
On a graph, these rates may be visualized as the slope of a
tangent line on a slice where either x or y is fixed.
11
Example 5
Interpret a Partial Derivative
Suppose f ( x, y ) 
x2
 2 x  4 y . Earlier in this section, we found that
y
f y  x, y   
x2
4 
y2
f y  2,1  
22
 4  8
12
Interpret the value of the partial derivative along the slice x  2
illustrated below.
Solution Since the value of the partial derivative with respect to y is
negative, z must be decreasing as y increases along the slice. To see
this graphically, we need to note that the red line is a slice in the y
direction. The equation of of the slice is obtained by setting x  2 ,
f (2, y ) 

22
 22  4y
y
4
 4  4y
y
12
z
f  2, y 
y
Visually. we can see that the function is decreasing. The slope of the
tangent line at y  1 is -6.
The derivative of a function of one variable may also be interpreted in terms of
economics and finance. At the beginning of this section, we introduced a profit function
with two variables. Depending on the partial derivative taken, we can determine the rate
at which profit is changing when production of one product or the other is increased.
Example 6
Profit
A business produces x thousand units of product A and y thousand
units of product B. Its profit function is
P ( x, y )  11x 2  220 x  16 y 2  160 y  500 thousand dollars
Use the profit function to answer the parts below.
a. Find and interpret P  5,9  .
Solution Set x  5 and y  9 in the function,
13
P (5,9)  11  52  220  5  16  9 2  160  9  500
 469 thousand dollars
This tells you that when 5000 units of product A and 9000 units of
product B are produced and sold, the profit is $469,000.
b. Find and interpret Px  5,9  .
Solution Hold y constant and calculate the partial derivative with
respect to x,
Px  x, y   11 
 2

 x   220   x 
x
x
 11 2 x  220 1
The derivative of each of the
other terms is zero since they
are constants
 22 x  220
Now set x  5 and y  9 in the partial derivative to yield
Px  5,9   22  5  220  110
Since this function indicates how profit P changes as the number of
units of product A increased, the units on this rate are
110
thousands of dollars
dollars
 110
thousands of units of product A
units of product A
This means that if production of product A is increased by 1 unit, the
profit will increase by $110.
c. Find and interpret Py  5,9  .
Solution Hold x constant and calculate the partial derivative with respect
to y,
14
Py  x, y   16 


 y 2   160   y 
y
y
 16  2 y  160 1
 32 y  160
Now substitute the numbers into the partial derivative,
Py  5,9   32  9  160  128
If the production of product B increases by 1 unit, the profit will
decrease by $128.
This example demonstrates the process for calculating how the profit changes when the
production of one product is increased (holding the other constant). In earlier chapters,
we learned that this is called marginal profit. In the context of multivariable functions,
partial derivatives also represent margins. However we also need to specify the input
which will change in the marginal profit. In part a of Example 6, we might state that the
marginal profit with respect to product A is $110 per unit of product A. Similar margins
may be calculated for other functions like revenue, cost, and productivity.
15
Question 3: How do you take the second partial derivative of a function?
In functions of one variable, the second derivative is simply the derivative of the first
derivative. For instance, if g ( x)  x3  2 x 2 then the first derivative is
g   x   3x 2  4 x
Taking another derivative yields
g   x   6 x  4 For functions of more than one variable, more variables mean more possibilities for the
first derivative. Suppose f  x, y   x3  x 2 y  y 3 . If y is held constant, the first derivative
with respect to x is
f x  x, y   3x 2  2 xy The second derivative may be taken with respect to x again to give
f xx  x, y   6 x  2 y Or we could take a partial derivative of f x  x, y  with respect to y to give
f xy  x, y   2 x The first partial derivative with respect to x yields two different second partial
derivatives. The first partial derivative with respect to y also yields two second partial
derivatives, f yy  x, y  and f yx  x, y  .
In total, there are four possible second partial derivatives for a function of two variables.
There are also several notations used to name them.
16
Second Partial Derivatives
The function z  f  x, y  has four possible second partial
derivatives (if they exist). They are indicated by
f xx  x, y   z xx 
  z   2 z

x  x  x 2
f xy  x, y   z xy 
  z   2 z

y  x  yx
f yy  x, y   z yy 
  z   2 z

y  y  y 2
  z   2 z
f yx  x, y   z yx    
x  y  xy
For continuous functions, the partial derivatives f xy  x, y  and f yx  x, y  are equal.
Example 7
Second Partial Derivatives
For the function f  x, y   x3  x 2 y  y 3 , find f yy  x, y  and f yx  x, y  .
Solution If x is held constant, the first derivative with respect to y is
f y  x, y   x 2  3 y 2
Remember, since x is constant the partial derivative of x3 is zero. If we
continue to hold x constant and take another partial derivative with
respect to y, we get
f yy  x, y   6 y
17
If we hold y constant in f y  x, y  and take the partial derivaitve with
respect to x, we get
f yx  x, y   2 x
Note that f yx  x, y   f xy  x, y  as expected.
Example 8
Second Partial Derivatives
If z  ln( xy )  x 2 y 4 , find all second partial derivatives.
Solution The partial derivative with respect to x is
z 1
  y  2 xy 2
x xy

1
 2 xy 2
x
where the Chain Rule is used to find the derivative of the first term. If
we take the derivative with respect to x again, we get
2 z
1
  2  2 y2
2
x
x
If we take the derivative with respect to y, we get
2 z
 4y
yx
The first partial derivative with respect to y is
z 1
  x  4 xy
y xy

1
 4 xy
y
18
Taking another partial derivative with respect to y gives
2 z
1
  2  4x
2
y
y
Taking a partial derivative with respect to x of the first partial derivative
with respect to y leads to
2 z
 4y
xy
For functions of one variable, the second derivative is a tool which may be used to
determine whether a critical number corresponds to a relative maximum or relative
minimum. Second partial derivatives play a similar role in functions of two variables. In
the next section we will use them to determine whether a surface has a relative
maximum or minimum.
19