You are on page 1of 30

Intermediate Mathematics

Introduction to Partial
Differentiation
R Horan & M Lavelle

The aim of this document is to provide a short, self


assessment programme for students who wish to acquire
a basic understanding of partial differentiation.

Copyright
c 2004 rhoran@plymouth.ac.uk , mlavelle@plymouth.ac.uk

Last Revision Date: May 25, 2005 Version 1.0


Table of Contents
1. Partial Differentiation (Introduction)
2. The Rules of Partial Differentiation
3. Higher Order Partial Derivatives
4. Quiz on Partial Derivatives
Solutions to Exercises
Solutions to Quizzes

The full range of these packages and some instructions,


should they be required, can be obtained from our web
page Mathematics Support Materials.
Section 1: Partial Differentiation (Introduction) 3

1. Partial Differentiation (Introduction)


In the package on introductory differentiation, rates of change
of functions were shown to be measured by the derivative. Many
applications require functions with more than one variable: the ideal
gas law, for example, is
pV = kT
where p is the pressure, V the volume, T the absolute temperature of
the gas, and k is a constant. Rearranging this equation as
kT
p=
V
shows that p is a function of T and V . If one of the variables, say T ,
is kept fixed and V changes, then the derivative of p with respect to
V measures the rate of change of pressure with respect to volume. In
this case, it is called the partial derivative of p with respect to V and
written as
∂p
.
∂V
Section 1: Partial Differentiation (Introduction) 4

kT
Example 1 If p = , find the partial derivatives of p:
V
(a) with respect to T , (b) with respect to V .

Solution
(a) This part of the example proceeds as follows:
kT
p = ,
V
∂p k
∴ = ,
∂T V
where V is treated as a constant for this calculation.
(b) For this part, T is treated as a constant. Thus
1
p = kT = kT V −1 ,
V
∂p kT
∴ = −kT V −2 = − 2 .
∂V V
Section 1: Partial Differentiation (Introduction) 5

The symbol ∂ is used whenever a function with more than one variable
is being differentiated but the techniques of partial differentiation are
exactly the same as for (ordinary) differentiation.
∂z ∂z
Example 2 Find and for the function z = x2 y 3 .
∂x ∂y
Solution
z = x2 y 3 For the first part y 3 is treated as
∂z a constant and the derivative of
∴ = 2xy 3 ,
∂x x2 with respect to x is 2x.
∂z For the second part x2 is treated
and = x2 3y 2 ,
∂y as a constant and the derivative
2 2
= 3x y . of y 3 with respect to y is 3y 2 .

∂z ∂z
Exercise 1. Find and for each of the following functions.
∂x ∂y
(Click on the green letters for solutions.)
1
(a) z = x2 y 4 , (b) z = (x4 + x2 )y 3 , (c) z = y 2 sin(x).
Section 2: The Rules of Partial Differentiation 6

2. The Rules of Partial Differentiation


Since partial differentiation is essentially the same as ordinary differ-
entiation, the product, quotient and chain rules may be applied.
∂z
Example 3 Find for each of the following functions.
∂x
x−y
(a) z = xy cos(xy) , (b) z = , (c) z = (3x + y)2 .
x+y
Solution
(a) Here z = uv, where u = xy and v = cos(xy) so the product rule
applies (see the package on the Product and Quotient Rules).

u = xy and v = cos(xy)
∂u ∂v
∴ = y and = −y sin(xy) .
∂x ∂x
Thus
∂z ∂u ∂v
= v+u = y cos(xy) − xy 2 sin(xy) .
∂x ∂x ∂x
Section 2: The Rules of Partial Differentiation 7

(b) Here z = u/v, where u = x − y and v = x + y so the quotient rule


applies (see the package on the Product and Quotient Rules).
u = x−y and v = x+y
∂u ∂v
∴ = 1 and = 1.
∂x ∂x
Thus ∂u ∂v
∂z v −u
= ∂x ∂x
∂x v2
(x + y) − (x − y) 2y
= = .
(x + y)2 (x + y)2
(c) In this case z = (3x + y)2 so z = u2 where u = 3x + y, and the
chain rule applies (see the package on the Chain Rule).
z = u2 and u = 3x + y
∂z ∂u
∴ = 2u and = 3.
∂u ∂x
Thus ∂z ∂z ∂u
= = 2(3x + y)3 = 6(3x + y) .
∂x ∂u ∂x
Section 2: The Rules of Partial Differentiation 8

