0% found this document useful (0 votes)
95 views36 pages

MT1186 Chapter 2 Differentiation

This document introduces differentiation and how to find derivatives. It discusses: 1) The definition of a derivative as the limit of (f(x+h) - f(x))/h as h approaches 0. 2) Examples of using the definition to find the derivative of simple functions like f(x) = x^2. 3) Introducing standard derivatives for basic functions like polynomials to make differentiation easier without using the definition directly.

Uploaded by

PeterParker1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views36 pages

MT1186 Chapter 2 Differentiation

This document introduces differentiation and how to find derivatives. It discusses: 1) The definition of a derivative as the limit of (f(x+h) - f(x))/h as h approaches 0. 2) Examples of using the definition to find the derivative of simple functions like f(x) = x^2. 3) Introducing standard derivatives for basic functions like polynomials to make differentiation easier without using the definition directly.

Uploaded by

PeterParker1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Chapter 2 2

Differentiation

Essential reading

(For full publication details, see Chapter 1.)

Binmore and Davies (2002) Sections 2.7–2.13.


Anthony and Biggs (1996) Chapter 6 and parts of Chapter 7.

Further reading

Simon and Blume (1994) Sections 2.3–2.7 and 3.6, Chapter 4 and Section 5.5.
Adams and Essex (2010) Sections 2.1–2.7, parts of Sections 3.1 and 3.3, parts of
Sections 4.9 and 4.10.

Aims and objectives

The objectives of this chapter are as follows.

To introduce the idea of a derivative and see how it can be found using various
techniques.
To use derivatives to find tangent lines and approximate functions using various
techniques.
To see how derivatives can be used in economics-based subjects.
Specific learning outcomes can be found near the end of this chapter.

2.1 Introduction: What is differentiation?


Having revised the idea of a function in the previous chapter, we now turn to
differentiation, the process by which we find the derivative of a function. Given a
function, f , its derivative at the point a, which we denote by f 0 (a), is given by the
formula
f (a + h) − f (a)
f 0 (a) = lim ,
h→0 h
provided that the limit exists. Indeed, when the limit exists, i.e. when we can find a
value for f 0 (a), we say that the function is differentiable at a. Observe that here, we
have introduced the notation
lim g(h),
h→0

37
2. Differentiation

to denote the value1 of the function g(h) as h → 0 (provided, of course, that there is
such a value) and we call this value “the limit of g(h) as h → 0” whereas if there is no
such value, we say that this limit does not exist.2 To see how this works in practice, we
2 can consider a simple example.

Example 2.1 Use the definition to find the derivative of the function f (x) = x2 at
the point x = 3.

We need to find f 0 (3) and, using the formula above with a = 3, we start by looking at

f (3 + h) − f (3) (3 + h)2 − 32
= ,
h h
which, looking at the numerator, is easily simplified to give

f (3 + h) − f (3) (9 + 6h + h2 ) − 9 6h + h2
= = = 6 + h.
h h h
This in turn means that
 
0 f (3 + h) − f (3)
f (3) = lim = lim 6 + h = 6,
h→0 h h→0

because, in the limit as h → 0, we see that 6 + h goes to 6. Consequently, we can see


that the derivative of f (x) at the point x = 3, i.e. f 0 (3), is 6. Indeed, we can say that
the function f (x) = x2 is differentiable at x = 3.

Activity 2.1 Use the definition to find the derivative of the function f (x) = x2 at
the point x = −1.

More generally, instead of finding the derivative of f at individual points, we can find
its derivative at a general point, x, by finding f 0 (x). Of course, according to our
formula, this would involve finding
f (x + h) − f (x)
f 0 (x) = lim ,
h→0 h
and, provided the limit exists, this will give us another function of x. This can then be
used to find the derivative, say f 0 (a), at an individual point, a, by setting x = a in our
result. Let’s see how this works.

Example 2.2 Use the definition to find the derivative of the function f (x) = x2 at
the general point x and use this to verify that f 0 (3) = 6 as we found in Example 2.1.

We need to find f 0 (x) and, using the formula above, we start by looking at
f (x + h) − f (x) (x + h)2 − x2
= ,
h h
1
That is, a finite real number.
2
In 176 Further Calculus, you will do limits properly, but this simple explanation of what is going on
should suffice for our purposes here. In particular, we briefly introduced the ‘→’ notation in Example 1.2
and, with the examples below, you should be able to see what is happening for now. Also, in Section
2.3.4, we will see some examples where a limit fails to exist and we will explain what that means there.

38
2.2. How to find derivatives

which, looking at the numerator, is easily simplified to give

f (x + h) − f (x) (x2 + 2xh + h2 ) − x2 2xh + h2


h
=
h
=
h
= 2x + h. 2
This in turn means that
 
0 f (x + h) − f (x)
f (x) = lim = lim 2x + h = 2x,
h→0 h h→0

because, in the limit as h → 0, we see that 2x + h goes to 2x. Consequently, we can


see that the derivative of f (x) at the general point x, i.e. f 0 (x), is 2x which is also a
function of x as we should expect.3

Having found this, we can substitute x = 3 into our result to see that
f 0 (3) = 2(3) = 6 as we found in Example 2.1.

Activity 2.2 Use the result in Example 2.2 to verify your answer to Activity 2.1.

At what point is the derivative of f (x) = x2 equal to (a) 16 and (b) −4?

We have seen that a function, f (x), has a derivative, f 0 (x), which is also a function of x.
The process by which we go from a function to its derivative is called differentiation.
That is, when we have a function, f (x), we differentiate it with respect to x and we
sometimes denote this operation by
d
f (x) which is read as “differentiate f (x) with respect to x”,
dx
and the outcome of this operation will be the sought after derivative which we can write
as
df
or f 0 (x).
dx
If we then want to evaluate the derivative of f at the point a, we write

df
or f 0 (a),
dx x=a
depending on which notation we are using.
We will see what derivatives tell us about functions in Section 2.3 and, in particular, we
will see that some functions do not have derivatives at certain points as the limit in the
definition may not exist. But, before we do that, we turn our attention to how we can
find the derivative of a function when we don’t want to explicitly use the definition.

2.2 How to find derivatives


The previous section told us how to find derivatives from first principles, but now we
want to explore a more convenient way of finding them. The key idea is that we
3
Indeed, as this limit exists for all x ∈ R, we can say that the function f (x) = x2 is differentiable for
all x ∈ R.

39
2. Differentiation

introduce standard derivatives which tell us how to differentiate the basic functions that
we saw in the previous chapter. Once we know how to differentiate these, the rules of
differentiation will allow us to differentiate combinations of these functions.
2
2.2.1 Standard derivatives
In Example 2.2, we used the definition of the derivative to show that the function
f (x) = x2 has a derivative given by f 0 (x) = 2x. We now state some results that will
allow us to differentiate other elementary functions.

Power and root functions

If n ∈ Z, we can use the definition of the derivative to show that

f (x) = xn =⇒ f 0 (x) = nxn−1 .

For instance, we note that:

If n = 0, we have

f (x) = x0 = 1 =⇒ f 0 (x) = 0x−1 = 0,

which tells us the derivative of 1.

If n = 1, we have

f (x) = x1 = x =⇒ f 0 (x) = 1x0 = 1,

which tells us the derivative of x.

If n = 2, we have

f (x) = x2 =⇒ f 0 (x) = 2x1 = 2x,

in agreement with what we saw in Example 2.2.


Indeed, we will also use this rule when n ∈ Q, and so we also have things like
1 √ 1 1 1
f (x) = x 2 = x =⇒ f 0 (x) = x− 2 = √ ,
2 2 x

which tells us the derivative of x.

Exponential and logarithmic functions

If we are using e and ln, the derivatives are very simple, i.e.

f (x) = ex =⇒ f 0 (x) = ex ,

