Maths 2

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

 

Partial Derivatives 18.2 

Introduction
When a function of more than one independent input variable changes because of changes in one or
more of the input variables, it is important to calculate the change in the function itself. This can
be investigated by holding all but one of the variables constant and finding the rate of change of the
function with respect to the one remaining variable. This process is called partial differentiation. In
this Section we show how to carry out the process.

 

Prerequisites • understand the principle of differentiating a


function of one variable
Before starting this Section you should . . .

' 
$
• understand the concept of partial
differentiation

• differentiate a function partially with


Learning Outcomes respect to each of its variables in turn

On completion you should be able to . . . • evaluate first partial derivatives

• carry out successive partial differentiations

• formulate second partial derivatives


& %

8 HELM (2008):
Workbook 18: Functions of Several Variables
®

1. First partial derivatives


The x partial derivative
For a function of a single variable, y = f (x), changing the independent variable x leads to a
corresponding change in the dependent variable y. The rate of change of y with respect to x is
df
given by the derivative, written . A similar situation occurs with functions of more than one
dx
variable. For clarity we shall concentrate on functions of just two variables.
In the relation z = f (x, y) the independent variables are x and y and the dependent variable z.
We have seen in Section 18.1 that as x and y vary the z-value traces out a surface. Now both of the
variables x and y may change simultaneously inducing a change in z. However, rather than consider
this general situation, to begin with we shall hold one of the independent variables fixed. This is
equivalent to moving along a curve obtained by intersecting the surface by one of the coordinate
planes.
Consider f (x, y) = x3 + 2x2 y + y 2 + 2x + 1.
Suppose we keep y constant and vary x; then what is the rate of change of the function f ?
Suppose we hold y at the value 3 then
f (x, 3) = x3 + 6x2 + 9 + 2x + 1 = x3 + 6x2 + 2x + 10
In effect, we now have a function of x only. If we differentiate it with respect to x we obtain the
expression:
3x2 + 12x + 2.
We say that f has been partially differentiated with respect to x. We denote the partial derivative
∂f
of f with respect to x by (to be read as ‘partial dee f by dee x’ ). In this example, when y = 3:
∂x
∂f
= 3x2 + 12x + 2.
∂x
In the same way if y is held at the value 4 then f (x, 4) = x3 + 8x2 + 16 + 2x + 1 = x3 + 8x2 + 2x + 17
and so, for this value of y
∂f
= 3x2 + 16x + 2.
∂x
Now if we return to the original formulation
f (x, y) = x3 + 2x2 y + y 2 + 2x + 1
and treat y as a constant then the process of partial differentiation with respect to x gives
∂f
= 3x2 + 4xy + 0 + 2 + 0
∂x
= 3x2 + 4xy + 2.

HELM (2008): 9
Section 18.2: Partial Derivatives
Key Point 1

The Partial Derivative of f with respect to x


For a function of two variables z = f (x, y) the partial derivative of f with respect to x is denoted
∂f
by and is obtained by differentiating f (x, y) with respect to x in the usual way but treating
∂x
the y-variable as if it were a constant.
∂f ∂z
Alternative notations for are fx (x, y) or fx or .
∂x ∂x

Example 2

∂f
Find for (a) f (x, y) = x3 + x + y 2 + y, (b) f (x, y) = x2 y + xy 3 .
∂x

Solution
∂f ∂f
(a) = 3x2 + 1 + 0 + 0 = 3x2 + 1 (b) = 2x × y + 1 × y 3 = 2xy + y 3
∂x ∂x

The y partial derivative


For functions of two variables f (x, y) the x and y variables are on the same footing, so what we have
done for the x-variable we can do for the y-variable. We can thus imagine keeping the x-variable
∂f
fixed and determining the rate of change of f as y changes. This rate of change is denoted by .
∂y

Key Point 2

The Partial Derivative of f with respect to y


For a function of two variables z = f (x, y) the partial derivative of f with respect to y is denoted
∂f
by and is obtained by differentiating f (x, y) with respect to y in the usual way but treating
∂y
the x-variable as if it were a constant.
∂f ∂z
Alternative notations for are fy (x, y) or fy or .
∂y ∂y

10 HELM (2008):
Workbook 18: Functions of Several Variables
®

Returning to f (x, y) = x3 + 2x2 y + y 2 + 2x + 1 once again, we therefore obtain:


∂f
= 0 + 2x2 × 1 + 2y + 0 + 0 = 2x2 + 2y.
∂y

Example 3
∂f
Find for (a) f (x, y) = x3 + x + y 2 + y (b) f (x, y) = x2 y + xy 3
∂y

