MT1186 Chapter 2 Differentiation
MT1186 Chapter 2 Differentiation
Differentiation
Essential reading
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.
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.
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
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
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.
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.
If n = 0, we have
If n = 1, we have
If n = 2, we have
If we are using e and ln, the derivatives are very simple, i.e.
f (x) = ex =⇒ f 0 (x) = ex ,
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.
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).
41
2. Differentiation
Activity 2.3 Derive the constant multiple, sum and difference rules from the linear
combination rule.
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.
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
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.
43
2. Differentiation
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)?
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
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
44
2.2. How to find derivatives
x3
Example 2.8 For positive x 6= 1, differentiate the function h(x) = with
ln x
respect to x.4
ln x
Example 2.9 Differentiate the function h(x) = with respect to x.5
ex
This is the quotient of the two functions
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)?
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.
As such we have
f 0 (g) = 3g 2 and g 0 (x) = 2,
and so the chain rule tells us that
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
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.
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 ,
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.
ln(ax ) = x ln(a) =⇒ ax = ex ln a .
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.
47
2. Differentiation
Example 2.13 Differentiate the function l(x) = (x3 + 1) ln(x2 + 4) with respect to
x.
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
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
2 +x
Example 2.14 Differentiate the function l(x) = ex ln(x3 + 1) with respect to x.
and to differentiate f (x) we need to use the chain rule because it is a composition.
In this case, we have
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
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
Of course, once you can reliably apply the rules, there is no need to show all of the
intermediate working.
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?
49
2. Differentiation
Example 2.15 Find the first four derivatives of f (x) = sin x. What is the
relationship between these derivatives of sin x?
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
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.
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
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))
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
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.
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
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 .
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.
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.
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.
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
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.
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?
q 0 (p) = −10rp−r−1 ,
∆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.
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.
58
2.3. Using derivatives
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
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
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.
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
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
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
62
2.3. Solutions to activities
For (c), h(x) = sin x cos x is the product of the two functions
63
2. Differentiation
This result will make sense once we have seen the chain rule and, in particular,
Activity 2.8(a).
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
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.
As such we have
f 0 (g) = cos g and g 0 (x) = 2,
and so the chain rule tells us that
65
2. Differentiation
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
as required.
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.
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.
as (ex )0 = ex = y.
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.
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.
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
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
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.
70
2.3. Solutions to exercises
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,
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
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.
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.
in terms of n.
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