# 1. Introduction

Differentiation is a very powerful mathematical tool. This module reviews the chain rule which enables us to calculate the derivatives of functions of functions, such as sin (x3), and also of powers of functions, such as (5x2 − 3x)17. The rule is given without any proof.

It is convenient to list here the derivatives of some simple functions:

y axn  sin (ax) cos (ax) eax  ln (ax)
dy/dx naxn − 1  a cos (ax) − a sin (ax) a eax  1/x

If u, v are two functions of x, then:

d/dx(u + v) = du/dx + dv/dx

This is the Sum Rule, which simply states that the derivative of the sum of two (or more) functions is given by the sum of their individual derivatives.

Derivatives also commute with constants, so that if y = aƒ (x), then dy/dx = adf/dx , where a is any constant.

Here are some exercises to practice on:

Exercise 1: Differentiate the following with respect to x using the above rules:

(a)y = x

Solution: If y = x then y = x½ (see the Powers module). Its derivative with respect to x is then found with the help of the rule that:

d/dx(axn) = naxn − 1

This yields:

 d/dx(x½) = 1/2 × x−½ = 1/2x−½ = 1/ 2√x
(b)y = 4 cos (3x)

Solution: To differentiate y = 4 cos (3x) with respect to x we take the derivative through the constant 4. We also use the rule:

d/dx (sin (ax)) = a cos (ax)

This gives:

 dy/dx = d/dx(4 sin (3x)) = 4 d/dx(sin (3x)) = 4 × 3 cos (3x) = 12 cos (3x)
(c)y = ln (x3)

Solution: To differentiate ln (x3) with respect to x we first recall from the Logarithms module that ln (xn) = nln (x). With the rule:

d/dx(ln (ax)) = 1/x

this gives us:

 d/dx(ln (x3)) = d/dx(3 ln (x)) = 3 d/dx(ln (x)) = 3 × 1/x = 3/x
(d)y = 3x4 − 4x3

Solution: To differentiate 3x4 − 4x3 we use the sum rule and the basic result:

d/dxxn = nxn−1

This gives:

 d/dx(3x4 − 4x3) = 3 × 4 × x4−1 − 4 × 3 × x3 − 1 = 12x3 − 12x2 = 12x2(x − 1)

- where in the last step we have extracted the common factor 12x2

Click on questions to reveal solutions

Quiz 1: Use the properties of powers to find the derivative of y = w3 ⁄ 4

(a) 3/8 w5 ⁄ 8 Correct - well done!
(b) 3/4 w1 ⁄ 4 Wrong - please try again!
(c) 3/8 w−1 ⁄ 4 Wrong - please try again!
(d) 1/2 w−3 ⁄ 8 Wrong - please try again!

Explanation: To differentiate y = w3 ⁄ 4 with respect to w, we use the properties of powers to rewrite y = (w3 ⁄ 4)1 ⁄ 2 = (w)3 ⁄ 8.

From the basic result:

d/dxxn = nxn−1

we obtain:

 dy/dw = d/dw(w3 ⁄ 8) = 3/8w3 ⁄ 8 − 1 = 3/8w3 ⁄ 8 − 8 ⁄ 8 = 3/8w5 ⁄ 8

# 2. The Chain Rule

The chain rule makes it possible to differentiate functions of functions, e.g. if y is a function of u (i.e. y = ƒ (u)) and u is a function of x (i.e., u = g(x)) then the chain rule states:

 if   y = ƒ (u),    then   dy/dx = dy/du × du/dx

Example 1: Consider y = sin (x2). This can be re-written as y = sin (u), with u = x2. Therefore, we have:

dy/du = cos (u)    and    du/dx = 2x

Thus the chain rule can be used to differentiate y with respect to x as follows:

 dy/dx = dy/dx = dy/du × du/dx = cos (u) × (2x) = 2x cos (x2) ,    since u = x2

The key to using the chain rule is to choose u appropriately, so that you are able to calculate both of the derivatives dy/du and du/dx . These results can then be substituted into the chain rule to give the desired result dy/dx.

Quiz 2: To differentiate y = 3x3 + 3x with respect to x, what would be a good choice of u?
(a)3x Wrong - please try again!
(b) x3 Wrong - please try again!
(c) x3 + 3x Correct - well done!
(d) x3 + 3x Wrong - please try again!

