Back to the on-screen lesson ·

The chain rule

Differentiating a composite, why there are two factors, and the factor everyone forgets.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to name the outer and inner functions of a composite before differentiating either, apply the chain rule with the outer derivative evaluated at the inner function and the inner derivative present as a second factor, handle three or more layers with one factor per layer, recognise composites hidden inside roots, reciprocals and trigonometric expressions, and read the rule as a statement about rates multiplying through a chain.

2. Outside at the inside, times the inside

If $f$ is differentiable at $g(a)$ and $g$ is differentiable at $a$, then $$\bigl(f \circ g\bigr)'(a) = f'\bigl(g(a)\bigr) \cdot g'(a).$$ In Leibniz notation, with $y = f(u)$ and $u = g(x)$: $$\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}.$$

Two things are easy to get wrong and they are both in the first line.

$f'$ is evaluated at $g(a)$, not at $a$. The outer derivative is asked about the place the inner function actually reached.

The second factor exists. $g'(a)$ is the most-forgotten symbol in first-year calculus. It is invisible in the easiest examples — when $g(x) = x + c$, $g' = 1$ and leaving it out changes nothing — which is exactly how the habit of omitting it forms.

Why there are two factors. Read it as rates. If $y$ changes $3$ times as fast as $u$, and $u$ changes $5$ times as fast as $x$, then $y$ changes $15$ times as fast as $x$. Rates through a chain multiply, and that is the whole content.

More layers, more factors. $\bigl(f(g(h(x)))\bigr)' = f'(g(h(x))) \cdot g'(h(x)) \cdot h'(x)$: peel from the outside in, one factor per layer, each outer derivative evaluated at everything still inside it.

Another way: picture

Three gears in a train. The first turns at some rate; the second is geared to it at $3:1$; the third to the second at $5:1$. The last gear turns $15$ times for one turn of the first — the ratios multiply along the chain. Reverse a gear and the sign flips, which is what a negative inner derivative does.

Another way: steps

  1. Write down the inside, $u = g(x)$, before differentiating anything.
  2. Write the outside as a function of $u$.
  3. Differentiate the outside with respect to $u$, and put $g(x)$ back in wherever $u$ appears.
  4. Multiply by $g'(x)$.
  5. Count the layers and count the factors; they must agree.

3. Where the chain rule hides

Half the uses of the rule are in expressions nobody labels as composites.

ExpressionInner functionOften mistaken for
$\sin(3x)$$3x$$\cos(3x)$, missing the $3$
$\sqrt{x^2 + 1}$$x^2 + 1$$\dfrac{1}{2\sqrt{x^2+1}}$, missing the $2x$
$e^{-kt}$$-kt$$e^{-kt}$, missing the $-k$
$\ln(5x)$$5x$$\dfrac{1}{5x}$, missing the $5$ — though here the answer is $\dfrac1x$ either way, by luck
$\dfrac{1}{(x+2)^3}$$x + 2$handled by the quotient rule, four times the work

The last row is worth a habit: a power of a bracket is a composite, and rewriting $\dfrac{1}{(x+2)^3}$ as $(x+2)^{-3}$ turns a quotient-rule problem into a chain-rule one.

And the $\ln(5x)$ row is worth a warning: an example where the missing factor does not change the answer teaches the wrong lesson. $\ln(5x) = \ln 5 + \ln x$, so its derivative really is $1/x$; the chain rule gives $\dfrac{1}{5x} \cdot 5$, which is the same thing. Do not generalise from it.

4. Where this goes wrong

Leaving off $g'(x)$. The defining error of the chain rule. The defence is to write the inner function down before differentiating: it is hard to forget the derivative of something already on the page.

Evaluating $f'$ at $a$ rather than at $g(a)$. For $f(u) = u^2$ and $g(x) = 3x$ at $a = 2$: the answer is $2 \cdot g(2) \cdot 3 = 36$, not $2 \cdot 2 \cdot 3 = 12$.

*Differentiating both layers and multiplying the functions.* $(f \circ g)'$ is not $f' \circ g'$; it is $(f' \circ g) \cdot g'$. The composition and the multiplication happen in different places.

Miscounting layers. $\sin^2(3x)$ has three: squaring, sine, and $3x$. Three factors: $2\sin(3x) \cdot \cos(3x) \cdot 3$.