as ex is the special function which is equal to its derivative. We also have


1
f (x) = ln x =⇒ f 0 (x) = ,
x
40
2.2. How to find derivatives

which, as we will see in Activity 2.12, follows from the fact that the function ln x is the
inverse of ex .
If we have another base, a, the derivatives are not so simple. We shall see in Activity 2.9 2
that
f (x) = ax =⇒ f 0 (x) = ax ln a,
and, using the change of base formula for logarithms, we will see that
1
f (x) = loga x =⇒ f 0 (x) = ,
x ln a
in Section 2.2.2.

Sine and cosine functions

For the sine function we find that

f (x) = sin x =⇒ f 0 (x) = cos x,

and for the cosine function we have

f (x) = cos x =⇒ f 0 (x) = − sin x.

Although, we could have used the fact that the sine and cosine functions are
interdefinable, i.e.
 π  π
cos x = sin x + and sin x = − cos x + ,
2 2
to derive the latter from the former once we have the chain rule (see Exercise 2.2).
Indeed, using these standard derivatives, we can then derive the derivatives of the other
trigonometric functions using their definitions in terms of sine and cosine together with
the rules of differentiation in Section 2.2.2 — see, for example, Activity 2.6(c).

2.2.2 The rules of differentiation


In Section 1.3, we saw that there are several standard ways of making new functions
from old ones. Here, we see how we can use the standard derivatives, i.e. the derivatives
of our basic functions, and rules of differentiation to differentiate new functions that are
created from these basic ones in these standard ways. We start with the most
straightforward of these which allows us to differentiate linear combinations of functions.

The linear combination rule

If k and l are constants, this allows us to differentiate the linear combination,


kf (x) + lg(x), of two functions f (x) and g(x). It states that
 
d df dg
kf (x) + lg(x) = k +l ,
dx dx dx
or, using our shorthand, (kf + lg)0 (x) = kf 0 (x) + lg 0 (x). Indeed, this gives us three more
basic rules straightaway, i.e. the

41
2. Differentiation

constant multiple rule: If k is a constant and f (x) is a function, then


 
d df
2 dx
kf (x) = k ,
dx

or, using our shorthand, (kf )0 (x) = kf 0 (x).

sum rule: If f (x) and g(x) are functions, then


 
d df dg
f (x) + g(x) = + ,
dx dx dx

or, using our shorthand, (f + g)0 (x) = f 0 (x) + g 0 (x).

difference rule: If f (x) and g(x) are functions, then


 
d df dg
f (x) − g(x) = − ,
dx dx dx

or, using our shorthand, (f − g)0 (x) = f 0 (x) − g 0 (x).

Activity 2.3 Derive the constant multiple, sum and difference rules from the linear
combination rule.

Example 2.3 Using these rules we see that:

1
 3
 3
if f (x) = −3x− 2 , then f 0 (x) = −3 − 12 x− 2 = 32 x− 2 by the constant multiple
rule;
1 1
if f (x) = x2 + x 2 , then f 0 (x) = 2x + 12 x− 2 by the sum rule;

if f (x) = cos x − sin x, then f 0 (x) = − sin x − cos x by the difference rule;
3
if f (x) = 3 ln x − 4 ex , then f 0 (x) = − 4 ex by the linear combination rule.
x

So, in the case of simple combinations of functions such as these, we see that the
derivative of the linear combination is given by the linear combination of the derivatives.

Activity 2.4 Use the rules above to differentiate the following functions with
respect to x.

(a) − 3 cos x, (b) ex + cos x, (c) 3 sin x − 3 ln x.

Indeed, we can see that using the change of base formula for logarithms from
Section 1.5.1, we have
ln x
loga x = ,
ln a
42
2.2. How to find derivatives

and so, using the constant multiple rule, we get


       
d d ln x 1 d 1 1 1
dx
loga x =
dx ln a
=
ln a dx
ln x =
ln a x
=
x ln a
, 2
as mentioned in Section 2.2.1. We now look at the other rules of differentiation, i.e. the
ones that will allow us to differentiate products, quotients and compositions of functions.

The product rule

This allows us to differentiate the product of two functions f (x) and g(x). It states that
 
d df dg
f (x)g(x) = g(x) + f (x) ,
dx dx dx

or, using our shorthand, [f (x)g(x)]0 = f 0 (x)g(x) + f (x)g 0 (x)]. Let’s have a look at some
examples of how it works.

Example 2.4 Differentiate the function h(x) = x ex with respect to x.

This is the product of the two functions

f (x) = x and g(x) = ex ,

and these give us


f 0 (x) = 1 and g 0 (x) = ex .
As such, the product rule tells us that

h0 (x) = (1)(ex ) + (x)(ex ) = (1 + x) ex ,

is the derivative of the function h(x) = x ex with respect to x.

Example 2.5 Differentiate the function h(x) = x ln x with respect to x.

This is the product of the two functions

f (x) = x and g(x) = ln x,

and these give us


1
f 0 (x) = 1 and g 0 (x) = .
x
As such, the product rule tells us that
 
0 1
h (x) = (1)(ln x) + (x) = ln x + 1.
x

is the derivative of the function h(x) = x ln x with respect to x.

43
2. Differentiation

Example 2.6 Differentiate the function h(x) = ex ln x with respect to x.

2 This is the product of the two functions

f (x) = ex and g(x) = ln x,

and these give us


1
f 0 (x) = ex and g 0 (x) = .
x
As such, the product rule tells us that
   
0 x 1 x
x 1
h (x) = (e )(ln x) + (e ) = e ln x + ,
x x

is the derivative of the function h(x) = ex ln x with respect to x.

Activity 2.5 Use the product rule to differentiate the following functions with
respect to x.
(a) x sin x, (b) ex cos x, (c) sin x cos x.
What can you deduce about the derivative of sin(2x) from your answer to (c)?

The quotient rule

This allows us to differentiate the quotient of two functions f (x) and g(x). It states that

  df dg
d f (x) g(x) − f (x)
= dx dx ,
dx g(x) [g(x)]2

or, using our shorthand,


 0
f (x) f 0 (x)g(x) − f (x)g 0 (x)
= .
g(x) [g(x)]2

Of course, as we saw in Section 1.3.2, this all assumes that the quotient of the two
functions is defined for the values of x that we are working with, i.e. it only works for
values of x in the domain where g(x) 6= 0. Let’s have a look at some examples of how it
works.

ex
Example 2.7 For x 6= 0, differentiate the function h(x) = with respect to x.
x
This is the quotient of the two functions

f (x) = ex and g(x) = x,

and these give us


f 0 (x) = ex and g 0 (x) = 1.

44
2.2. How to find derivatives

As such, for x 6= 0, the quotient rule tells us that

(ex )(x) − (ex )(1) x−1 x


h0 (x) =
x 2
=
x2
e , 2
is the derivative of the function h(x) with respect to x.

x3
Example 2.8 For positive x 6= 1, differentiate the function h(x) = with
ln x
respect to x.4

This is the quotient of the two functions

f (x) = x3 and g(x) = ln x,

and these give us


1
f 0 (x) = 3x2 and g 0 (x) = .
x
As such, for x 6= 1, the quotient rule tells us that

0 (3x2 )(ln x) − (x3 ) x1 x2 (3 ln x − 1)
h (x) = = ,
[ln x]2 [ln x]2

is the derivative of h(x) with respect to x.

ln x
Example 2.9 Differentiate the function h(x) = with respect to x.5
ex
This is the quotient of the two functions

f (x) = ln x and g(x) = ex ,

and these give us


1
f 0 (x) = and g 0 (x) = ex .
x
As such, the quotient rule tells us that
1
 x
(e ) − (ln x)(ex ) (1 − x ln x) ex 1 − x ln x
h0 (x) = x x 2
= 2x
= ,
[e ] xe x ex

