You are on page 1of 7

FACULTY OF MATHEMATICAL STUDIES

MATHEMATICS FOR PART I ENGINEERING

Lectures

MODULE 19 FURTHER CALCULUS I


1. Revision
2. Directional derivatives
3. Chain rule for partial derivatives
4. Higher partial derivatives
5. Total differential and small errors

1. Revision
The idea of partial differentiation was introduced at the end of module 3, and we first recall the basic ideas.
For functions of a single variable f (x) then differentiation gives ordinary derivatives

df
e.g. (i) f (x) = x2 + cos x + ex → = 2x − sin x + ex
dx
df
(ii) f (x) = sin(x2 ) → = 2x cos(x2 ).
dx
For the differentiations in this module it can be helpful to introduce “diagrams” indicating the functional
relationships. For instance, in example (i) above write f − x , which shows that to differentiate with respect
to x there is only one route.
df df du
For case (ii) you may want to introduce the substitution u = x2 and use the chain rule = =
dx du dx
(cos u) (2x). In this case the corresponding diagram is f − u − x , so to differentiate with respect to x there
is again only one route – first differentiate f with respect to u and then u with respect to x.
For functions of more than 2 variables then you obtain partial derivatives by differentiating with respect to
one variable keeping the other variable fixed. Hence

∂f ∂f
(iii) f (x, y) = x2 + cos y + ex → = 2x + ex , = − sin y;
∂x ∂y
∂f ∂f
(iv) f (x, y) = sin(x2 y) → = cos(x2 y) 2xy, = cos(x2 y) x2 .
∂x ∂y

∂f
For example (iv) above you could introduce the substitution u = x2 y and then use the chain rules =
∂x
df ∂u ∂f df ∂u
and = .
du
 ∂x ∂y du ∂y nx nx 
Helpful diagrams for (iii) and (iv) are f − y and f − u − y respectively.

If the given function depends on more than two variables then it is easy to generalise the above results. To
obtain the partial differential with respect to one variable then you differentiate with respect to that variable
keeping ALL the other variables fixed. This is illustrated below

(v) f (x, y, z) = sin(x2 yz)


∂f ∂f ∂f
→ = cos(x2 yz) 2xyz, = cos(x2 yz) x2 z, = cos(x2 yz) x2 y.
∂x ∂y ∂z