Explanation: Choosing u = x3 + 3x lets us write:

y = 3x3 + 3x = 3u = 3u1 ⁄ 2

This makes it possible to calculate both dy/du = 3/2u−1 ⁄ 2 and du/dx = x3 + 3x

These results can be substituted into the chain rule to find:

 dy/dx = dy/dx = dy/du × du/dx = 3/2u−1 ⁄ 2 × (3x2 + 3) = 3/2(3x2 + 3)u−1 ⁄ 2 = 9/2 (x2 + 1)(x3 + 3x)−1 ⁄ 2 = 9 (x2 + 1)/ 2√x3 + 3x,    since u = x3 + 3x.

If we had picked any of the other suggestions for u we would not have been able to calculate dy/dx

Exercise 2: Differentiate the functions y below using the chain rule with the suggested u:

(a)y = ln (x7 + x);    u = x7 + x

Solution: For y = ln (x7 + x), choose u = x7 + x, i.e. we write:

y = ln (u),    where   u = x7 + x

We then differentiate y as follows:

dy/du = d/du(ln (u)) = 1/u ,   and   du/dx = d/dx(x7 + x) = 7x6 + 1

Substituting these results into the chain rule yields:

 dy/dx = dy/du × du/dx = 1/u × (7x6 + 1) = 7x6 + 1/ x7 + x

since u = x7 + x

(b)y = sin (x);    u = x1 ⁄ 2

Solution: For y = sin (x), choose u = x1 ⁄ 2, i.e. we write:

y = sin (u),    where   u = x = x−1 ⁄ 2

We then differentiate y as follows:

dy/du = d/du(sin (u)) = cos (u) ,   and   du/dx = d/dx (x1 ⁄ 2) = 1/2x−1 ⁄ 2

These results and the chain rule give:

 dy/dx = dy/du × du/dx = cos (u) × (1/2 x−1 ⁄ 2 ) = 1/ 2√x cos (√x) = cos (√x) / 2√x

since u = 2

(c)y = 3 ex3;    u = x3

Solution: For y = 3 ex3, choose u = x3, i.e. we write:

y = 3 eu,   where   u = x3

We then differentiate y as follows:

dy/du = d/du(3 eu) = 3eu,   and   du/dx = d/dx(x3) = 3x2

These results and the chain rule give:

 dy/dx = dy/du × du/dx = 3 eu × (3x2) = 9 x2 eu  = 9 x2 ex3

since u = x3

(d)y = cos (ln (x));    u = ln (x)

Solution: For y = cos (ln (x)), choose u = ln (x), i.e. we write:

y = cos (u),    where   u = ln (x)

We then differentiate y as follows:

dy/du = d/du(cos (u)) = −sin (u) ,   and   du/dx = d/dxln (x) = 1/x

Substituting these results into the chain rule yields:

 dy/dx = dy/du × du/dx = −sin (u) × (1/ x) = −sin (ln (x))/ x

since u = ln (x)

Click on questions to reveal solutions

Exercise 3: Use the chain rule to differentiate the following functions with respect to x:

(a)y = sin (x2)

Solution: For y = sin (x2), we define u = x2, so that:

y = sin (u),    where   u = x2

We then differentiate y as follows:

dy/du = d/du(sin (u)) = cos (u),   and   du/dx = d/dx(x2) = 2x

Substituting these results into the chain rule implies:

 dy/dx = dy/du × du/dx = cos (u) × (2x) = 2xcos (x2)

since u = x2

(b)y = cos (x3 − 2x)

Solution: For y = cos (x3 − 2x), we define u = x3 − 2x, i.e. we write:

y = cos (u) ,    where   u = x3 − 2x

We then differentiate y as follows:

dy/du = d/du(cos (u)) = −sin (u) ,   and   du/dx = d/dx (x3 − 2x) = 3x2 − 2