is the derivative of h(x) with respect to x.

Activity 2.6 Use the quotient rule to differentiate the following functions with
respect to x and find the values of x for which the derivatives exist.
sin x ex sin x
(a) , (b) , (c) .
x cos x cos x
4
Here, h(x) is only defined for x 6= 1 since we have ln x = 0 if x = 1.
5
Observe that as ex > 0 for all x ∈ R, we don’t have to worry about dividing by zero here.

45
2. Differentiation

What can you deduce about the derivative of tan x from your answer to (c)?

2 The chain rule

This allows us to differentiate the composition of two functions f (x) and g(x). It states
that
d df dg
[f (g(x))] = ,
dx dg dx
or, using our shorthand, [f (g(x))]0 = f 0 (g)g 0 (x). Let’s have a look at some examples of
how it works.

Example 2.10 Differentiate the function h(x) = (2x + 1)3 with respect to x.

The function h(x) = (2x + 1)3 is the composition of the functions

f (g) = g 3 and g(x) = 2x + 1.

As such we have
f 0 (g) = 3g 2 and g 0 (x) = 2,
and so the chain rule tells us that

h0 (x) = (3g 2 )(2) = 6g 2 = 6(2x + 1)2 ,

is the derivative of h(x) with respect to x.

Activity 2.7 Verify that this is correct by multiplying out the brackets and
differentiating your new expression for h(x) with respect to x.


Example 2.11 Differentiate the function h(x) = 2x + 1 with respect to x.

The function h(x) = 2x + 1 is the composition of the functions
√ 1
f (g) = g = g2 and g(x) = 2x + 1.

As such we have
1 1
f 0 (g) = g − 2 and g 0 (x) = 2,
2
and so the chain rule tells us that
 
0 1 −1 1 1
h (x) = g 2 (2) = g − 2 = √ ,
2 2x + 1

is the derivative of h(x) with respect to x.6

6
In particular, observe that here the original function is only defined if x ≥ −1/2 whereas the derivative
is only defined if x > −1/2 (as, in the derivative, x = −1/2 would entail division by zero).

46
2.2. How to find derivatives

3 +2
Example 2.12 Differentiate the function h(x) = ex with respect to x.

The function h(x) = ex


3 +2
is the composition of the functions 2
f (g) = eg and g(x) = x3 + 2.

As such we have
f 0 (g) = eg and g 0 (x) = 3x2 ,
and so the chain rule tells us that
3 +2
h0 (x) = (eg )(3x2 ) = 3x2 ex ,

is the derivative of h(x) with respect to x.

Activity 2.8 Use the chain rule to differentiate the following functions with respect
to x.
(a) sin(2x), (b) ln(cos x), (c) ln(ex ).
Why should your answer to (c) be obvious?

The chain rule can also be used to derive some useful results.

Activity 2.9 (A useful result)


From Section 1.5.1, we know that

ln(ax ) = x ln(a) =⇒ ax = ex ln a .

Use this to show that


dax
= ax ln a.
dx
This was mentioned in Section 2.2.1, but there is no need to remember it as you
should be able to derive this result if it is needed.

Activity 2.10 (Deriving the quotient rule)


Derive the quotient rule by writing the quotient

f (x)
as the product f (x)[g(x)]−1 ,
g(x)

and using the product and chain rules to differentiate it with respect to x.

Activity 2.11 (Derivatives of inverse functions)


If the function, f , has an inverse, f −1 , then we can let y = f (x) so that x = f −1 (y).
Use the chain rule to show that

d −1 d
f (y) = 1 f (x) .
dy dx

47
2. Differentiation

Activity 2.12 We know that if y = ex , then x = ln y. Use the result in


Activity 2.11 and the fact that (ex )0 = ex to show that the derivative of ln y with
2 respect to y is 1/y.

Using the rules together

Sometimes it will be necessary to apply several of the above rules of differentiation in


order to find a derivative. This is easily done as long as care is taken to recognise what
you are differentiating at each step. Here are two examples that should make the
procedure clear.

Example 2.13 Differentiate the function l(x) = (x3 + 1) ln(x2 + 4) with respect to
x.

This is the product of the two functions

f (x) = x3 + 1 and g(x) = ln(x2 + 4),

and clearly, f 0 (x) = 3x2 . But to differentiate g(x) we need to use the chain rule
because it is a composition. In this case, we have

g(h) = ln h and h(x) = x2 + 4,

which gives us
1
g 0 (h) = and h0 (x) = 2x,
h
so that  
0 1 2x 2x
g (x) = (2x) = = 2 ,
h h x +4
by the chain rule. Now, putting all of this into the product rule gives us
   
0 2 2 3 2x 2 2 2x(x3 + 1)
l (x) = (3x ) ln(x + 4) + (x + 1) = 3x ln(x + 4) + ,
x2 + 4 x2 + 4

as the derivative of l(x) with respect to x.

2 +x
Example 2.14 Differentiate the function l(x) = ex ln(x3 + 1) with respect to x.

This is the product of the two functions


2 +x
f (x) = ex and g(x) = ln(x3 + 1),

and to differentiate f (x) we need to use the chain rule because it is a composition.
In this case, we have

f (h) = eh and h(x) = x2 + x,

which gives us
f 0 (h) = eh and h0 (x) = 2x + 1,

48
2.2. How to find derivatives

so that
2 +x
f 0 (x) = (eh )(2x + 1) = (2x + 1) eh = (2x + 1) ex ,
by the chain rule. Then, to differentiate g(x), we need to use the chain rule again 2
because it is also a composition. In this case, we have

g(h) = ln h and h(x) = x3 + 1,

which gives us
1
g 0 (h) = and h0 (x) = 3x2 ,
h
so that  
0 1 3x2 3x2
g (x) = (3x2 ) = = 3 ,
h h x +1
by the chain rule. Now, putting all of this into the product rule gives us
   
0 x2 +x 3
  x2 +x  3x2
l (x) = (2x + 1) e ln(x + 1) + e
x3 + 1
 
3x2 2
= (2x + 1) ln(x3 + 1) + 3 ex +x ,
x +1

as the derivative of l(x) with respect to x.

Of course, once you can reliably apply the rules, there is no need to show all of the
intermediate working.

Activity 2.13 Use the rules of differentiation to differentiate the following


functions with respect to x.

2 sin(cos x)
(a) ex ln(sin x), (b) , (c) sin2 (3x) + cos2 (3x).
esin x
Why should your answer to (c) be obvious?

2.2.3 Higher-order derivatives


As we have seen above, when we differentiate a function, f (x), we find that its
derivative, f 0 (x), is also a function of x. In this context, we call f 0 (x) the first-order
derivative of f (x) and we can differentiate it again to get the second-order derivative,
i.e. we find  
d df d2 f
and we denote this by 2
or f 00 (x).
dx dx dx
Of course, the second-order derivative will also be a function of x and so we can
differentiate it again to get the third-order derivative, i.e. we find
 
d d2 f d3 f
and we denote this by or f 000 (x).
dx dx2 dx3
We can, of course, do this again and again but the shorthand notation we use can
become a bit unwieldy once we pass the third-order derivative. As such, for n ≥ 4, we

49
2. Differentiation

often write the nth-order derivative, i.e.


dn f
2 as f (n) (x),
dxn
when we use our shorthand.

Example 2.15 Find the first four derivatives of f (x) = sin x. What is the
relationship between these derivatives of sin x?

We have f (x) = sin x, and so the first-order derivative of f is given by

d
f 0 (x) = sin x = cos x.
dx
The second-order derivative of f is then
 
00 d df d
f (x) = = cos x = − sin x.
dx dx dx

The third-order derivative of f is then


 
000 d d2 f d
f (x) = 2
= (− sin x) = − cos x.
dx dx dx

