Skip to content
mathismaths.com

Calculus · Lesson 4 of 4

The Chain Rule

To differentiate a function inside a function, differentiate the outside, keep the inside, then multiply by the derivative of the inside.

What you will learn

  • Spot the inner and outer function.
  • Differentiate composite functions.
  • Apply the rule to powers of brackets.

Before you start: you should know the power rule and composite functions. See Derivatives.

The idea

The basic rules handle x5x^5 or sin⁡x\sin x, but what about (3x+1)5(3x + 1)^5 or sin⁡(x2)\sin(x^2)? These are composite functions: one function applied to the output of another. The chain rule tells you how to differentiate them.

Rates multiply

Imagine three gears. Gear A turns gear B twice as fast, and gear B turns gear C three times as fast. How fast does C turn compared with A? Six times. Rates of change chain together by multiplication.

In symbols, if yy depends on uu and uu depends on xx:

dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}

It looks as if the dudu‘s cancel. They don’t literally, but it is a helpful memory aid.

Sorted into groups: Function, Inner and outerFunction: (2x + 1)², (x² + 1)³, (3x - 2)⁴. Inner and outer: inner 2x+1, outer u², inner x²+1, outer u³, inner 3x-2, outer u⁴.Function(2x + 1)²(x² + 1)³(3x - 2)⁴Inner and outerinner 2x+1, outer u²inner x²+1, outer u³inner 3x-2, outer u⁴
Each function is an outer power of an inner bracket.

Inner and outer

For y=(3x+1)5y = (3x + 1)^5:

  • the inner function is u=3x+1u = 3x + 1;
  • the outer function is y=u5y = u^5.

The chain rule says: differentiate the outer function (leaving the inner one alone), then multiply by the derivative of the inner function.

Sorted into groups: Function, DerivativeFunction: (2x + 1)², (x² + 1)³. Derivative: 2(2x + 1) × 2 = 4(2x + 1), 3(x² + 1)² × 2x = 6x(x² + 1)².Function(2x + 1)²(x² + 1)³Derivative2(2x + 1) × 2 = 4(2x + 1)3(x² + 1)² × 2x = 6x(x² + 1)²
Chain rule: outer derivative, keep the inner, times the inner's derivative.

Worked examples

Example 1: A power of a bracket

Differentiate y=(3x+1)5y = (3x + 1)^5.

  1. Let u=3x+1u = 3x + 1, so y=u5y = u^5.
  2. dydu=5u4\dfrac{dy}{du} = 5u^4 and dudx=3\dfrac{du}{dx} = 3.
  3. Multiply: dydx=5u4×3=15u4\dfrac{dy}{dx} = 5u^4 \times 3 = 15u^4.
  4. Substitute back: 15(3x+1)415(3x + 1)^4.

Answer: dydx=15(3x+1)4\dfrac{dy}{dx} = 15(3x + 1)^4

Example 2: A square root

Differentiate y=x2+9y = \sqrt{x^2 + 9} and find the gradient at x=4x = 4.

  1. Rewrite as a power: y=(x2+9)1/2y = (x^2 + 9)^{1/2}.
  2. Outer: 12u−1/2\frac{1}{2}u^{-1/2}. Inner derivative: 2x2x.
  3. Multiply: dydx=12(x2+9)−1/2⋅2x=xx2+9\dfrac{dy}{dx} = \frac{1}{2}(x^2 + 9)^{-1/2} \cdot 2x = \dfrac{x}{\sqrt{x^2 + 9}}.
  4. At x=4x = 4: 425=45\dfrac{4}{\sqrt{25}} = \dfrac{4}{5}.

Answer: xx2+9\dfrac{x}{\sqrt{x^2 + 9}}; gradient 0.80.8 at x=4x = 4.

Example 3: Exponential growth

A population is modelled by P=500e0.2tP = 500e^{0.2t}. Find the rate of growth when t=5t = 5.

  1. Inner function 0.2t0.2t has derivative 0.20.2.
  2. dPdt=500×0.2 e0.2t=100e0.2t\dfrac{dP}{dt} = 500 \times 0.2\, e^{0.2t} = 100e^{0.2t}.
  3. At t=5t = 5: 100e1≈271.8100e^{1} \approx 271.8.

Answer: about 272272 individuals per unit time.

Example 4: A chain of three

Differentiate y=sin⁡2(4x)y = \sin^2(4x), which means [sin⁡(4x)]2[\sin(4x)]^2.

  1. Outermost: the square, giving 2sin⁡(4x)2\sin(4x).
  2. Middle: sin⁡\sin, whose derivative is cos⁡(4x)\cos(4x).
  3. Innermost: 4x4x, with derivative 44.
  4. Multiply all three: 2sin⁡(4x)⋅cos⁡(4x)⋅4=8sin⁡(4x)cos⁡(4x)2\sin(4x) \cdot \cos(4x) \cdot 4 = 8\sin(4x)\cos(4x).

Answer: 8sin⁡(4x)cos⁡(4x)8\sin(4x)\cos(4x)

The most common mistake is forgetting the final “times the derivative of the inside”. If the inside is anything more than plain xx, the chain rule applies.

Why it matters

Real-world quantities are rarely simple functions of one variable; they are layered. The area of a ripple depends on its radius, which depends on time, so how fast is the area growing? The chain rule answers “related rates” questions like this. It is also the engine behind backpropagation, the algorithm that trains neural networks by passing derivatives back through layer after layer of composite functions.

Practice

Your turn. Type or choose an answer, then press Check. Getting one wrong is fine, that is what practice is for. You can try as many times as you like.

Question 1 of 8

Find the gradient of y=(2x+1)2y = (2x + 1)^2 at x=1x = 1.

Question 2 of 8

Find the gradient of y=(x2+1)3y = (x^2 + 1)^3 at x=1x = 1.

Question 3 of 8

Find the gradient of y=(3x−2)4y = (3x - 2)^4 at x=1x = 1.

Question 4 of 8

Find the gradient of y=(5x)2y = (5x)^2 at x=1x = 1.

Question 5 of 8

Find the gradient of y=(x+4)5y = (x + 4)^5 at x=−3x = -3.

Question 6 of 8

Find the gradient of y=(x2−3)2y = (x^2 - 3)^2 at x=2x = 2.

Question 7 of 8

Find the gradient of y=(4x+1)2y = (4x + 1)^2 at x=0x = 0.

Question 8 of 8

The chain rule says to multiply:

Choose one answer