Treating $\dfrac{dy}{dx}$ as a fraction because the rule looks like cancellation. It is a theorem that happens to be well served by the notation. The notation is not the proof.

5. The missing factor is invisible in exactly the examples used to teach the rule

$\bigl((x+1)^2\bigr)' = 2(x+1)$, and the chain rule's second factor is $1$, so leaving it out gives the right answer. The same for $\sin(x + 3)$, for $\sqrt{x - 2}$, for $e^{x+1}$. A learner can do a page of these correctly with a rule that is wrong.

The error only shows when the inner function has a derivative other than $1$ — and by then the habit is formed. So the discipline has to be established on the easy cases, where it costs nothing and buys nothing: always write the inner derivative down, even when it is $1$. It is one symbol, and it is the difference between knowing the rule and having got away with not knowing it.

6. A root, where rewriting makes the layers visible

  1. $f(x) = \sqrt{x^2 + 9}$. Rewrite as $(x^2+9)^{1/2}$, so the outside is $u^{1/2}$ and the inside is $x^2 + 9$.

    The rewrite is what shows the structure.

  2. Outer derivative at the inside: $\tfrac12 (x^2+9)^{-1/2}$. Inner derivative: $2x$.

    Two pieces, written separately.

  3. $f'(x) = \tfrac12 (x^2+9)^{-1/2} \cdot 2x = \dfrac{x}{\sqrt{x^2+9}}$. The $2$s cancelling is a coincidence of this example and not a rule.

7. Three layers, three factors

  1. $f(x) = \cos^3(2x)$, which is $\bigl(\cos(2x)\bigr)^3$: cube on the outside, cosine in the middle, $2x$ inside.

    Name all three before starting.

  2. Outermost: $3\bigl(\cos(2x)\bigr)^2$. Middle: $-\sin(2x)$. Innermost: $2$.

    One factor per layer.

  3. $f'(x) = 3\cos^2(2x) \cdot (-\sin(2x)) \cdot 2 = -6\cos^2(2x)\sin(2x)$.

    Three layers, three factors — count them and check.

8. Your turn: differentiate $f(x) = (4x^3 - 1)^5$

  1. Inside $u = 4x^3 - 1$, outside $u^5$.

    Name them first.

  2. Outer derivative at the inside: $5(4x^3-1)^4$. Inner derivative: $12x^2$.

  3. Your turn: work this step out. Its working is at the end of the packet.

    $f'(x) = 60x^2(4x^3 - 1)^4$.

9. Guided practice

Match each composite expression to the derivative factor its inner layer contributes.

Inner factor $2x$Inner factor 4Inner factor $3x^2$Inner factor $-1$
$(x^2+1)^7$
$\sin(4x)$
$e^{x^3}$
$\ln(5-x)$

10. Guided practice

Match each part of $f(x)=\sin((3x-1)^2)$ to its role in a chain-rule calculation.

Contributes $\cos((3x-1)^2)$Contributes $2(3x-1)$Contributes $3$Accounts for every nested dependency on $x$
The outer operation $\sin(u)$
The middle operation $u=v^2$
The inner operation $v=3x-1$
Multiply all three derivative factors

11. Practice

For $f(x) = (2x + 2)^2$, write $f'(x)$.

Answer:

12. Practice

For $f(x) = \cos(x^2)$, which is the outer function and which the inner?

13. Practice

For $f(x) = \sin(4x)$, the derivative is $f'(x) = 4\cos(4x)$. What is $f'(0.7)$, to four decimal places?

Answer:

14. Somewhere new

A balloon's volume grows at $3$ cm³ per cm of radius, and its radius grows at $9$ cm per second. How fast is the volume growing, in cm³ per second?

Answer:

15. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

16. Test question

Differentiate $f(x) = (2x - 5)^{5}$, leaving the bracket unexpanded.

Answer:

17. What you can do now

You can differentiate a composite of two or three layers and say where each factor came from. Say in your own words why the second factor is the one that gets forgotten. Next: the derivatives of the trigonometric functions.

Working for the steps left to you

8. Your turn: differentiate $f(x) = (4x^3 - 1)^5$, step 3

Two layers, two factors.