1 Partial differentiation and the chain rule
In this section we review and discuss certain notations and relations involving partial derivatives.
The more general case can be illustrated by considering a function f (x, y, z) of three variables
x, y and z. If y and z are held constant and only x is allowed to vary, the partial derivative of f
with respect to x is denoted by ∂f
∂x and defined by
∂f f (x + ∆x, y, z) − f (x, y, z)
= lim (1)
∂x ∆x→0 ∆x
Similarly we define
∂f f (x, y + ∆y, z) − f (x, y, z)
= lim (2)
∂y ∆y→0 ∆y
∂f f (x, y, z + ∆z) − f (x, y, z)
= lim (3)
∂z ∆z→0 ∆z
These formulae are direct generalisations of the well known definition of the derivative of a
function f (x) of one variable x
df f (x + ∆x) − f (x)
= lim (4)
dx ∆x→0 ∆x
Example
Let f (x, y, z) = x2 yz + yez , then
∂f
= 2xyz
∂x
∂f
= x2 z + ez
∂y
∂f
= x2 y + yez
∂z
1.1 The chain rule
We present the chain for the function f (x, y, z). We consider 3 cases.
(1) If x, y and z are all functions of a single variable t, then f can be considered as a function
of t and
df ∂f dx ∂f dy ∂f dz
= + + (5)
dt ∂x dt ∂y dt ∂z dt
Example
Let f (x, y, z) = x2 yz, x = et , y = t and z = 1 + t.
Method 1: Substitute the expressions for x, y and z into f . This yields
f = e2t t(1 + t) (6)
and differentiate (6). This gives
df
= e2t (2t + 1) + 2e2t t(1 + t) (7)
dt
Method 2: Use the chain rule (5). This gives
df
= (2xyz)et + x2 z + x2 y (8)
dt
1
Subsituting the expressions for x, y and z into (8) gives (7).
(2) More generally if x, y and z are all functions of two (or more variables), say s and t, then
we can consider f as a function of s and t and
∂f ∂f ∂x ∂f ∂y ∂f ∂z
= + + (9)
∂t ∂x ∂t ∂y ∂t ∂z ∂t
In writing (9) we consider the variables t and s as ’associated’ in the sense that in ∂f∂t we assume
that s is held constant. Similarly the variables x, y and z are associated in the sense that in ∂f
∂x we
assume that y and z are held constant. Alternatively (and this is more elegant and safer) we can
define
F (s, t) = f [x(s, t), y(s, t), z(s, t)] (10)
and write
∂F ∂f ∂x ∂f ∂y ∂f ∂z
= + + (11)
∂t ∂x ∂t ∂y ∂t ∂z ∂t
Example
Let f (x, y, z) = xyz, x = st, y = s + t, z = t. We consider f as a function of s and t and we
want to calculate ∂f∂t .
Method 1: Substitute the expressions for x, y and z into f . This gives
F (s, t) = s2 t2 + st3 (12)
Diffirentiating 12 with respect to t gives
dF
= 2s2 t + 3st2 (13)
dt
Method 2: Use the chain rule (9) or (10). Here we use (9). This gives
∂f ∂f ∂x ∂f ∂y ∂f ∂z
= + + = yzs + xz + xy (14)
∂t ∂x ∂t ∂y ∂t ∂z ∂t
Subsituting the expressions for x, y and z into (14) gives (13).
(3) We know suppose that y and z are functions of x. Then f (x, y, z) can be considered as a
function of x and we have
df ∂f ∂f dy ∂f dz
= + + (15)
dx ∂x ∂y dx ∂z dx
Example
Let f (x, y, z) = xyz, y = x and z = x2
Method 1: Substitute the expressions for y and z into f . This gives
f = xyz = x4 (16)
and
df
= 4x3 (17)
dx
Method 2: Use the chain rule 15. This gives
df ∂f ∂f dy ∂f dz
= + + = yz + xz + 2x2 y (18)
dx ∂x ∂y dx ∂z dx
Substituting the expressions for y and z into (18) gives (17).
2
1.2 Higher order derivatives
Consider the function f (x, y, z). We define the second order partial derivatives by the formulae
∂2f ∂ ∂f
2
= (19)
∂x ∂x ∂x
∂2f ∂ ∂f
= (20)
∂x∂y ∂x ∂y
∂2f ∂ ∂f
= (21)
∂y∂x ∂y ∂x
∂2f ∂ ∂f
= (22)
∂y 2 ∂y ∂y
It is not always true that
∂2f ∂2f
= (23)
∂x∂y ∂y∂x
However (23) holds if all the partial derivatives of f up to second order are continuous. This
condition is usually satisfied in applications and in particular in all the examples considered in this
course.
The following alternative notation for partial derivatives is often convenient and more econom-
ical.
∂f
fx =
∂x
∂f
fy =
∂y
∂2f
fxx =
∂x2
∂2f
fyy =
∂y 2
∂2f
fxy =
∂y∂x
∂2f
fyx =
∂x∂y
Example
Let f (x, y) = x3 cos y. Then
∂f
= 3x2 cos y
∂x
∂f
= −x3 sin y
∂y
∂2f
= 6x cos y
∂x2
∂2f
= −x3 cos y
∂y 2
3
∂2f
= −3x2 sin y
∂y∂x
∂2f
= −3x2 sin y
∂x∂y
∂2f ∂2f
We note that ∂y∂x = ∂x∂y in accordance with our previous remark.
2 Taylor series
In previous courses you encountered Taylor series for a function of one variable . For example the
Taylor series of a function F (t) about t = 0 is
t2
F (t) = F (0) + F 0 (0)t + F 00 (0) + R3 (24)
2!
where
t3
R3 = F 000 (τ ) (25)
3!
for some τ between 0 and t. Here we only wrote the first 3 terms. We refer to (24) as a three term
Taylor series. Similarly the two term Taylor series of F (t) is
F (t) = F (0) + F 0 (0)t + R2 (26)
where
t2
R2 = F 00 (τ ) (27)
2!
for some τ between 0 and t.
In this section we generalise (24) and (26) to a function of several variables. We present the
details for a function f (x, y) of two variables. The idea is to apply (24) and (26) with the particular
choice
F (t) = f (x + ht, y + kt) (28)
and then to set t = 1.
We first note that (28) implies
F (0) = f (x, y) (29)
Next applying the chain rule to (28) we obtain sucessively
F 0 (t) = hfx (x + ht, y + kt) + kfy (x + ht, y + kt) (30)
∂ ∂
F 00 (t) = h [hfx (x+ht, y +kt)+kfy (x+ht, y +kt)]+k [hfx (x+ht, y +kt)+kfy (x+ht, y +kt)] =
∂x ∂y
h2 fxx (x + ht, y + kt) + 2hkfxy (x + ht, y + kt) + k 2 fyy (x + ht, y + kt) (31)
∂ 2
F 000 (t) = h [h fxx (x + ht, y + kt) + 2hkfxy (x + ht, y + kt) + k 2 fyy (x + ht, y + kt)]+
∂x
∂ 2
k [h fxx (x + ht, y + kt) + 2hkfxy (x + ht, y + kt) + k 2 fyy (x + ht, y + kt)] =
∂y
h3 fxxx + 3h2 kfxxy + 3hk 2 fxyy + k 3 fyyy (32)
4
Substituting (28)-(32) into (24) gives
t2
f (x+ht, y +kt) = f (x, y)+[hfx (x, y)+kfy (x, y)]t+[h2 fxx (x, y)+2hkfxy (x, y)+k 2 fyy ] +R3 (33)
2
where
t3 3
R3 = [h fxxx + 3h2 kfxxy + 3kh2 fxyy + k 3 fyyy ](x+τ h,y+τ k) (34)
3!
for some τ between 0 and t.
Similarly substituting (28)-(32) into (26) we obtain
f (x + ht, y + kt) = f (x, y) + [hfx (x, y) + kfy (x, y)]t + R2 (35)
where
t2 2
R2 = [h fxx + 2hkfxy + k 2 fyy ](x+τ h,y+τ k) (36)
2
for some τ between 0 and t.
Our final formulae are obtained by setting t = 1 in (33)-(36). This yields the three term Taylor
series
1
f (x + h, y + k) = f (x, y) + [hfx (x, y) + kfy (x, y)] + [h2 fxx (x, y) + 2hkfxy (x, y) + k 2 fyy ] + R3 (37)
2
1 3
R3 = [h fxxx + 3h2 kfxxy + 3kh2 fxyy + k 3 fyyy ](x+τ h,y+τ k) (38)
3!
and the two term Taylor series
f (x + h, y + k) = f (x, y) + [hfx (x, y) + kfy (x, y)] + R2 (39)
1
R2 = [h2 fxx + 2hkfxy + k 2 fyy ](x+τ h,y+τ k) (40)
2
In (38) and (40), τ is some value between 0 and 1. Formulae (37) and (39) can also be rewritten
in the more familiar way
f (x, y) = f (x0 , y0 ) + (x − x0 )fx (x0 , y0 ) + (y − y0 )fy (x0 , y0 )+
1
[(x − x0 )2 fxx (x0 , y0 ) + 2(x − x0 )(y − y0 )fxy (x0 , y0 ) + (y − y0 )2 fyy (x0 , y0 )] + R3 (41)
2
f (x, y) = f (x0 , y0 ) + (x − x0 )fx (x0 , y0 ) + (y − y0 )fy (x0 , y0 ) + +R2 (42)
The Taylor formulae (37), (39), (41) and (42) have many applications. One of them is the
investigation of the maxima and the minima of functions of several variables (see next section).
Another is illustrated in the next example
Example
Consider the function f (x, y) = x3 y 4 . Clearly f (1, 1) = 1. We wish to use this information and
the Taylor formulae (41) and (42) to find an approximate value for f (1.03, 1.05). Setting x0 = 1,
y0 = 1, x = 1.03 and y = 1.05 in (42) and (41) give f (1.03, 1.05) ≈ 1.29 and f (1.03, 1.05) ≈ 1.3255
respectively. On the other hand the exact value of f (1.03, 1.05) is 1.3282 (to 4 decimal places). As
expected (41) give a better approximation than (42).
In the previous calculation the accuracy of the approximation given by (42) is poor. Is it possible
to improve it? The answer is yes. We just need to choose values of x and y closer to x0 = 1 and
y0 = 1. For example the exact value of f (1.003, 1.005) is 1.02936 (to 5 decimal places). Formula
(42) predicts the approximate value 1.029.