And, finally, the fourth-order derivative of f is


 
(4) d d3 f d
f (x) = 3
= (− cos x) = sin x.
dx dx dx

So, in particular, we see that f 00 (x) = −f (x), f 000 (x) = −f 0 (x) and f (4) (x) = f (x).

Activity 2.14 Using the pattern inherent in Example 2.15, what is f (n) (x) for
n ≥ 1?

Activity 2.15 Find the first four derivatives of f (x) = x ex . Hence deduce an
expression for f (n) (x) for n ≥ 1.

2.3 Using derivatives


Derivatives can be very useful in mathematics and economics, but before we see how,
we need to understand what derivatives represent.

2.3.1 The meaning of the derivative


If we draw the graph of a function, f , we get the curve with equation y = f (x). At any
point on this curve, say the point (a, f (a)), we can draw a chord (or secant line) that
connects the given point to another point on the curve. For instance, in Figure 2.1, the

50
2.3. Using derivatives

y
y = f (x)

f (b)

f (a)
O
a b x

Figure 2.1: The line segment C is the chord joining the points (a, f (a)) and (b, f (b)) on
the curve y = f (x). This is extended using the ‘dotted lines’ at both ends so that we can
see what line the chord is a line segment of.

line segment C is the chord joining the points (a, f (a)) and (b, f (b)) on the curve
y = f (x). In particular, we see that the gradient of this chord, let’s call it mC , can be
found using the formula
f (b) − f (a)
mC = ,
b−a
which you should know.
To relate this to the derivative, we take some number, h 6= 0, and let b = a + h so that
we now have a chord, C, which is joining the points (a, f (a)) and (a + h, f (a + h)). The
gradient of this chord is then given by
f (a + h) − f (a) f (a + h) − f (a)
mC (h) = = ,
(a + h) − a h
and, for h 6= 0, this is a function of h since the value of mC will depend on the value of
h that we choose. In particular, recalling what we saw in Section 2.1, we can see that

f 0 (a) = lim mC (h),


h→0

and we want to see what this is telling us about the function, f .


We now consider the chords that join the point (a, f (a)) to the points
(a + h1 , f (a + h1 )), (a + h2 , f (a + h2 )) and (a + h3 , f (a + h3 )) where h3 > h2 > h1 > 0.
These are the line segments on the lines C1 , C2 and C3 which can be seen in Figure 2.2.
That is, we have three points that are getting successively closer to the point (a, f (a))
so that we can see the effect of letting h → 0. In particular, as we let h get smaller, we
see that the gradients of these particular chords are decreasing. The question is, do the

51
2. Differentiation

y
y = f (x)

2 C3

C2

f (a + h3 )
C1

T
f (a + h2 )

f (a + h1 )

f (a)
O
a a + h1 a + h2 a + h3 x

Figure 2.2: C1 , C2 and C3 are three chords of the curve y = f (x) originating from the
point (a, f (a)). Observe that as the other end of a chord approaches this point, the chords
‘pivot’ about it and their gradients get closer to the gradient of the line, T .

gradients of these chords tend to some finite limit as h → 0? That is, does the limit in
our expression for f 0 (a) above exist?
Hopefully, in Figure 2.2, you can see that as h gets smaller (i.e. as we consider C3 , then
C2 and then C1 ), the lines are ‘pivoting’ through the point (a, f (a)) and their gradients
are getting closer to the gradient of the line T . Indeed, in the limit as h → 0, the lines
we get from extending an arbitrary chord joining the points (a, f (a)) and
(a + h, f (a + h)) should become the line T . In particular, this means that the limit of
mC (h) as h → 0 exists because it should be equal to the gradient of T . This means that
the line T , called the tangent to f at the point (a, f (a))

goes through the point (a, f (a)), and

its gradient is the limit, as h → 0, of mC (h), i.e. f 0 (a).


For this reason, we define the gradient of a curve y = f (x) at the point (a, f (a)) to be
the gradient of its tangent line at that point and this, as we have seen, is simply the
value of f 0 (a).

2.3.2 Tangent lines and linear approximations

Now that we know how the tangent lines to a curve are related to derivatives, we can
use derivatives to find the equation of the tangent line to a curve at a given point. This,
in turn, will introduce us to a useful way of performing approximations.

52
2.3. Using derivatives

Finding tangent lines

Given that f 0 (a) is the gradient of the curve y = f (x) at the point x = a, we can use 2
this to find the equation of the tangent line at this point. In particular, the formula for
the gradient of a straight line, i.e.
y − f (a)
f 0 (a) = , (2.1)
x−a
gives us the equation of the tangent line as it goes through the point (a, f (a)) and its
gradient is given by f 0 (a). Let’s look at a quick example.

Example 2.16 Find the equation of the tangent line to the function f (x) = x2
when x = 3.

When x = 3, the point on the curve y = x2 is (3, 9) and we know that f 0 (3) = 6 as
f 0 (x) = 2x. Consequently, using (2.1), the equation of the tangent line is given by
y−9
6= =⇒ y − 9 = 6x − 18 =⇒ y = 6x − 9.
x−3
In particular, when written in this form, we see that the gradient of the line is
indeed 6 and the point (3, 9) does indeed lie on it as 6(3) − 9 = 9.

Activity 2.16 Find the equation of the tangent line to the function f (x) = ex when
x = 1.

Linear approximations

One use of tangent lines is that they provide us with a simple way of approximating the
value of a function. For instance, if we have the tangent line to the function f (x) at the
point x = a, the equation of its tangent line, i.e.
y − f (a)
f 0 (a) = ,
x−a
can be rearranged to give us
y = f (a) + (x − a)f 0 (a).
Now, if we pick a value of x that is close to a, say x∗ , the value of y when x = x∗ , will be
y ∗ = f (a) + (x∗ − a)f 0 (a),
and this will be ‘close’ to the value of f (x∗ ) as illustrated in Figure 2.3. Of course, if we
pick a value of x∗ which is closer to a, the value of y ∗ will be closer to the value of f (x∗ )
and we will have a better approximation to the value of f (x) at this point.
As we are approximating the function f by a straight line, we call this a linear
approximation to f around a. In particular, we have
f (x) ' f (a) + (x − a)f 0 (a),
if x is close to a. Let’s now consider a useful application of linear approximations.

53
2. Differentiation

y
y = f (x)

T
f (x∗ )
error

y∗

f (a)
O
a x∗ x

Figure 2.3: When x∗ is close to a we can use the tangent line at a to find y ∗ which gives
us an approximate value for f (x∗ ). There will, of course, be an ‘error’ involved in this
approximation but this can be made smaller if we use values of x∗ which are closer to a.

Example 2.17 Without using a calculator, find an approximate value of 3 e−0.1 .

Given that f (x) = 3 e−x , we have

f 0 (x) = −3 e−x =⇒ f 0 (0) = −3 e0 = −3,

and so, using our linear approximation, we get

f (0.1) ' f (0) + (0.1 − 0)f 0 (0) = 3 e0 +(0.1)(−3) = 3 − 0.3 = 2.7,

i.e. an approximate value of 3 e−0.1 is 2.7. We note in passing that, using a


calculator, we can see that the exact value of 3 e−0.1 is 2.71 to 2dp and so this is a
pretty good approximation.

Using linear approximations to find changes

As well as allowing us to find approximations to f around a, linear approximations can


give us useful information about how the value of f is changing as we move from a to,
say, a + h. Using our linear approximation, we see that
f (a + h) − f (a)
f (a + h) ' f (a) + hf 0 (a) =⇒ f 0 (a) ' ,
h
and so, if we denote the change in f by ∆f and the change in x by ∆x = h, we see that
∆f
' f 0 (a) or ∆f ' f 0 (a)∆x.
∆x
54
2.3. Using derivatives

That is, we can find the approximate value of the change in f if we change x from a to
a + h. Of course, the smaller ∆x = h is, the better our approximation. This is
illustrated in Figure 2.4.
2
y
y = f (x)