Solution
∂f ∂f
(a) = 0 + 0 + 2y + 1 = 2y + 1 (b) = x2 × 1 + x × 3y 2 = x2 + 3xy 2
∂y ∂y

∂f
We can calculate the partial derivative of f with respect to x and the value of at a specific point
∂x
e.g. x = 1, y = −2.

Example 4
Find fx (1, −2) and fy (−3, 2) for f (x, y) = x2 + y 3 + 2xy.
∂f ∂f
[Remember fx means and fy means .]
∂x ∂y

Solution
fx (x, y) = 2x + 2y, so fx (1, −2) = 2 − 4 = −2; fy (x, y) = 3y 2 + 2x, so fy (−3, 2) = 12 − 6 = 6

Task
Given f (x, y) = 3x2 + 2y 2 + xy 3 find fx (1, −2) and fy (−1, −1).

∂f ∂f
First find expressions for and :
∂x ∂y
Your solution
∂f ∂f
= =
∂x ∂y

Answer
∂f ∂f
= 6x + y 3 , = 4y + 3xy 2
∂x ∂y

HELM (2008): 11
Section 18.2: Partial Derivatives
Now calculate fx (1, −2) and fy (−1, −1):
Your solution
fx (1, −2) = fy (−1, −1) =

Answer
fx (1, −2) = 6 × 1 + (−2)3 = −2; fy (−1, −1) = 4 × (−1) + 3(−1) × 1 = −7

Functions of several variables


∂f ∂f
As we have seen, a function of two variables f (x, y) has two partial derivatives, and . In an
∂x ∂y
∂f ∂f
exactly analogous way a function of three variables f (x, y, u) has three partial derivatives ,
∂x ∂y
∂f
and , and so on for functions of more than three variables. Each partial derivative is obtained in
∂u
the same way as stated in Key Point 3:

Key Point 3