These results and the chain rule implies:

 dy/dx = dy/du × du/dx = −sin (u × (3x2 − 2) = −(3x2 − 2) sin (3x2 − 2)

since u = x3 − 2x

(c)y = 2x2 − 1

Solution: For y = 2x2 − 1,choose u = x2 − 1, i.e. we write:

y = 2u = 2u1 ⁄ 2 ,   where   u = x2 − 1

We then differentiate y as follows:

dy/du = d/du (2u1 ⁄ 2) = 2 1/2 u−1 ⁄ 2 = u−1 ⁄ 2 ,   and   du/dx = d/dx(x2 − 2) = 2x

These results and the chain rule implies:

 dy/dx = dy/du × du/dx = u−1 ⁄ 2 × (2x) = 2x / √x2 − 1

since u = x2 − 1

(d)y = 4 e2x3 + 2

Solution: For y = 4 e2x3 + 2, we define u = 2x3, so that:

y = 4 eu + 2,    where   u = 2x3

We then differentiate y as follows:

dy/du = d/du(4eu + 2) = 4eu ,   and   du/dx = d/dx(2x3) = 6x2

Note the use of the sum rule to differentiate y above. Putting these results into the chain rule we get:

 dy/dx = dy/du × du/dx = 4eu × (6x2) = 24x2e2x3

since u = 2x3

Click on questions to reveal solutions

Quiz 3: Which of the following is the derivative of y = 2 sin (3 cos (4t)) with respect to t?

(a) 6 cos (3 cos (4t))Wrong - please try again!
(b) 6 cos (12 sin (4t)) Wrong - please try again!
(c) −24 sin (4t) cos (3 cos (4t))Correct - well done!
(d) 12 sin (4t) cos (3 cos (4t)) Wrong - please try again!

Explanation: For y = 2 sin (3 cos (4t)), choose u = 3 cos (4t), so that:

y = 4 eu + 2,    where   u = 2x3

To differentiate y with respect to t we need:

dy/du = d/du(2 sin (u)) = 2 cos (u) ,   and   du/dx = d/dt(3 cos (4t)) = −12 sin (4t)

These results and the chain rule give:

 dy/dt = dy/du × du/dt = 2 cos (u) × (−12 sin (4t)) = −2 × 12 sin (4t)cos (u) = −24 sin (4t) cos (3 cos (4t))

since u = 2x3

# 3. The Chain Rule for Powers

The chain rule for powers tells us how to differentiate a function raised to a power. It states:

if   y = (ƒ (x))n ,    then   dy/dx = nƒ′ (x)(ƒ (x))n−1

- where ƒ′ (x) is the derivative of ƒ (x) with respect to x. This rule is obtained from the chain rule by choosing u = ƒ (x) in the above expression.

Proof: If y = (ƒ (x))n , let u = ƒ (x), so y = un. From the chain rule:

 dy/dx = dy/du × du/dx = n un−1 ƒ′ (x) = n (ƒ  (x))n−1 × ƒ′ (x) = n ƒ′ (x)(ƒ  (x))n − 1

This special case of the chain rule is often extremely useful.

Example 2: Let y = (ex)6. From the chain rule for powers, and writing y = (ƒ (x))6 with ƒ (x) = ex , which also means ƒ′ (x) = ex, we get:

 dy/dx = 6 ƒ′ (x)(ƒ (x))6 − 1 = 6 ex(ex)5 = 6 exe5x = 6 e6x

This result can be checked since, from the properties of powers, we can rewrite y = e6x.

Exercise 4: Use the chain rule for powers to differentiate the following functions with respect to x:

(a)y = sin5(x)

Solution: The function sin5(x) is another way of writing (sin (x))5, so to differentiate it we use the chain rule for powers:

d/dx((ƒ (x))n) = nƒ′ (x)(ƒ (x))n−1

Here we have ƒ (x) = sin (x) so that:

ƒ′ (x) = d/dx(sin (x)) = cos (x)

and we obtain:

dy/dx = 5 ƒ5 − 1(x) cos (x) = 5 cos (x) sin4 (x)
(b)y = (x3 − 2x)3

Solution: To differentiate y = (x3 − 2x)3 we use the chain rule for powers:

d/dx((ƒ(x))n) = nƒ′ (x)(ƒ (x))n−1

Here we have ƒ (x) = x3 − 2x so that:

ƒ′ (x) = d/dx(x3 − 2x) = 3x2 − 2

and we obtain:

dy/dx = (3x2 − 2) × 3 ƒ2 (x) = 3 (3x2 − 2)(x3 − 2x)2
(c)y = 23x2 + 1

Solution: To differentiate y = 23x2 + 1 we use the chain rule for powers:

d/dx((ƒ (x))n) = nƒ′ (x)(ƒ (x))n−1

Here we have ƒ (x) = x2 + 1 so that:

ƒ′ (x) = d/dx(x2+1) = 2x

and we obtain:

 dy/dx = 1/3 ƒ 1/3 − 1 (x) × 2x = 1/3 × 2xƒ −2 ⁄ 3 (x) = 2/3 x(x2 + 1)−2 ⁄ 3
(d)y = 5 (sin (x) + cos (x))4

Solution: To differentiate 5 (sin (x) + cos (x))4 we take the derivative through the factor of 5 at the front and use the chain rule for powers:

d/dx((ƒ (x))n) = nƒ′ (x)(ƒ (x))n−1

Here we have ƒ (x) = (sin (x) + cos (x)) so that:

ƒ′ (x) = d/dx(sin (x) + cos (x)) =  cos (x) + sin (x)

and we obtain:

 dy/dx = 5 × 4 (cos (x) − sin (x) × ƒ 4−1(x) = 20 (cos (x) − sin (x) (sin (x) + cos (x))3

Click on questions to reveal solutions

Quiz 4: Select the derivative h′ (x) for the function h (x) = 3 x3 + 3x from the choices below:

(a) − (x2 + 1) / (x3 + 3x)2 ⁄ 3 Wrong - please try again!
(b) 3x2 + 3x / (x3 + 3x)2 ⁄ 3 Wrong - please try again!
(c) x2 + 1 / (x3 + 3x)2 ⁄ 3Correct - well done!
(d) 3 / (x3 + 3x)1 ⁄ 2 Wrong - please try again!

Explanation: The chain rule for powers may be used to differentiate h(x) = 3 x3 + 3x = (x3 + 3x)1 ⁄ 3 with respect to x. Writing h = ƒ (x)1 ⁄ 3 with ƒ (x) = x3 + 3x (so that ƒ′ (x) = 3x2 + 3) we find that:

 ƒ′ (x) = 1/3 ƒ 1 ⁄ 3− 1(x) × (3x2 + 3) = 1/3 (3x2 + 3) ƒ −2 ⁄ 3(x) = (x2 + 1) ƒ −2 ⁄ 3(x) = x2 + 1/ ƒ 2 ⁄ 3(x) = x2 + 1/ (x3 + 3x)2 ⁄ 3

- where we used ƒ (x) = x3 + 3x in the last step.

Quiz 5: Select the derivative g′(w) of g(w) = sin4(w) + sin (w4) from the choices below:

(a) 4 cos (w) sin3(w) + 4w3 cos (w4) Wrong - please try again!
(b) 4 cos3(w) + 4w3 cos (w4) Wrong - please try again!
(c) 4 sin3(w) cos (w) − 4w3 cos (w4) Correct - well done!
(d) −4 sin3(w) + 4w3 sin (w4) Wrong - please try again!

Explanation: For y = 2 sin (3 cos (4t)), choose u = 3 cos (4t), so that:

y = 4 eu + 2,    where   u = 2x3

To differentiate y with respect to t we need:

dy/du = d/du(2 sin (u)) = 2 cos (u) ,   and   du/dx = d/dt(3 cos (4t)) = −12 sin (4t)

These results and the chain rule give:

 dy/dt = dy/du × du/dt = 2 cos (u) × (−12 sin (4t)) = −2 × 12 sin (4t) cos (u) = −24 sin (4t) cos (3 cos (4t))

since u = 2x3

# 4. Quiz on the Chain Rule

In each of the following cases, choose the correct option:

1.What is the derivative with respect to t of y = 2 e−2t2
(a)−8t e−2t2
(b)2 e−4t
(c)−4 e−2t2
(d)8t et2
2. What is the derivative with respect to x of y = ln (x3 + 3)?
(a) 1 / x3 + 3
(b) 1 / 3x2
(c) 3x2 / x3 + 3
(d) 3x2 + 3 / x3 + 3
3.What is the derivative of y = (w33 + 1)−1 ⁄ 33 with respect to w?
(a) (w33 + 1)−32 ⁄ 33
(b) w32(33w32)−32 ⁄ 33
(c) 33w32(w33 + 1)−32 ⁄ 33
(d) w32(w33 + 1)−32 ⁄ 33
4.What is the derivative of y = 4 sin (ax) with respect to x?
(a) 2a cos (ax)/sin (ax)
(b) 4a cos (ax)/sin (ax)
(c) 2a/sin (ax)
(d) −2a cos (ax)/cos (ax)