1
To obtain the partial derivatives in (v) you can differentiate directly or with the substitution u = (x x2 yz
∂f df ∂u
so that = etc. After introducing the substitutions the associated diagram is f − u − y , so
∂x du ∂x z
differentiating with respect to x means you first differentiate with respect to u , then u with respect to x.
df
Note that f depends only on u so is an ordinary derivative, whereas u depends on the three variables
du
∂u
x, y and z so is a partial derivative.
∂x
x−y
Ex 1. Verify that f (x, y, z) = x + satisfies the partial differential equation
y−z
∂f ∂f ∂f
+ + = 1.
∂x ∂y ∂z
The three partial derivatives must be calculated in turn
∂f ∂ 1 ∂ 1
= (x) + (x − y) = 1 + ,
∂x ∂x y − z ∂x y−z
 
∂f ∂ ∂ x−y (y − z)(−1) − (x − y)1 −y + z − x + y z−x
= (x) + =0+ = = ,
∂y ∂y ∂y y − z (y − z)2 (y − z)2 (y − z)2
 
∂f ∂ ∂ 1 ∂
= (x) + (x − y) = 0 + (x − y) (y − z)−1
∂z ∂z ∂z y − z ∂z
∂f x−y
i.e. = (x − y) (−1)(y − z)−2 (−1) = .
∂z (y − z)2
Hence combining the results
∂f ∂f ∂f 1 z−x x−y y−z+z−x+x−y
+ + =1+ + + =1+ = 1.
∂x ∂y ∂z y−z (y − z)2 (y − z)2 (y − z)2

2. Directional derivatives (non-examinable)


For a function of a single variable it is easy to draw, using the usual x − y axes, the graph of y = f (x) .
dy
The slope of the curved line is then the ordinary derivative .
dx
For a function of two variables the situation becomes more complicated. Introducing the usual three-
dimensional xyz-axes, the function z = f (x, y) represents a surface in space. You can easily draw a
tangent plane at any point on the surface, but any vector lying in this plane is a tangent to the surface, and
so there is no unique slope at a point on the surface unless a direction is specified.
Consider a plane which contains the z-axis and makes an angle α with the x-axis. This plane intersects
the surface z = f (x, y) in a curve and it can be shown that the slope of this curve (called the directional
derivative) equals
∂f ∂f
cos α + sin α .
∂x ∂y
For the particular cases α = 0 and α = π/2 the stated result reduces to the expected answers ∂f /∂x and
∂f /∂y respectively.

3. Chain rule for partial derivatives


A simple case of the chain rule was considered in section 1.
Consider now a function z= f (x,n y) where both x and y depend on the variables s and t . In this case
x − s
the diagram becomes z − nt
y − s
t

2
This diagram shows that there are two ways to differentiate with respect to s , via the variables x and y .
In a similar way, to differentiate with respect to t you must again go through the variables x and y. The
chain rule formulae are
∂z ∂z ∂x ∂z ∂y ∂z ∂z ∂x ∂z ∂y
= + , = + .
∂s ∂x ∂s ∂y ∂s ∂t ∂x ∂t ∂y ∂t
Note that there are two pairs of variables (x, y) and (s, t) . Hence, partial differentiation with respect to x
means differentiating with respect to x keeping the other variable in that pair (i.e. y) fixed. In a similar
way the derivative ∂/∂t means differentiating with respect to t with s kept fixed.

∂T ∂T
Ex 2. Find and when T (x, y) = x4 + y 4 and x = r cos θ , y = r sin θ.
∂r ∂θ
Here
∂T ∂T ∂x ∂x ∂y ∂y
= 4x3 , = 4y 3 , = cos θ, = −r sin θ, = sin θ, = r cos θ.
∂x ∂y ∂r ∂θ ∂r ∂θ
 n
x− r
The diagram for this example is T− nθ hence
y − r
θ

∂T ∂T ∂x ∂T ∂y
= + = 4x3 cos θ + 4y 3 sin θ = 4r3 cos4 θ + 4r3 sin4 θ
∂r ∂x ∂r ∂y ∂r

∂T ∂T ∂x ∂T ∂y
= + = 4x3 (−r sin θ) + 4y 3 (r cos θ)
∂θ ∂x ∂θ ∂y ∂θ
= −4r4 cos3 θ sin θ + 4r4 sin3 θ cos θ
Note that the last expression can be simplified to

∂T
= 4r4 sin θ cos θ(sin2 θ − cos2 θ) = 4r4 sin θ cos θ(− cos 2θ)
∂θ
= r4 (2 sin 2θ)(− cos 2θ) = −r4 sin(4θ) .

[The results above were calculated using the chain rule. Clearly the same answers could have been obtained
by substituting x = r cos θ and y = r sin θ into the original expression for T , and performing the partial
differentiation directly.]
When z = f (x, y) but x = x(t) and y = y(t) the chain rule simplifies to

dz ∂z dx ∂z dy
= +
dt ∂x dt ∂y dt

x−t
and the corresponding diagram is z − .
y−t

Ex 3. The base radius, r, of a cylinder increases at 1 cms−1 and its height, h, at 2cms−1 . Find the rate
of increase of its volume when r = 5cm and h = 10cm.
For a cylinder, volume V = πr2 h, therefore

dV ∂V dr ∂V dh dr dh
= + = (2πrh) + (πr2 ) = 2π(5)10(1) + π(52 )2 = 150π cm3 sec−1 .
dt ∂r dt ∂h dt dt dt

3
4. Higher partial derivatives
Higher order partial derivatives were considered briefly in module 11 – they are “easy” to calculate from the
general formulae
∂f
e.g. f (x, y) = exy → = y exy , (using if you wish u = xy),
∂x
 
∂2f ∂ ∂f ∂ ∂ xy
then 2
= = (yexy ) = y (e ) = y (yexy ) = y 2 exy ,
∂x ∂x ∂x ∂x ∂x
 
∂2f ∂ ∂f ∂
and = = (yexy ) = 1 exy + y (x exy ) = (1 + xy)exy .
∂y∂x ∂y ∂x ∂y
Calculating higher derivatives can be tricky when transforming variables (see Ex 4).

∂2f
Ex 4. In the function f (x, y) the variables are transformed by s = x2 − y 2 and t = xy . Determine
∂x2
∂2f ∂f ∂f ∂ 2 f ∂ 2 f ∂2f
and in terms of s, t, , , , and , and show that
∂y 2 ∂s ∂t ∂s2 ∂t2 ∂s∂t
 2 
∂2f ∂2f p ∂ f ∂2f
2
+ 2
= (s2 + 4t2 ) 4 2 + 2 .
∂x ∂y ∂s ∂t
 nx
s−
The diagram here is f − ny and the chain rule gives
t − x
y

∂f ∂f ∂s ∂f ∂t ∂f ∂f
= + = (2x) + (y)
∂x ∂s ∂x ∂t ∂x ∂s ∂t
       
∂2f ∂ ∂f ∂ ∂f ∂f ∂ ∂f ∂ ∂f
= = 2x +y = 2x + y
∂x2 ∂x ∂x ∂x ∂s ∂t ∂x ∂s ∂x ∂t
   
∂f ∂ ∂f ∂ ∂f
=2 + 2x +y .
∂s ∂x ∂s ∂x ∂t
In this example s and t form one pair of variables whilst x and y form another pair and particular care must
be taken when differentiating the two “mixed” derivatives in the expression above. The diagrams associated
with ∂f/∂s and
n x ∂f /∂t are  nx
∂f  s − ∂f  s −
− ny and − n y . Thus one can use the chain rule, as for differentiating f , except
∂s  t − x ∂t  t − x
y y
that f is replaced by ∂f /∂s and ∂f /∂t, in turn. Hence
     
∂ ∂f ∂ ∂f ∂s ∂ ∂f ∂t ∂2f ∂2f
= + = 2x + y
∂x ∂s ∂s ∂s ∂x ∂t ∂s ∂x ∂s2 ∂t∂s
     
∂ ∂f ∂ ∂f ∂s ∂ ∂f ∂t ∂2f ∂ 2f
= + = 2x + 2 y
∂x ∂t ∂s ∂t ∂x ∂t ∂t ∂x ∂s∂t ∂t
Substituting the above derivatives back into the general expression yields
 2   2 
∂2f ∂f ∂ f ∂2f ∂ f ∂2f
=2 + 2x 2x + y +y 2x + 2 y
∂x2 ∂s ∂s2 ∂t∂s ∂s∂t ∂t
2 2 2
 
∂f 2 ∂ f ∂ f 2 ∂ f ∂2f ∂2f
=2 + 4x + 4xy +y , using =
∂s ∂s2 ∂s∂t ∂t2 ∂s∂t ∂t∂s

4
∂2f
The corresponding second derivative must now be calculated in a similar way
∂y 2

∂f ∂f ∂s ∂f ∂t ∂f ∂f
= + = (−2y) + (x)
∂y ∂s ∂y ∂t ∂y ∂s ∂t
       
∂2f ∂ ∂f ∂ ∂f ∂f ∂ ∂f ∂ ∂f
= = −2y + x = −2 y + x
∂y 2 ∂y ∂y ∂y ∂s ∂t ∂y ∂s ∂y ∂t
   
∂f ∂ ∂f ∂ ∂f
= −2 − 2y +x .
∂s ∂y ∂s ∂y ∂t
Again using the diagrams and the chain rule it follows that
     
∂ ∂f ∂ ∂f ∂s ∂ ∂f ∂t ∂2f ∂2f
= + = 2
(−2y) + x
∂y ∂s ∂s ∂s ∂y ∂t ∂s ∂y ∂s ∂t∂s
     
∂ ∂f ∂ ∂f ∂s ∂ ∂f ∂t ∂2f ∂2f
= + = (−2y) + 2 x
∂y ∂t ∂s ∂t ∂y ∂t ∂t ∂y ∂s∂t ∂t
Hence the general expression becomes
 2   2 
∂2f ∂f ∂ f ∂2f ∂ f ∂2f
= −2 − 2y (−2y) + x + x (−2y) + x
∂y 2 ∂s ∂s2 ∂t∂s ∂s∂t ∂t2
∂f ∂2f ∂2f ∂2f
= −2 + 4y 2 2 − 4xy + x2 2
∂s ∂s ∂s∂t ∂t

Adding the results


 2 
∂2f ∂2f 2
2
2 ∂ f 2
2
2 ∂ f ∂ f ∂2f
+ = 4(x + y ) + (x + y ) = (x2 + y 2 ) 4 2 + 2
∂x2 ∂y 2 ∂s2 ∂t2 ∂s ∂t

From the original definitions of the variables

s2 + 4t2 = (x2 − y 2 )2 + 4(xy)2 = x4 − 2x2 y 2 + y 4 + 4x2 y 2 = x4 + 2x2 y 2 + y 4 = (x2 + y 2 )2


p
Thus x2 + y 2 = (s2 + 4t2 ) and the final result is
 2 
∂2f ∂2f p ∂ f ∂2f
2
+ 2 = (s2 + 4t2 ) 4 2 + 2 , (as required).
∂x ∂y ∂s ∂t

5. Total differential and small errors


Consider a function u = f (x, y) and let ∆x and ∆y be increments in x and y .
When x → x + ∆x and y → y + ∆y then we have u → u + ∆u .
∂f ∂f
The book James defines the total differential du by du = ∆x + ∆y . But du and ∆u are
∂x ∂y
approximately the same so
∂f ∂f
∆u ∼ ∆x + ∆y .
∂x ∂y
The latter is good for estimating small errors. The result can be generalised to functions of more than two
variables – for example, suppose u = f (x, y, z) then

∂f ∂f ∂f
∆u ∼ ∆x + ∆y + ∆z .
∂x ∂y ∂z

5
All measurements are subject to error, and a calculated quantity usually depends on the values of several
measured variables.
The total differential can be used to estimate error bounds for quantities calculated from experimental results,
or from data subject to errors – as shown below.
Ex 5. The volume V of a right-circular cone is given by V = 13 πr2 h , where h is the height and r is the
radius. If h is decreased by 2% and r is increased by 2% calculate the approximate percentage change in
V.
First it is important to convert the decrease/increase in the parameters into changes in ∆h etc. Hence
∆h ∆h
h decreased by 2% means × 100 = −2, or = −0.02 ;
h h
∆r ∆r
r increased by 2% means × 100 = +2, or = +0.02 .
r r
1 ∂V 2 ∂V 1
Given V = πr2 h , → = πrh , = πr2 , so
3 ∂r 3 ∂h 3
∂V ∂V 2 1
∆V ∼ ∆r + ∆h = πrh ∆r + πr2 ∆h .
∂r ∂h 3 3
∆V
To calculate percentage change in V need , so divide above equation by V
V
2 1
∆V πrh πr2
∼ 3 ∆r + 3 ∆h
V V V
2 1
∆V πrh πr2 ∆r ∆h
i.e. ∼ 13 2 ∆r + 13 2 ∆h = 2 +
V 3 πr h 3 πr h r h
∆V
→ ∼ 2(0.02) + (−0.02) = 0.02
V
Hence the approximate change in V is a 2% increase

In Ex 5 ∆h is negative and ∆r is positive. The maximum value of ∆V would clearly be obtained in this
example when both terms are positive. Similarly, the minimum value would arise when both increments are
negative. To obtain the formula for these limiting values proceed as follows:
∆V ∆r ∆h
in above =2 + then using the triangle inequality ( |a + b| ≤ |a| + |b| ) it follows that
V r h

∆V ∆r ∆h
≤ 2 + = 2 ∆r + ∆h .
V r h r h

The result is illustrated in the following example.

1
Ex 6. The volume of a right-circular cone is V = πr2 h . If r = 3 ± 0.01 and h = 5 ± 0.005 then, using
3
the total differential, find the estimated change in V , and compare it with the greatest possible error.
∆V ∆r ∆h
As in Ex 5, =2 + and therefore
V r h

∆V ∆r ∆h
≤ 2 +
V r h , approximately
   
∆V
→ ≤ 2 0.01 + 0.005 = 0.023
V 3 5 3
  
0.023 0.023 1 2
→ |∆V | ≤ V = π3 5 = 0.115π, approximately
3 3 3

6
The above result can be written in the alternative form −0.115π ≤ ∆V ≤ 0.115π .
1
For the second part of the question we know V = πr2 h , and so its maximum value clearly occurs when r
3
and h both have their maximum values. Hence
1
Vmax = π(3.01)2 (5.005) = 15.115267π
3
1
→ V = π32 5 = 15π
3
→ max. change in V = Vmax − V = 0.11527π

In a similar way
1
Vmin = π(2.99)2 (4.995) = 14.88527π
3
so min. change in V = Vmin − V = −0.11473π
Thus the approximate error calculated using partial derivatives gives a good guide to the maximum and
minimum errors.
For the relatively simple situations considered here direct calculation of the maximum and minimum errors
is possible, and the partial differentiation approach appears less useful. When more variables are present
and the function being considered is more complicated then the method involving partial differentiation
can be extremely useful in providing good estimates of maximum and minimum errors, using a relatively
straightforward approach.

rec/02lfc1

You might also like