T
f (a + h)

error

exact ∆f
y∗
approx ∆f

f (a)
O
a a+h x

∆x = h

Figure 2.4: Finding an approximate value for ∆f using a linear approximation to f .


Obviously, the smaller the value of the change ∆x = h, the better the approximation for
∆f will be.

Example 2.18 Without using a calculator, find the approximate change in 3 e−x if
x is increased from zero to 0.1. Hence deduce the approximate value of 3 e−0.1 .

Given that f (x) = 3 e−x , we have

f 0 (x) = −3 e−x =⇒ f 0 (0) = −3 e0 = −3,

so, if ∆x = 0.1 as x increases from 0 to 0.1, we find that

∆f ' f 0 (0)∆x = (−3)(0.1) = −0.3,

i.e. the change in f is approximately −0.3. Observe that the minus sign is telling us
that when x increases from 0 to 0.1, f (x) is decreasing by approximately 0.3.

This means that using

f (0.1) ' f (0) + ∆f = 3 e0 +(−0.3) = 3 − 0.3 = 2.7,

we see that the approximate value of 3 e−0.1 is 2.7 as we would expect from the linear
approximation in Example 2.17.

Further, as the derivative of a function gives us information about how f (x) is changing

55
2. Differentiation

due to changes in x, we often refer to f 0 (a) as the rate of change of f (x) with respect to
x when x = a.
2
2.3.3 Applications of derivatives
Derivatives are useful in economics and we now introduce two ways in which they can
arise in that subject. The first is their use when discussing ‘marginal’ functions and the
second is when they are used in the context of ‘elasticities’. At this point, we will just
introduce these ideas and see how they might be useful, but they will also be used when
we consider some applications of the material contained in other chapters of this subject
guide.

Marginal functions

In economics, the term marginal denotes the rate of change of a quantity with respect
to a variable on which it depends. For instance, if a firm has a cost function, C(q), this
tells us the cost of producing q units of their product. The marginal cost of the firm,
which we denote by MC(q), would then be given by
dC
MC(q) = .
dq
This is useful since, using what we saw above, we can see that the marginal cost is
telling us (approximately) about how changes in the level of production, q, will incur
changes in the costs, C. That is, if the level of production is increased by ∆q, i.e. our
production increases from q to q + ∆q, we find that
dC ∆C
MC(q) = =⇒ MC(q) ' =⇒ ∆C ' MC(q)∆q,
dq ∆q
where ∆C = C(q + ∆q) − C(q) is, of course, the resulting increase in costs. In
particular, if q is so large that a change in production of one unit (i.e. ∆q = 1) is small
compared to q, we see that
∆C = C(q + 1) − C(q) ' MC(q).
That is, in these circumstances, the marginal cost tells us (approximately) the extra
cost incurred if the firm wishes to produce one more unit of their good given that they
are already producing q units.

Example 2.19 A firm has a cost function given by

C(q) = 1000 + 5q + q 2 ,

in dollars. Find the marginal cost function for this firm and use it to determine the
approximate cost of producing one more unit if the original level of production is 100
units.

The marginal cost function, MC(q), is given by

MC(q) = C0 (q) = 5 + 2q,

56
2.3. Using derivatives

and so using the fact that the change in cost, ∆C, is related to the change in
production, ∆q, by
∆C ' C0 (q)∆q, 2
we see that an increase in production of one unit, i.e. ∆q = 1, gives rise to an
increase in costs given by

∆C ' C0 (100)(1) = (5 + 2(100))(1) = 205.

That is, if the firm is producing 100 units and they increase their production by one
unit, they will incur additional costs of approximately 205 dollars.

Activity 2.17 By using C(q + 1) − C(q) directly when q = 100, determine how
good the approximation found in Example 2.19 is.

Generally then, if f is some economically meaningful function, its derivative is referred


to as the marginal of f and we denote this by Mf . For instance, if R(q) is the revenue
function for a firm, the marginal revenue, MR(q), is just R0 (q).

Elasticities

Suppose that, as in Section 1.1.5, we have a market where consumers purchase a good
according to the demand function, q D (p). If the price of this good was to increase from
p to p + ∆p, then there will be a change in the quantity demanded by the consumers
from q to q + ∆q. Indeed, since a rise in price will usually lead to a fall in demand, we
would expect ∆q to be negative here. In these circumstances, we can see how these
changes are related by noting that
∆q
∆q = q D (p + ∆p) − q D (p) ' q 0 (p)∆p =⇒ ' q 0 (p),
∆p
where we have used q to denote the quantity demanded, i.e. q(p) = q D (p).
Now, suppose that we are interested in the relative change in quantity, ∆q/q, and the
relative change in price, ∆p/p, we can see that the ratio of these two terms is then given
by
∆q/q p ∆q p
= ' q 0 (p).
∆p/p q ∆p q
Indeed, as ∆q is usually negative (whereas the other terms on the left-hand-side, i.e. p,
q and ∆p, are all positive) we would usually expect the right-hand-side to be negative
as well. With this in mind, we define the [price] elasticity of demand, ε(p), to be
p
ε(p) = − q 0 (p),
q
where q = q D (p) and the minus sign is introduced so that, in the usual case where ∆q is
negative, we can be sure that ε(p) itself will be positive.7 Then, we can see that using
∆q ∆p
' −ε(p) ,
q p
7
Some books omit the minus sign in their definition of the elasticity of demand, but it will be useful
for us to include it as it is easier to deal with positive quantities.

57
2. Differentiation

we can see how the relative change in quantity is simply related to the relative change
in price via the elasticity of demand.
2 Example 2.20 Suppose that the demand function for some good is given by
q D (p) = 10p−r where r is a constant. Find the elasticity of demand. What does this
tell us about the effect of relative changes in price on relative changes in quantity?

Here we have q = q D (p) = 10p−r where r is a constant and so,

q 0 (p) = −10rp−r−1 ,

which means that the elasticity of demand is given by


 
p 0 p −r−1
ε(p) = − q (p) = − − 10rp = r,
q 10p−r

i.e. ε(p) is a constant too. This means that, using

∆q ∆p
' −ε(p) ,
q p

we see that a relative increase in price of, say, x% will lead to a relative decrease in
quantity purchased of (approximately) rx%.

Indeed, we will see, in Section 3.2.3, that elasticities can also give us useful information
about how the revenue, R = pq, generated from selling a quantity, q, at a price of p per
unit will be affected by increases in the price.

2.3.4 Existence of derivatives


Although we will usually be dealing with situations where a function has a derivative at
every point where it is defined, we will occasionally encounter situations where there is
at least one point at which the derivative of a function does not exist. Just so that we
are aware of what this means and the kinds of situation in which it can arise, we
consider some of the most common ways in which a derivative can fail to exist at a
certain point.8

Discontinuous functions

If a function is discontinuous at a point, i.e. there is a point at which the function is not
continuous, then the derivative will not exist at that point as the next example
illustrates.

Example 2.21 Show that the derivative of the function defined by