x, y , u , v , w , . . . )
The Partial Derivatives of f (x
For a function of several variables z = f (x, y, u, v, w, . . . ) the partial derivative of f with respect
∂f
to v (say) is denoted by and is obtained by differentiating f (x, y, u, v, w, . . . ) with respect to
∂v
v in the usual way but treating all the other variables as if they were constants.
∂f ∂z
Alternative notations for when z = f (x, y, u, v, w, . . . ) are fv (x, y, u, v, w . . . ) and fv and .
∂v ∂v

Task
∂f ∂f
Find and for f (x, y, u, v) = x2 + xy 2 + y 2 u3 − 7uv 4
∂x ∂u

Your solution
∂f ∂f
= =
∂x ∂u

Answer
∂f ∂f
= 2x + y 2 + 0 + 0 = 2x + y 2 ; = 0 + 0 + y 2 × 3u2 − 7v 4 = 3y 2 u2 − 7v 4 .
∂x ∂u

12 HELM (2008):
Workbook 18: Functions of Several Variables
®

Task
The pressure, P , for one mole of an ideal gas is related to its absolute temperature,
T , and specific volume, v, by the equation
P v = RT
where R is the gas constant.
Obtain simple expressions for

(a) the coefficient of thermal expansion, α, defined by:


 
1 ∂v
α=
v ∂T P
(b) the isothermal compressibility, κT , defined by:
 
1 ∂v
κT = −
v ∂P T

Your solution
(a)

Answer  
RT ∂v R
v= ⇒ =
P ∂T P P
 
1 ∂v R 1
so α= = =
v ∂T P Pv T

Your solution
(b)

Answer  
RT ∂v RT
v= ⇒ =− 2
P ∂P T P
 
1 ∂v RT 1
so κT = − = 2
=
v ∂P T vP P

HELM (2008): 13
Section 18.2: Partial Derivatives
Exercises
∂f ∂f
1. For the following functions find and
∂x ∂y
(a) f (x, y) = x + 2y + 3
(b) f (x, y) = x2 + y 2
(c) f (x, y) = x3 + xy + y 3
(d) f (x, y) = x4 + xy 3 + 2x3 y 2
(e) f (x, y, z) = xy + yz

2. For the functions of Exercise 1 (a) to (d) find fx (1, 1), fx (−1, −1), fy (1, 2), fy (2, 1).
Answers
∂f ∂f
1. (a) = 1, =2
∂x ∂y
∂f ∂f
(b) = 2x, = 2y
∂x ∂y
∂f ∂f
(c) = 3x2 + y, = x + 3y 2
∂x ∂y
∂f ∂f
(d) = 4x3 + y 3 + 6x2 y 2 , = 3xy 2 + 4x3 y
∂x ∂y
∂f ∂f
(e) = y, =x+z
∂x ∂y
2.
fx (1, 1) fx (−1, −1) fy (1, 2) fy (2, 1)
(a) 1 1 2 2
(b) 2 −2 4 2
(c) 4 2 13 5
(d) 11 1 20 38

14 HELM (2008):
Workbook 18: Functions of Several Variables
®

2. Second partial derivatives


Performing two successive partial differentiations of f (x, y) with respect to x (holding y constant)
∂2f
is denoted by (or fxx (x, y)) and is defined by
∂x2
∂2f
 
∂ ∂f

∂x2 ∂x ∂x
∂2f
For functions of two or more variables as well as other second-order partial derivatives can be
∂x2
∂2f
obtained. Most obvious is the second derivative of f (x, y) with respect to y is denoted by (or
∂y 2
fyy (x, y)) which is defined as:
∂2f
 
∂ ∂f

∂y 2 ∂y ∂y

Example 5
∂2f ∂2f
Find and for f (x, y) = x3 + x2 y 2 + 2y 3 + 2x + y.
∂x2 ∂y 2

Solution
∂f
= 3x2 + 2xy 2 + 0 + 2 + 0 = 3x2 + 2xy 2 + 2
∂x
∂2f
 
∂ ∂f
≡ = 6x + 2y 2 + 0 = 6x + 2y 2 .
∂x2 ∂x ∂x
∂f
= 0 + x2 × 2y + 6y 2 + 0 + 1 = 2x2 y + 6y 2 + 1
∂y
∂2f
 
∂ ∂f
= = 2x2 + 12y.
∂y 2 ∂y ∂y

We can use the alternative notation when evaluating derivatives.

Example 6
Find fxx (−1, 1) and fyy (2, −2) for f (x, y) = x3 + x2 y 2 + 2y 3 + 2x + y.

Solution
fxx (−1, 1) = 6 × (−1) + 2 × (−1)2 = −4.
fyy (2, −2) = 2 × (2)2 + 12 × (−2) = −16

HELM (2008): 15
Section 18.2: Partial Derivatives
Mixed second derivatives
It is possible to carry out a partial differentiation of f (x, y) with respect to x followed by a partial
differentiation with respect to y (or vice-versa). The results are examples of mixed derivatives. We
must be careful with the notation here.
∂2f
We use to mean ‘differentiate first with respect to y and then with respect to x’ and we use
∂x∂y
∂2f
to mean ‘differentiate first with respect to x and then with respect to y’:
∂y∂x
∂2f ∂2f
   
∂ ∂f ∂ ∂f
i.e. ≡ and ≡ .
∂x∂y ∂x ∂y ∂y∂x ∂y ∂x
(This explains why the order is opposite of what we expect - the derivative ‘operates on the left’.)

Example 7
∂2f
For f (x, y) = x3 + 2x2 y 2 + y 3 find .
∂x∂y

Solution
∂f ∂2f
= 4x2 y + 3y 2 ; = 8xy
∂y ∂x∂y

Theremaining
 possibility is to differentiate first with respect to x and then with respect to y i.e.
∂ ∂f
.
∂y ∂x
∂f ∂2f
For the function in Example 7 = 3x2 + 4xy 2 and = 8xy. Notice that for this function
∂x ∂y∂x
∂2f ∂2f
≡ .
∂x∂y ∂y∂x
This equality of mixed derivatives is true for all functions which you are likely to meet in your studies.
∂2f
To evaluate a mixed derivative we can use the alternative notation. To evaluate we write
∂x∂y
∂2f
fyx (x, y) to indicate that the first differentiation is with respect to y. Similarly, is denoted by
∂y∂x
fxy (x, y).

16 HELM (2008):
Workbook 18: Functions of Several Variables
®

Example 8
Find fyx (1, 2) for the function f (x, y) = x3 + 2x2 y 2 + y 3

Solution

fx = 3x2 + 4xy 2 and fyx = 8xy so fyx (1, 2) = 8 × 1 × 2 = 16.

Task
Find fxx (1, 2), fyy (−2, −1), fxy (3, 3) for f (x, y) ≡ x3 + 3x2 y 2 + y 2 .

Your solution

Answer
fx = 3x2 + 6xy 2 ; fy = 6x2 y + 2y
fxx = 6x + 6y 2 ; fyy = 6x2 + 2; fxy = fyx = 12xy
fxx (1, 2) = 6 + 24 = 30; fyy (−2, −1) = 26; fxy (3, 3) = 108

HELM (2008): 17
Section 18.2: Partial Derivatives
Engineering Example 1

The ideal gas law and Redlich-Kwong equation

Introduction
In Chemical Engineering it is often necessary to be able to equate the pressure, volume and temper-
ature of a gas. One relevant equation is the ideal gas law
P V = nR T (1)
where P is pressure, V is volume, n is the number of moles of gas, T is temperature and R is the
ideal gas constant (= 8.314 J mol−1 K−1 , when all quantities are in S.I. units). The ideal gas law
has been in use since 1834, although its special cases at constant temperature (Boyle’s Law, 1662)
and constant pressure (Charles’ Law, 1787) had been in use many decades previously.
While the ideal gas law is adequate in many circumstances, it has been superseded by many other
laws where, in general, simplicity is weighed against accuracy. One such law is the Redlich-Kwong
equation
RT a
P = − √ (2)
V −b T V (V + b)
where, in addition to the variables in the ideal gas law, the extra parameters a and b are dependent
upon the particular gas under consideration.
Clearly, in both equations the temperature, pressure and volume will be positive. Additionally, the
Redlich-Kwong equation is only valid for values of volume greater than the parameter b - in practice
however, this is not a limitation, since the gas would condense to a liquid before this point was
reached.
Problem in words
Show that for both Equations (1) and (2)

(a) for constant temperature, the pressure decreases as the volume increases

(Note : in the Redlich-Kwong equation, assume that T is large.)

(b) for constant volume, the pressure increases as the temperature increases.

Mathematical statement of problem


For both Equations (1) and (2), and for the allowed ranges of the variables, show that
∂P
(a) <0 for T = constant
∂V
∂P
(b) >0 for V = constant
∂T
Assume that T is sufficiently large so that terms in T −1/2 may be neglected when compared to terms
in T .

18 HELM (2008):
Workbook 18: Functions of Several Variables
®

Mathematical analysis

1. Ideal gas law


This can be rearranged as

nR T
P =
V

so that

(i) at constant temperature


∂P −nR T
= <0 as all quantities are positive
∂V V2
(ii) for constant volume
∂P nR
= >0 as all quantities are positive
∂T V

2. Redlich-Kwong equation

RT a
P = − √
V −b T V (V + b)
= R T (V − b) − a T −1/2 (V 2 + V b)−1
−1

so that

(i) at constant temperature


∂P
= −R T (V − b)−2 + a T −1/2 (V 2 + V b)−2 (2V + b)
∂V
which, for large T , can be approximated by
∂P −R T
≈ <0 as all quantities are positive
∂V (V − b)2

(ii) for constant volume


∂P 1
= R(V − b)−1 + a T −3/2 (V 2 + V b)−1 >0 as all quantities are positive
∂T 2

Interpretation
∂P
In practice, the restriction on T is not severe, and regions in which < 0 does not apply are those
∂V
in which the gas is close to liquefying and, therefore, the entire Redlich-Kwong equation no longer
applies.

HELM (2008): 19
Section 18.2: Partial Derivatives
Exercises
∂2f ∂2f ∂2f ∂2f
1. For the following functions find , , , .
∂x2 ∂y 2 ∂x∂y ∂y∂x
(a) f (x, y) = x + 2y + 3
(b) f (x, y) = x2 + y 2
(c) f (x, y) = x3 + xy + y 3
(d) f (x, y) = x4 + xy 3 + 2x3 y 2
(e) f (x, y, z) = xy + yz

2. For the functions of Exercise 1 (a) to (d) find fxx (1, −3), fyy (−2, −2), fxy (−1, 1).

∂f ∂2f
3. For the following functions find and
∂x ∂x∂t
(a) f (x, t) = x sin(tx) + x2 t (b) f (x, t, z) = zxt − ext (c) f (x, t) = 3 cos(t + x2 )
Answers
∂2f ∂2f ∂2f ∂2f
1. (a) = 0 = = =
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(b) = 2 = ; = =0
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(c) = 6x, = 6y; = = 1.
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f 2 2 ∂2f 3 ∂2f ∂2f
(d) = 12x + 12xy , = 6xy + 4x , = = 3y 2 + 12x2 y
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(e) = = 0; = =1
∂x2 ∂y 2 ∂x∂y ∂y∂x

fxx (1, −3) fyy (−2, −2) fxy (−1, 1)


(a) 0 0 0
2. (b) 2 2 0
(c) 6 −12 1
(d) 120 −8 15

∂f ∂2f ∂2f
3. (a) = sin(tx) + xt cos(tx) + 2xt = = 2x cos(tx) − x2 t sin(tx) + 2x
∂x ∂t∂x ∂x∂t
∂f ∂2f ∂2f
(b) = zt − text = = z − ext − txext
∂x ∂t∂x ∂x∂t
∂f 2 ∂2f ∂2f
(c) = −6x sin(t + x ) = = −6x cos(t + x2 )
∂x ∂t∂x ∂x∂t

20 HELM (2008):
Workbook 18: Functions of Several Variables

You might also like