Maths 2
Maths 2
Maths 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.
8 HELM (2008):
Workbook 18: Functions of Several Variables
®
HELM (2008): 9
Section 18.2: Partial Derivatives
Key Point 1
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
Key Point 2
10 HELM (2008):
Workbook 18: Functions of Several Variables
®
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
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
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
®
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
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
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
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
(b) for constant volume, the pressure increases as the temperature increases.
18 HELM (2008):
Workbook 18: Functions of Several Variables
®
Mathematical analysis
nR T
P =
V
so that
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
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
∂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