Solutions to exercises
3.2 How to find derivatives
3.2.2 The rules of differentiation
3.2. How to find derivatives
which, as we will see in Activity 3.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 3.9 that
f (x) = ax =⇒ f0(x) = axln a, and, using the change of base formula for logarithms, we will see that
f (x) = logax =⇒ f0(x) = 1 x ln a, in Section 3.2.2.
Sine and cosine functions
For the sine function we find that
f (x) = sin x =⇒ f0(x) = cos x, and for the cosine function we have
f (x) = cos x =⇒ f0(x) =− sin x.
Although, we could have used the fact that the sine and cosine functions are interdefinable, i.e.
cos x = sin x +π
2
and sin x =− cos x +π
2
,
to derive the latter from the former once we have the chain rule (see Exercise 3.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 3.2.2 — see, for example, Activity 3.6(c).
3.2.2 The rules of differentiation
In Section 2.1.2, 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 dx
kf (x) + lg(x)
= kdf
dx+ ldg dx,
or, using our shorthand, (kf + lg)0(x) = kf0(x) + lg0(x). Indeed, this gives us three more basic rules straightaway, i.e. the
3
constant multiple rule: If k is a constant and f (x) is a function, then d
dx
kf (x)
= kdf dx, or, using our shorthand, (kf )0(x) = kf0(x).
sum rule: If f (x) and g(x) are functions, then d
dx
f (x) + g(x)
= df dx + dg
dx, or, using our shorthand, (f + g)0(x) = f0(x) + g0(x).
difference rule: If f (x) and g(x) are functions, then d
dx
f (x)− g(x)
= df dx − dg
dx, or, using our shorthand, (f − g)0(x) = f0(x)− g0(x).
Activity 3.3 Derive the constant multiple, sum and difference rules from the linear combination rule.
Example 3.3 Using these rules we see that:
if f (x) =−3x−12, then f0(x) =−3
−12x−32
= 32x−32 by the constant multiple rule;
if f (x) = x2+ x12, then f0(x) = 2x + 12x−12 by the sum rule;
if f (x) = cos x− sin x, then f0(x) =− sin x − cos x by the difference rule;
if f (x) = 3 ln x− 4 ex, then f0(x) = 3
x− 4 ex by the linear combination rule.
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 3.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 2.1.4, we have
logax = ln x ln a,
3
3.2. How to find derivatives
and so, using the constant multiple rule, we get d
as mentioned in Section 3.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 examples of how it works.
Example 3.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
f0(x) = 1 and g0(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 3.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
f0(x) = 1 and g0(x) = 1 x. As such, the product rule tells us that
h0(x) = (1)(ln x) + (x)
1 x
= ln x + 1.
is the derivative of the function h(x) = x ln x with respect to x.
3
Example 3.6 Differentiate the function h(x) = exln x with respect to x.
This is the product of the two functions
f (x) = ex and g(x) = ln x, and these give us
f0(x) = ex and g0(x) = 1 x. As such, the product rule tells us that
h0(x) = (ex)(ln x) + (ex)
1 x
= ex
ln x + 1 x
, is the derivative of the function h(x) = exln x with respect to x.
Activity 3.5 Use the product rule to differentiate the following functions with respect to x.
(a) x sin x, (b) excos 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
d dx
f (x) g(x)
= df
dxg(x)− f(x)dg dx [g(x)]2 , or, using our shorthand,
f (x) g(x)
0
= f0(x)g(x)− f(x)g0(x) [g(x)]2 .
Of course, as we saw in Section 2.1.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.
Example 3.7 For x6= 0, differentiate the function h(x) = ex
x with respect to x.
This is the quotient of the two functions
f (x) = ex and g(x) = x, and these give us
f0(x) = ex and g0(x) = 1.
3
3.2. How to find derivatives
As such, for x6= 0, the quotient rule tells us that h0(x) = (ex)(x)− (ex)(1)
x2 = x− 1
x2 ex, is the derivative of the function h(x) with respect to x.
Example 3.8 For x6= 1, differentiate the function h(x) = x3
ln x with respect to x.4 This is the quotient of the two functions
f (x) = x3 and g(x) = ln x, and these give us
f0(x) = 3x2 and g0(x) = 1 x. As such, for x6= 1, the quotient rule tells us that
h0(x) = (3x2)(ln x)− (x3) 1x
[ln x]2 = x2(3 ln x− 1) [ln x]2 , is the derivative of h(x) with respect to x.
Example 3.9 Differentiate the function h(x) = ln x
ex with respect to x.5 This is the quotient of the two functions
f (x) = ln x and g(x) = ex, and these give us
f0(x) = 1
x and g0(x) = ex. As such, the quotient rule tells us that
h0(x) =
1 x
(ex)− (ln x)(ex)
[ex]2 = (1− x ln x) ex
x e2x = 1− x ln x x ex , is the derivative of h(x) with respect to x.
Activity 3.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.
(a) sin x
x , (b) ex
cos x, (c) sin x cos x.
What can you deduce about the derivative of tan x from your answer to (c)?
4Here, h(x) is only defined for x6= 1 since we have ln x = 0 if x = 1.
5Observe that as ex> 0 for all x∈ R, we don’t have to worry about dividing by zero here.
3
The chain rule
This allows us to differentiate the composition of two functions f (x) and g(x). It states
that d
dx[f (g(x))] = df dg
dg dx,
or, using our shorthand, [f (g(x))]0 = f0(g)g0(x). Let’s have a look at some examples of how it works.
Example 3.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) = g3 and g(x) = 2x + 1.
As such we have
f0(g) = 3g2 and g0(x) = 2, and so the chain rule tells us that
h0(x) = (3g2)(2) = 6g2 = 6(2x + 1)2, is the derivative of h(x) with respect to x.
Activity 3.7 Verify that this is correct by multiplying out the brackets and differentiating your new expression for h(x) with respect to x.
Example 3.11 Differentiate the function h(x) =√
2x + 1 with respect to x.
The function h(x) =√
2x + 1 is the composition of the functions f (g) =√
g = g12 and g(x) = 2x + 1.
As such we have
f0(g) = 1
2g−12 and g0(x) = 2, and so the chain rule tells us that
h0(x) =
1 2g−12
(2) = g−12 = 1
√2x + 1, is the derivative of h(x) with respect to x.6
Example 3.12 Differentiate the function h(x) = ex3+2 with respect to x.
6In 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).
3
3.2. How to find derivatives
The function h(x) = ex3+2 is the composition of the functions f (g) = eg and g(x) = x3+ 2.
As such we have
f0(g) = eg and g0(x) = 3x2, and so the chain rule tells us that
h0(x) = (eg)(3x2) = 3x2ex3+2, is the derivative of h(x) with respect to x.
Activity 3.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 3.9 (A useful result) Using the fact that
ax = ex ln a, which we saw in Section 2.1.3, show that
dax
dx = axln a.
This was mentioned in Section 3.2.1, but there is no need to remember it as you should be able to derive this result if it is needed.
Activity 3.10 (Deriving the quotient rule) Derive the quotient rule by writing the quotient
f (x)
g(x) as the product f (x)[g(x)]−1,
and using the product and chain rules to differentiate it with respect to x.
Activity 3.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
dyf−1(y) = 1
d dxf (x) .
3
Activity 3.12 We know that if y = ex, then x = ln y. Use the result in
Activity 3.11 and the fact that (ex)0 = ex to show that the derivative of ln y with 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 3.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, f0(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
g0(h) = 1
h and h0(x) = 2x, so that
g0(x) =
1 h
(2x) = 2x
h = 2x x2+ 4,
by the chain rule. Now, putting all of this into the product rule gives us l0(x) = (3x2)
ln(x2+ 4)
+ (x3+ 1)
2x x2+ 4
= 3x2ln(x2+ 4) + 2x(x3+ 1) x2+ 4 , as the derivative of l(x) with respect to x.
Example 3.14 Differentiate the function l(x) = ex2+xln(x3+ 1) with respect to x.
This is the product of the two functions
f (x) = ex2+x 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
f0(h) = eh and h0(x) = 2x + 1,