∂z ∂z
Exercise 2. Find and for each of the following functions.
∂x ∂y
(Click on the green letters for solutions.)
cos(x)
(a) z = (x2 +3x) sin(y), (b) z = , (c) z = ln(xy),
y5
2
+y 2 )
(d) z = sin(x) cos(xy), (e) z = e(x , (f) z = sin(x2 + y).

Quiz If z = cos(xy), which of the following statements is true?

∂z ∂z ∂z 1 ∂z
(a) = , (b) = ,
∂x ∂y ∂x x ∂y
1 ∂z ∂z 1 ∂z 1 ∂z
(c) = , (d) = .
y ∂x ∂y y ∂x x ∂y
Section 3: Higher Order Partial Derivatives 9

3. Higher Order Partial Derivatives


Derivatives of order two and higher were introduced in the package on
Maxima and Minima. Finding higher order derivatives of functions
of more than one variable is similar to ordinary differentiation.
∂2z 3 2
Example 4 Find if z = e(x +y ) .
∂x2
Solution First differentiate z with respect to x, keeping y constant,
then differentiate this function with respect to x, again keeping y
constant. 3 2
z = e(x +y )
∂z 3 2
∴ = 3x2 e(x +y ) using the chain rule
∂x
(x3 +y 2 )
∂2z ∂(3x2 ) (x3 +y2 ) 2 ∂(e )
= e + 3x using the product rule
∂x2 ∂x ∂x
2
∂ z 3 2 3 2

2
= 6xe(x +y ) + 3x2 (3x2 e(x +y ) )
∂x
3 2
= (9x4 + 6x)e(x +y )
Section 3: Higher Order Partial Derivatives 10

∂2z ∂2z
In addition to both and , when there are two variables there
∂x2 ∂y 2
is also the possibility of a mixed second order derivative.
∂2z 3 2
Example 5 Find if z = e(x +y ) .
∂x∂y
∂2z
 
∂ ∂z
Solution The symbol is interpreted as ; in words,
∂x∂y ∂x ∂y
first differentiate z with respect to y, keeping x constant, then differ-
entiate this function with respect to x, keeping y constant. (It is this
differentiation, first with respect to x and then with respect to y, that
leads to the name of mixed derivative.)
∂z 3 2
First with x constant = 2ye(x +y ) (using the chain rule.)
∂y
∂2z ∂  (x3 +y2 ) 
Second with y constant = 2ye
∂x∂y ∂x
3
+y 2 )
= 3x2 2ye(x
3
+y 2 )
= 6x2 ye(x .
Section 3: Higher Order Partial Derivatives 11

The obvious question now to be answered is: what happens if the


order of differentiation is reversed?

∂2z
 
∂ ∂z 3 2
Example 6 Find = if z = e(x +y ) .
∂y∂x ∂y ∂x
Solution
∂z 3 2
First with y constant = 3x2 e(x +y ) (using the chain rule).
∂x
∂2z ∂  2 (x3 +y2 ) 
Second with x constant = 3x e
∂y∂x ∂y
3
+y 2 )
= 2y3x2 e(x
3
+y 2 )∂2z
= 6x2 ye(x = .
∂x∂y
As a general rule, when calculating mixed derivatives the order of
differentiation may be reversed without affecting the final result.
Section 3: Higher Order Partial Derivatives 12

Exercise 3. Confirm the statement on the previous page by finding


∂2z ∂2z
both and for each of the following functions, whose first
∂x∂y ∂y∂x
order partial derivatives have already been found in exercise 2. (Click
on the green letters for solutions.)
cos(x)
(a) z = (x2 +3x) sin(y), (b) z = , (c) z = ln(xy),
y5
2 2
(d) z = sin(x) cos(xy), (e) z = e(x +y ) , (f) z = sin(x2 + y).

Notation For first and second order partial derivatives there is a


∂f ∂f
compact notation. Thus can be written as fx and as fy .
∂x ∂y
∂2f ∂2f
Similarly 2
is written fxx while is written fxy .
∂x ∂x∂y

Quiz If z = e−y sin(x), which of the following is zxx + zyy ?


(a) e−y sin(x), (b) 0, (c) −e−y sin(x), (d) −e−y cos(x).
Section 4: Quiz on Partial Derivatives 13

4. Quiz on Partial Derivatives


Choose the correct option for each of the following.
Begin Quiz
∂z
1. If z = x2 + 3xy + y 3 then is
∂x
(a) 2x + 3y + 3y 2 , (b) 2x + 3x + 3y 2 ,
(c) 2x + 3x , (d) 2x + 3y .
2. If w = 1/r, where r2 = x2 + y 2 + z 2 , then xwx + ywy + zwz is
(a) −1/r , (b) 1/r , (c) −1/r2 , (d) 1/r2 .
x
r
3. If u = then uxx is
y
1 1 1 1
(a) − p , (b) − p , (c) − p , (d) − p .
3
4 y x 3 4 yx3 3
8 y x 3 8 yx3

End Quiz
Solutions to Exercises 14

Solutions to Exercises
∂z
Exercise 1(a) To calculate the partial derivative of the function
∂x
z = x2 y 4 , the factor y 4 is treated as a constant:
∂z ∂ ∂
x2 y 4 = x2 × y 4 = 2x(2−1) × y 4 = 2xy 4 .
 
=
∂x ∂x ∂x
∂z
Similarly, to find the partial derivative , the factor x2 is treated
∂y
as a constant:
∂z ∂ ∂
x2 y 4 = x2 × y 4 = x2 × 4y (4−1) = 4x2 y 3 .
 
=
∂y ∂y ∂y
Click on the green square to return

Solutions to Exercises 15

∂z
Exercise 1(b) To calculate for the function z = (x4 + x2 )y 3 , the
∂x
factor y 3 is treated as a constant:
∂z ∂ ∂
(x4 + x2 )y 3 = x4 + x2 × y 3 = (4x3 + 2x)y 3 .
 
=
∂x ∂x ∂x
∂z
To find the partial derivative the factor (x4 + x2 ) is treated as a
∂y
constant:
∂z ∂ ∂ 3
(x4 + x2 )y 3 = (x4 + x2 ) × y = 3(x4 + x2 )y 2 .

=
∂y ∂y ∂y
Click on the green square to return

Solutions to Exercises 16

1 ∂z 1
Exercise 1(c) If z = y 2 sin(x) then to calculate the y 2 factor is
∂x
kept constant:
∂z ∂  1  1 ∂ 1
= y 2 sin(x) = y 2 × (sin(x)) = y 2 cos(x) .
∂x ∂x ∂x
∂z
Similarly, to evaluate the partial derivative the factor sin(x) is
∂y
treated as a constant:
∂z ∂  1  ∂ 1 1 1
= y 2 sin(x) = y 2 × sin(x) = y − 2 sin(x) .
∂y ∂y ∂y 2
Click on the green square to return

Solutions to Exercises 17

Exercise 2(a) The function z = (x2 + 3x) sin(y) can be written as


z = uv , where u = (x2 + 3x) and v = sin(y) . The partial derivatives
of u and v with respect to the variable x are
∂u ∂v
= 2x + 3 , = 0,
∂x ∂x
while the partial derivatives with respect to y are
∂u ∂v
= 0, = cos(y) .
∂y ∂y
Applying the product rule
∂z ∂u ∂v
= v+u = (2x + 3) sin(y) .
∂x ∂x ∂x
∂z ∂u ∂v
= v+u = (x2 + 3x) cos(y) .
∂y ∂y ∂y
Click on the green square to return

Solutions to Exercises 18

Exercise 2(b)
cos(x)
The function z = can be written as z = cos(x)y −5 .
y5
Treating the factor y −5 as a constant and differentiating with respect
to x:

∂z sin(x)
= − sin(x)y −5 = − 5 .
∂x y
Treating cos(x) as a constant and differentiating with respect to y:

∂v cos(x)
= cos(x)(−5y −6 ) = −5 .
∂y y6

Click on the green square to return



Solutions to Exercises 19

Exercise 2(c) The function z = ln(xy) can be rewritten as (see the


package on logarithms)
z = ln(xy) = ln(x) + ln(y) .
Thus the partial derivative of z with respect to x is
∂z ∂ ∂ 1
= (ln(x) + ln(y)) = ln(x) = .
∂x ∂x ∂x x
Similarly the partial derivative of z with respect to y is
∂z ∂ ∂ 1
= (ln(x) + ln(y)) = ln(y) = .
∂y ∂y ∂y y
Click on the green square to return

Solutions to Exercises 20

Exercise 2(d) To calculate the partial derivatives of the function


z = sin(x) cos(xy) the product rule has to be applied
∂z ∂ ∂
= cos(xy) sin(x) + sin(x) cos(xy) ,
∂x ∂x ∂x
∂z ∂ ∂
= cos(xy) sin(x) + sin(x) cos(xy) .
∂y ∂y ∂y
Using the chain rule with u = xy for the partial derivatives of cos(xy)
∂ ∂ cos(u) ∂u
cos(xy) = = − sin(u)y = −y sin(xy) ,
∂x ∂u ∂x
∂ ∂ cos(u) ∂u
cos(xy) = = − sin(u)x = −x sin(xy) .
∂y ∂u ∂y
Thus the partial derivatives of z = sin(x) cos(xy) are
∂z ∂z
= cos(xy) cos(x) − y sin(x) sin(xy) , = −x sin(x) sin(xy) .
∂x ∂y
Click on the green square to return

Solutions to Exercises 21
2
+y 2 )
Exercise 2(e) To calculate the partial derivatives of z = e(x the
chain rule has to be applied with u = (x2 + y 2 ):
∂z ∂ u ∂u ∂u
= (e ) = eu ,
∂x ∂u ∂x ∂x
∂z ∂ u ∂u ∂u
= (e ) = eu .
∂y ∂u ∂y ∂y
The partial derivatives of u = (x2 + y 2 ) are
∂u ∂(x2 ) ∂u ∂(y 2 )
= = 2x , = = 2y .
∂x ∂x ∂y ∂y
2
+y 2 )
Therefore the partial derivatives of the function z = e(x are
∂z ∂u 2 2
= eu = 2x e(x +y ) ,
∂x ∂x
∂z u ∂u 2 2
= e = 2y e(x +y ) .
∂x ∂x
Click on the green square to return

Solutions to Exercises 22

Exercise 2(f ) Applying the chain rule with u = x2 + y the partial


derivatives of the function z = sin(x2 + y) can be written as
∂z ∂ ∂u ∂u
= (sin(u)) = cos(u) ,
∂x ∂u ∂x ∂x
∂z ∂ ∂u ∂u
= (sin(u)) = cos(u) .
∂y ∂u ∂y ∂y
The partial derivatives of u = x2 + y are
∂u ∂x2 ∂u ∂y
= = 2x , = = 1.
∂x ∂x ∂y ∂y
Thus the partial derivatives of the function z = sin(x2 + y) are
∂z ∂u
= cos(u) = 2x cos(x2 + y) ,
∂x ∂x
∂z ∂u
= cos(u) = cos(x2 + y) .
∂y ∂y
Click on the green square to return

Solutions to Exercises 23

Exercise 3(a)
From exercise 2(a), the first order partial derivatives of
z = (x2 + 3x) sin(y) are
∂z ∂z
= (2x + 3) sin(y) , = (x2 + 3x) cos(y) .
∂x ∂y
The mixed second order derivatives are
∂2z
 
∂ ∂z ∂
(x2 + 3x) cos(y) = (2x + 3) cos(y) ,

= =
∂x∂y ∂x ∂y ∂x
∂2z
 
∂ ∂z ∂
= = ((2x + 3) sin(y)) = (2x + 3) cos(y) .
∂y∂x ∂y ∂x ∂y
Click on the green square to return

Solutions to Exercises 24

Exercise 3(b)
cos(x)
From exercise 2(b), the first order partial derivatives of z =
y5
are
∂z sin(x) ∂z cos(x)
=− , = −5 ,
∂x y5 ∂y y6
so the mixed second order derivatives are
∂2z
   
∂ ∂z ∂ cos(x) sin(x)
= = −5 =5 6 ,
∂x∂y ∂x ∂y ∂x y6 y
2
   
∂ z ∂ ∂z ∂ sin(x) sin(x)
= = − 5 =5 6 .
∂y∂x ∂y ∂x ∂y y y
Click on the green square to return

Solutions to Exercises 25

Exercise 3(c)
From exercise 2(c), the first order partial derivatives of z = ln(xy)
are
∂z 1 ∂z 1
= , = .
∂x x ∂y y
The mixed second order derivatives are
∂2z
   
∂ ∂z ∂ 1
= = = 0,
∂x∂y ∂x ∂y ∂x y
∂2z
   
∂ ∂z ∂ 1
= = = 0.
∂y∂x ∂y ∂x ∂y x
Click on the green square to return

Solutions to Exercises 26

Exercise 3(d) From exercise 2(d), the first order partial derivatives
of z = sin(x) cos(xy) are
∂z ∂z
= cos(x) cos(xy) − y sin(x) sin(xy) , = − x sin(x) sin(xy) .
∂x ∂y
The mixed second order derivatives are
∂2z
 
∂ ∂z ∂
= = (−x sin(x) sin(xy))
∂x∂y ∂x ∂y ∂x
= − sin(x) sin(xy) − x cos(x) sin(xy) − xy sin(x) cos(xy) ,
∂2z
 
∂ ∂z ∂
= = (cos(x) cos(xy) − y sin(x) sin(xy))
∂y∂x ∂y ∂x ∂y
= −x cos(x) sin(xy) − sin(x) sin(xy) − xy sin(x) cos(xy) .
N.B. In the solution above a product of three functions has been
differentiated. This can be done by using two applications of the
product rule.
Click on the green square to return

Solutions to Exercises 27

Exercise 3(e) From exercise 2(e), the first order partial derivatives
2 2
of z = e(x +y ) are
∂z 2 2 ∂z 2 2
= 2xe(x +y ) , = 2ye(x +y ) .
∂x ∂y
The mixed second order derivatives are thus
∂2z
 
∂ ∂z ∂  (x2 +y2 )  2 2
= = 2ye = 4xye(x +y ) ,
∂x∂y ∂x ∂y ∂x
∂2z
 
∂ ∂z ∂  2 2
 2 2
= = 2xe(x +y ) = 4yxe(x +y ) .
∂y∂x ∂y ∂x ∂y
Click on the green square to return

Solutions to Exercises 28

Exercise 3(f ) From exercise 2(f ), the first order partial derivatives
of z = sin(x2 + y) are
∂z ∂z
= 2x cos(x2 + y) , = cos(x2 + y) .
∂x ∂y
The mixed second order derivatives are thus
∂2z
 
∂ ∂z ∂
cos(x2 + y) = −2x sin(x2 + y) ,

= =
∂x∂y ∂x ∂y ∂x
∂2z
 
∂ ∂z ∂
2x cos(x2 + y) = −2x sin(x2 + y) .

= =
∂y∂x ∂y ∂x ∂y
Click on the green square to return

Solutions to Quizzes 29

Solutions to Quizzes
Solution to Quiz:
To determine which of the options is correct, the partial derivatives
of z = cos(xy) must be calculated. From the calculations of exercise
2(d) the partial derivatives of z = cos(xy) are
∂ ∂ cos(u) ∂u
cos(xy) = = − sin(u)y = −y sin(xy) ,
∂x ∂u ∂x
∂ ∂ cos(u) ∂u
cos(xy) = = − sin(u)x = −x sin(xy) .
∂y ∂u ∂y
Therefore
1 ∂ 1 ∂
cos(xy) = − sin(xy) = cos(xy) .
y ∂x x ∂y

The other choices, if checked, will be found to be false. End Quiz


Solutions to Quizzes 30

Solution to Quiz:
The first order derivatives of z = e−y sin(x) are
zx = e−y cos(x) , zy = − e−y sin(x) ,
where e−y is kept constant for the first differentiation and sin(x) for
the second. Continuing in this way, the second order derivatives zxx
and zyy are given by the expressions
 
∂ ∂z ∂
e−y cos(x) = −e−y sin(x) ,

zxx = =
∂x ∂x ∂x
 
∂ ∂z ∂
−e−y sin(x) = e−y sin(x) .

zyy = =
∂y ∂y ∂y
Adding these two equations together gives
zxx + zyy = 0 .
End Quiz

You might also like