(
1 x≥0
f (x) = ,
−1 x < 0
8
See, for example, Section 2.8 of Binmore and Davies (2002) for a discussion of some similar cases.

58
2.3. Using derivatives

does not exist when x = 0.

This function is illustrated in Figure 2.5(a) and, clearly, as the function is a


continuous horizontal line when x 6= 0, its derivative is defined and equal to zero as 2
long as x 6= 0. However, when x = 0, the function is discontinuous and its derivative,
if it exists, would be given by

f (h) − f (0)
f 0 (0) = lim .
h→0 h
However, here we can not just find

f (h) − f (0)
,
h
and let h → 0 as we did in Section 2.1 since the value of f (h) is different depending
on whether h is positive or negative. In such cases, we say that the limit we seek, i.e.

f (h) − f (0)
lim ,
h→0 h
exists if, firstly, both of the limits

f (h) − f (0) f (h) − f (0)


lim− and lim+ ,
h→0 h h→0 h
exist9 and, secondly, if they exist, they must be equal. But, using the given function,
we see that
f (h) − f (0) (−1) − 1 −2
lim− = lim− = lim− = ∞,
h→0 h h→0 h h→0 h
and
f (h) − f (0) 1−1
lim+ = lim+ = lim+ 0 = 0,
h→0 h h→0 h h→0

i.e. the first of these limits does not exist as ‘∞’ is not a value10 but more of a
notational convenience which tells us that a function is getting arbitrarily large in
the limit. Consequently, we see that

f (h) − f (0)
f 0 (0) = lim ,
h→0 h
fails to exist too and so the derivative of this function does not exist at x = 0.

Of course, the graph of a function can also have a discontinuity due to the presence of a
vertical asymptote. In such cases, the function is not actually defined at the value of x
where the asymptote occurs and so, because of this, the derivative cannot exist at this
point either.11 In both of these cases, as we can’t ascribe a gradient to the function at
these points, the function can’t have a tangent line at these points.
9
Notice that the former limit allows us to deal with negative h and the latter allows us to deal with
positive h. Also recall that the notation h → 0− and h → 0+ was explained in Example 2.2.
10
That is, it is not a real number.
11
We’ll come across this again in Section 3.4.3.

59
2. Differentiation

y y y
y = x1/3
y = |x|
1 (
1 x≥0

2 y=
−1 x < 0

O O O
x x x

−1

(a) (b) (c)


Figure 2.5: The graphs of three functions that have no derivative at x = 0 as explained in
(a) Example 2.21, (b) Example 2.22 and (c) Example 2.23. We note however that, unlike
the functions in (a) and (b), the function in (c) does have a tangent line at x = 0 given
by the vertical line with equation x = 0.

Continuous functions with ‘corners’

But, even if a function is continuous at every point, the derivative will not exist at
points where the curve changes too sharply, i.e. when the curve has a ‘corner’, as the
next example illustrates.

Example 2.22 Show that the derivative of the function f (x) = |x| does not exist
when x = 0.

This function is illustrated in Figure 2.5(b) and, clearly, as the function is the
continuous straight line f (x) = −x when x < 0 and f (x) = x when x > 0, its
derivative is defined and equal to −1 when x < 0 and 1 when x > 0. However, when
x = 0, the function has a ‘corner’ and its derivative, if it exists, would be given by
f (h) − f (0)
f 0 (0) = lim .
h→0 h
However here, as in Example 2.21, we can not just find
f (h) − f (0)
,
h
and let h → 0 as we did in Section 2.1 since the value of f (h) is different depending
on whether h is positive or negative. In such cases, we again say that the limit we
seek, i.e.
f (h) − f (0)
lim ,
h→0 h
exists if, firstly, both of the limits
f (h) − f (0) f (h) − f (0)
lim− and lim+ ,
h→0 h h→0 h
exist12 and, secondly, if they exist, they must be equal. But, using the given
function, we see that
f (h) − f (0) (−h) − 0
lim− = lim− = lim− −1 = −1,
h→0 h h→0 h h→0

60
2.3. Learning outcomes

and
f (h) − f (0) h−0
lim+ = lim+ = lim+ 1 = 1,
h h
h→0 h→0 h→0

i.e. both of these limits exist, but they are clearly not equal. Consequently, we see
2
that
f (h) − f (0)
f 0 (0) = lim ,
h→0 h
fails to exist and so the derivative of this function does not exist at x = 0.

Observe that, in this case, the limits as h → 0+ and as h → 0− both exist, but the
problem occurs because they are not equal and so we cannot ascribe a value to the
derivative (i.e. the limit as h → 0) in such situations. In particular, as this means that
we can’t ascribe a gradient to f at this point, the function can’t have a tangent line
here either.

Continuous functions with ‘vertical tangent lines’

Also, if a function is continuous at every point, the derivative will not exist at points
where the gradient of the curve becomes ‘infinite’, i.e. when the curve has a ‘vertical
tangent line’, as the next example illustrates.

Example 2.23 Show that the derivative of the function f (x) = x1/3 does not exist
when x = 0.

This function is illustrated in Figure 2.5(c) and, clearly, we can see that its
derivative is given by
1
f 0 (x) = 31 x−2/3 = 2/3 ,
3x
which exists as long as x 6= 0. Of course, when x = 0, the derivative cannot exist
since, if we were to use this formula, we would have to ‘divide by zero’ and this is
never allowed. However, we can see from Figure 2.5(c) that the graph of the function
has a vertical tangent line at x = 0 which is given by the vertical line with equation
x = 0.13 Thus, we have a situation where the derivative of the function does not
exist at x = 0, but it does have a tangent line at that point.

Observe that, in cases where the tangent line to f at a point is a vertical line we cannot
use (2.1) to find its equation as its derivative is not defined.14

Learning outcomes
At the end of this chapter and having completed the relevant reading and activities, you
should be able to:
12
Again, as in Example 2.21, the former limit allows us to deal with negative h and the latter allows
us to deal with positive h.
13
Notice that the tangent lines of the function are getting steeper as we move towards x = 0 on the
left and shallower as we move away from x = 0 on the right.
14
We’ll come across this again in Section 3.4.3.

61
2. Differentiation

find simple derivatives using the definition of the derivative;

find derivatives using standard derivatives and the rules of differentiation;


2
use the derivative to find tangent lines and use these to approximate functions;

solve problems from economics-based subjects that involve derivatives.

Solutions to activities
Solution to activity 2.1
We need to find the derivative of the function f (x) = x2 at the point x = −1, i.e.
f 0 (−1). So, using the definition of the derivative with a = −1, we start by looking at

f (−1 + h) − f (−1) (−1 + h)2 − (−1)2


= ,
h h
which, looking at the numerator, is easily simplified to give
f (−1 + h) − f (−1) (1 − 2h + h2 ) − 1 −2h + h2
= = = −2 + h.
h h h
This in turn means that
 
0 f (−1 + h) − f (−1)
f (−1) = lim = lim − 2 + h = −2,
h→0 h h→0

because, in the limit as h → 0, we see that −2 + h goes to −2.

Solution to activity 2.2


In Example 2.2, we showed that if f (x) = x2 , then f 0 (x) = 2x. This means that
f 0 (−1) = −2 in agreement with what we saw in Activity 2.1.

To find the point at which the derivative of f (x) = x2 , i.e. f 0 (x) = 2x, is equal to (a) 16,
we see that
f 0 (x) = 2x = 16 when x = 8,
and (b) −4, we see that

f 0 (x) = 2x = −4 when x = −2.

Solution to activity 2.3


Given the linear combination rule, i.e.
 
d df dg
kf (x) + lg(x) = k +l ,
dx dx dx
we can derive the constant multiple rule by setting l = 0 so that
   
d d df dg df
kf (x) = kf (x) + 0g(x) = k +0 =k ,
dx dx dx dx dx

62
2.3. Solutions to activities

the sum rule by setting k = 1 and l = 1 so that


   
d d df dg df dg
dx
f (x) + g(x) =
dx
1f (x) + 1g(x) = 1
dx
+1
dx
= +
dx dx
, 2
and the difference rule by setting k = 1 and l = −1 so that
   
d d df dg df dg
f (x) − g(x) = 1f (x) + (−1)g(x) = 1 + (−1) = − .
dx dx dx dx dx dx

Solution to activity 2.4


For (a), we use the constant multiple rule to see that
     
d d
− 3 cos x = −3 cos x = −3 − sin x = 3 sin x.
dx dx

For (b), we use the sum rule to see that


       
d x d x d
e + cos x = e + cos x = e + − sin x = ex − sin x.
x
dx dx dx

For (c), we use the linear combination rule to see that


         
d d d 1 3
3 sin x − 3 ln x = 3 sin x − 3 ln x = 3 cos x − 3 = 3 cos x − .
dx dx dx x x

Solution to activity 2.5


For (a), h(x) = x sin x is the product of the two functions

f (x) = x and g(x) = sin x,

and these give us


f 0 (x) = 1 and g 0 (x) = cos x.
As such, the product rule tells us that

h0 (x) = (1)(sin x) + (x)(cos x) = sin x + x cos x.

For (b), h(x) = ex cos x is the product of the two functions

f (x) = ex and g(x) = cos x,

and these give us


f 0 (x) = ex and g 0 (x) = − sin x.
As such, the product rule tells us that

h0 (x) = (ex )(cos x) + (ex )(− sin x) = ex (cos x − sin x).

For (c), h(x) = sin x cos x is the product of the two functions

f (x) = sin x and g(x) = cos x,

63
2. Differentiation

and these give us


f 0 (x) = cos x and g 0 (x) = − sin x.
2 As such, the product rule tells us that

h0 (x) = (cos x)(cos x) + (sin x)(− sin x) = cos2 x − sin2 x.

Then, using the double angle formulae

sin x cos x = sin(2x) and cos2 x − sin2 x = cos(2x),

from (1.6), this means that we have


 
d 1
sin(2x) = cos(2x),
dx 2

so that, using the constant multiple rule, we can deduce that


 
d
sin(2x) = 2 cos(2x).
dx

This result will make sense once we have seen the chain rule and, in particular,
Activity 2.8(a).

Solution to activity 2.6


sin x
For (a), h(x) = is the quotient of the two functions
x
f (x) = sin x and g(x) = x,

and these give us


f 0 (x) = cos x and g 0 (x) = 1.
As such, the quotient rule tells us that
(cos x)(x) − (sin x)(1) x cos x − sin x
h0 (x) = 2
= .
x x2
In this case, the original function and the derivative are only defined if x 6= 0.
ex
For (b), h(x) = is the quotient of the two functions
cos x
f (x) = ex and g(x) = cos x,

and these give us


f 0 (x) = ex and g 0 (x) = − sin x.
As such, the quotient rule tells us that
(ex )(cos x) − (ex )(− sin x) cos x + sin x x
h0 (x) = = e .
[cos x]2 cos2 x
In this case, the original function and the derivative are only defined if cos x 6= 0, i.e. if
x 6= (2n + 1) π2 for n ∈ Z.

64
2.3. Solutions to activities

sin x
For (c), h(x) = is the quotient of the two functions
cos x
f (x) = sin x and g(x) = cos x, 2
and these give us
f 0 (x) = cos x and g 0 (x) = − sin x.
As such, the quotient rule tells us that

0 (cos x)(cos x) − (sin x)(− sin x) cos2 x + sin2 x


h (x) = = .
[cos x]2 cos2 x

In this case, the original function and the derivative are only defined if cos x 6= 0, i.e. if
x 6= (2n + 1) π2 for n ∈ Z.

Indeed, using the Pythagorean identity


sin x 1
sin2 x + cos2 x = 1 and the definitions tan x = and sec x = ,
cos x cos x
from (1.2), (1.1) and Section 1.3.2, we can deduce that
 
d 1
tan x = = sec2 x,
dx cos2 x

as long as x 6= (2n + 1) π2 for n ∈ Z.

Solution to activity 2.7


Given that h(x) = (2x + 1)3 , we can multiply out the brackets to get

h(x) = 8x3 + 12x2 + 6x + 1,

which means that

h0 (x) = 24x2 + 24x + 6 = 6(4x2 + 4x + 1) = 6(2x + 1)2 ,

in agreement with what we saw in Example 2.10.

Solution to activity 2.8


For (a), h(x) = sin(2x) is the composition of the functions

f (g) = sin g and g(x) = 2x.

As such we have
f 0 (g) = cos g and g 0 (x) = 2,
and so the chain rule tells us that

h0 (x) = (cos g)(2) = 2 cos(2x),

which agrees with what we found in Activity 2.5(c).

65
2. Differentiation

For (b), h(x) = ln(cos x) is the composition of the functions

f (g) = ln g and g(x) = cos x.


2
As such we have
1
f 0 (g) = and g 0 (x) = − sin x,
g
and so the chain rule tells us that
 
0 1 sin x
h (x) = (− sin x) = − = − tan x.
g cos x

For (c), h(x) = ln(ex ) is the composition of the functions

f (g) = ln g and g(x) = ex .

As such we have
1
f 0 (g) = and g 0 (x) = ex ,
g
and so the chain rule tells us that
 
0 1 ex
h (x) = (ex ) = x = 1.
g e

Of course, this is obvious as ln(ex ) = x and so its derivative with respect to x is


therefore 1.

Solution to activity 2.9


Given that ax = ex ln a , we use the chain rule with h(g) = eg and g(x) = x ln a to get
    
dax d x ln a x ln a
= e = e ln a = ax ln a,
dx dx

as required.

Solution to activity 2.10


Writing the quotient f (x)/g(x) as the product f (x)[g(x)]−1 , the product rule gives us
   
d −1 df −1 −2 dg
f (x)[g(x)] = [g(x)] + f (x) − [g(x)] ,
dx dx dx

where we have used the chain rule to differentiate [g(x)]−1 with respect to x. Rewriting
this, we then have
  df dg
d f (x) g(x) − f (x)
= dx dx ,
dx g(x) [g(x)]2
which is the quotient rule, as required.

Solution to activity 2.11

66
2.3. Solutions to activities

We have y = f (x) so that x = f −1 (y). Thus, differentiating both sides of the latter with
respect to x, we get
dx df −1 dy
dx
=
dy dx
, 2
where we have used the chain rule on the right-hand-side as y itself is a function of x
since y = f (x). This gives us

df −1 dy df −1 df
1= =⇒ =1 ,
dy dx dy dx

as required.15 In particular, observe that this formula makes no sense at points where
f 0 (x) = 0.

Solution to activity 2.12


Here we have y = f (x) = ex and x = f −1 (y) = ln y so, using the result from
Activity 2.11, we see that
    
d d 1 1
ln y = 1 ex = x = ,
dy dx e y

as (ex )0 = ex = y.

Solution to activity 2.13


There is, generally, no need to apply the rules of differentiation in as much detail as we
have been using. So, let’s do the three examples in this activity quickly.
2
For (a), we have h(x) = ex ln(sin x) which is the product of two compositions and so
using the product and chain rules we get
    2  
0 x2 x2 cos x ex
h (x) = 2x e ln(sin x) + e = 2x sin x ln(sin x) + cos x .
sin x sin x

For (b), we have


sin(cos x)
h(x) = ,
esin x
which is the quotient of two compositions and so using the quotient and chain rules we
get
   
sin x sin x
cos(cos x)(− sin x) e − sin(cos x) e cos x
0
h (x) =
[esin x ]2
sin x cos(cos x) + cos x sin(cos x)
=− .
esin x
For (c), we have h(x) = sin2 (3x) + cos2 (3x) which is the sum of two compositions and so
we can easily use the chain rule to see that

h0 (x) = 2 sin(3x) cos(3x)(3) + 2 cos(3x)[− sin(3x)](3) = 0.


15
See Section 2.9 of Binmore and Davies (2002) for a geometric view of this result.

67
2. Differentiation

Of course, this is obvious as sin2 (3x) + cos2 (3x) = 1 using (1.2) and so its derivative
with respect to x is zero.
2 Solution to activity 2.14
We have seen that the first four derivatives are given by
f 0 (x), f 00 (x) = −f (x), f 000 (x) = −f 0 (x), and f (4) (x) = −f 00 (x) = f (x),
which returns us to our original function. Indeed, we can then see that the next four
derivatives will be given by
f (5) (x) = f 0 (x), f (6) (x) = −f (x), f (7) (x) = −f 0 (x) and f (8) (x) = −f 00 (x) = f (x),
which, again, returns us to our original function. This means that, spotting the pattern,
we can see that 

 f (x) n = 4, 8, . . .

f 0 (x) n = 1, 5, 9, . . .
f (n) (x) =

 −f (x) n = 2, 6, 10, . . .

 0
−f (x) n = 3, 7, 11, . . .
for n ≥ 1.

Solution to activity 2.15


To find the first four derivatives of x ex , we use the product rule to see that

f 0 (x) = (1)(ex ) + (x)(ex ) = (1 + x) ex ,


f 00 (x) = (1)(ex ) + (1 + x)(ex ) = (2 + x) ex ,
f 000 (x) = (1)(ex ) + (2 + x)(ex ) = (3 + x) ex , and
f (4) (x) = (1)(ex ) + (3 + x)(ex ) = (4 + x) ex .
Indeed, spotting the pattern, we can deduce that f (n) (x) = (n + x) ex for n ≥ 1.

Solution to activity 2.16


Here we have f (x) = ex so that f 0 (x) = ex . Then using (2.1), we see that when x = 1 we
have
y − f (1)
f 0 (1) = =⇒ y − e1 = e1 (x − 1) =⇒ y = e x.
x−1
as the equation of the tangent line to the function f (x) = ex at x = 1.

Solution to activity 2.17


Here we have C(q) = 1000 + 5q + q 2 and so, when operating at q = 100, the increase in
cost given an increase in quantity of one is given by
∆C = C(101) − C(100) = (1000 + 5(101) + 1012 ) − (1000 + 5(100) + 1002 ) = 206.
This is pretty close to the approximate answer of 205 that we found in Example 2.19,
especially if we consider this as a relative error of 1/206 = 0.49% (to 2dp) instead of an
absolute error of one.

68
2.3. Exercises

Exercises
Exercise 2.1 2
Find the derivatives of the following functions.
tan x
(a) esin x cos x, (b) , (c) sin(x ex ).
ex2

Exercise 2.2
Use the compound-angle formulae to show that
 π  π
cos x = sin x + and sin x = − cos x + .
2 2
Hence use the chain rule to derive the derivative of cos x from the derivative of sin x.

Exercise 2.3
Verify that the point (e, e) is on the curve with equation

y = x ln x,

and find the equation of the tangent line to the curve at this point.

Consider, for some constants a and b, the curve with equation

y = ax2 + b.

For what values of a and b does this curve pass through the point (e, e) with the same
tangent line as the one you found above?

Exercise 2.4

Use differentiation to find the approximate change in x as x increases from 100 to 101.

More generally, if n is a positive whole number, what is the approximate change in x
as x increases from n to n + 1?

Exercise 2.5
Suppose the demand function for a good is
1
q D (p) = p .
1 + p4
Find the elasticity of demand in terms of p and verify that it is positive if p > 0.

Solutions to exercises
Solution to exercise 2.1
We apply the rules of differentiation ‘quickly’ as we did in Activity 2.13.

69
2. Differentiation

(a) The function h(x) = esin x cos x is a product that has the composition esin x as one
of its terms. As such, applying the product rule we get
     
2 0
h (x) = e sin x
cos x cos x + e sin x
− sin x = cos x − sin x esin x ,
2

where we have used the chain rule to differentiate the composition.


2
(b) The function h(x) = (tan x)/ ex is a quotient whose denominator is the
2
composition ex . As such, applying the quotient rule we get
 
2 2
(sec2 x) ex −(tan x) ex (2x) sec2 x − 2x tan x
h0 (x) = = ,
[ex2 ]2 ex2
where we have used the fact, from Activity 2.6(c), that the derivative of tan x is
sec2 x and the chain rule to differentiate the composition.

Also note that this derivative can be found by writing the function as
2
h(x) = (tan x) e−x and, if we do this, we would use the product rule instead of the
quotient rule.

(c) The function h(x) = sin(x ex ) is the composition sin x after x ex where the latter
function is a product. As such, applying the chain rule we get
 
0
h (x) = cos(x e ) (1) e +x(e ) = (1 + x) ex cos(x ex ),
x x x

where we have used the product rule to differentiate the product.

Solution to exercise 2.2


Using the compound-angle formulae from (1.5), we have
 π π π
sin x + = sin x cos + cos x sin = cos x,
2 2 2
and  π π π
cos x + = cos x cos − sin x sin = − sin x,
2 2 2
as required. Indeed, notice that we have used the facts, from Activity 1.3, that
sin(π/2) = 1 and cos(π/2) = 0.

Now, using chain rule and the derivative of sin x, we see that
d  π  π  π
sin x + = cos x + (1) = cos x + ,
dx 2 2 2
which, using the results we showed above, becomes
d
cos x = − sin x,
dx
as required.

Solution to exercise 2.3

70
2.3. Solutions to exercises

Substituting x = e into y = x ln x we get

y = e ln e = e(1) = e,
2
and so the point (e, e) lies on this curve. The gradient of the curve at any point is given
by the derivative of f (x) = x ln x and so, using the product rule, we get
 
0 1
f (x) = (1) ln(x) + x = ln(x) + 1.
x
Thus, when x = e, the gradient of the curve is given by

f 0 (e) = ln(e) + 1 = 1 + 1 = 2,

which means that, using (2.1), we get


y−e
2= =⇒ y − e = 2(x − e) =⇒ y = 2x − e,
x−e
as the equation of the tangent line to the curve y = x ln x at the point (e, e).

The curve y = ax2 + b will have a tangent line at (e, e) which is the same as the one we
have just found if, firstly, the curve goes through the point (e, e), i.e. a and b must satisfy

e = a e2 +b,

and, secondly, it has the same gradient at e, i.e. if the derivative of g(x) = ax2 + b at
x = e is two. That is, as

g 0 (x) = 2ax we need g 0 (e) = 2a e,

to be two. Thus, from the second condition, we have


1
2a e = 2 =⇒ a= ,
e
and, from the first condition, we have
 
1 2
e= e +b =⇒ b = e − e = 0.
e

Consequently, we see that when a = 1/ e and b = 0 the curve y = ax2 + b passes through
the point (e, e) with the same tangent line as the one we found above.

Solution to exercise 2.4



We let f (x) = x so that
1 1 1
f 0 (x) = √ =⇒ f 0 (100) = √ = ,
2 x 2 100 20
so, if ∆x = 1 as x increases from 100 to 101, we find that
 
0 1 1
∆f ' f (100)∆x = (1) = .
20 20

71
2. Differentiation

Thus, the approximate change in f (x) is 0.05 which compares well with the exact
change which is √ √
f (101) − f (100) = 101 − 100 = 0.0499,
2
to four decimal places.

If we let x increase from n to n + 1, we still have ∆x = 1 but now


 
0 1 1
∆f ' f (n)∆x = √ (1) = √ ,
2 n 2 n

in terms of n.

Solution to exercise 2.5


We have the demand function
1 1
q D (p) = p = (1 + p4 )− 2 ,
1+p 4

and so, setting q = q D (p), we can use the chain rule to get the derivative

1 3 −2p3
q 0 (p) = − (1 + p4 )− 2 (4p3 ) = 3 .
2 (1 + p4 ) 2

Then, using the definition of the elasticity of demand from Section 2.3.3, we have
!
p 0 p −2p3 2p4
ε(p) = − q (p) = − 1 3 = ,
q (1 + p4 )− 2 (1 + p4 ) 2 1 + p4

in terms of p. Indeed, when p > 0, we have p4 > 0 and 1 + p4 > 0, which means that
ε(p) > 0 too.

72

You might also like