Lesson 1 of 7 · 16 min

Composite functions and the chain rule

See why a function of a function needs a new rule, split it into inside and outside functions, and differentiate it with dydx=dydu×dudx\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}.

What you will be able to do

  • Recognise a composite function and identify the inside function u=g(x)u = g(x) and the outside function y=f(u)y = f(u).
  • Explain why the chain rule multiplies rates: dydx=dydu×dudx\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}.
  • Differentiate powers of polynomials by substituting u, differentiating twice and multiplying.

You can differentiate y=(2x+1)2y = (2x + 1)^2 by expanding: y=4x2+4x+1y = 4x^2 + 4x + 1, so dydx=8x+4\frac{dy}{dx} = 8x + 4.

Now try to guess the answer with the power rule, treating the bracket like xx. "Bring the 2 down and drop the power by 1" gives 2(2x+1)=4x+22(2x + 1) = 4x + 2. That is exactly half of the right answer. Something is missing, and it matters even more for (2x+1)20(2x + 1)^{20}, which nobody wants to expand.

Definition

Composite functions

A composite function is a function of a function. In y=(2x+1)2y = (2x + 1)^2, you first work out u=2x+1u = 2x + 1 (the inside function), then square it, y=u2y = u^2 (the outside function).

FunctionInside, u=g(x)u = g(x)Outside, y=f(u)y = f(u)
(2x+1)20(2x + 1)^{20}2x+12x + 1u20u^{20}
x2+9\sqrt{x^2 + 9}x2+9x^2 + 9u\sqrt{u}
1(3x−4)2\frac{1}{(3x - 4)^2}3x−43x - 41u2\frac{1}{u^2}

For y=x3−5xy = \sqrt{x^3 - 5x}, which is the inside function uu?

Choose one answer

Why rates multiply. Picture two gears. The small gear xx drives a middle gear uu, which drives a big gear yy. If uu turns 3 times as fast as xx, and yy turns 2 times as fast as uu, then yy turns 2×3=62 \times 3 = 6 times as fast as xx.

Derivatives are rates, and they chain together the same way. For y=(2x+1)2y = (2x + 1)^2: u=2x+1u = 2x + 1 changes twice as fast as xx (dudx=2\frac{du}{dx} = 2), and y=u2y = u^2 changes 2u2u times as fast as uu (dydu=2u\frac{dy}{du} = 2u). So yy changes 2u×2=4(2x+1)2u \times 2 = 4(2x + 1) times as fast as xx. That matches 8x+48x + 4 from expanding. The missing factor was the 2 from the inside.

A small change in xx is multiplied by dudx\frac{du}{dx} to give the change in uu, which is multiplied by dydu\frac{dy}{du} to give the change in yy.

Key idea

The chain rule

If y=f(u)y = f(u) and u=g(x)u = g(x), then

dydx=dydu×dudx.\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}.

In words: differentiate the outside function, keeping the inside as it is, then multiply by the derivative of the inside. The rule is on the QCAA formula sheet.

The chain rule by substitution

  1. Name the inside function uu

    Write u=g(x)u = g(x), so that y=f(u)y = f(u) is a simple power of uu.

  2. Differentiate both

    Find dydu\frac{dy}{du} with the power rule, and dudx\frac{du}{dx}.

  3. Multiply

    dydx=dydu×dudx\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}.

  4. Replace uu

    Write the answer in terms of xx only, with the number in front.

Worked example

Differentiate y=(3x2−5)4y = (3x^2 - 5)^4 with the chain rule

  • Simple familiar
  • Technology free

Use the chain rule to find dydx\frac{dy}{dx} for y=(3x2−5)4y = (3x^2 - 5)^4.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Let uu be the inside function, so yy is a power of uu.

  2. Find dydu\frac{dy}{du} and dudx\frac{du}{dx}.

  3. Multiply, then replace uu with the expression in xx.

Watch out for

  • Writing 4(3x2−5)34(3x^2 - 5)^3: the factor dudx=6x\frac{du}{dx} = 6x is missing.

  • Writing 4(6x)34(6x)^3: the inside is kept as it is in dydu\frac{dy}{du}, not differentiated.

Find dydx\frac{dy}{dx} for y=(5x−2)3y = (5x - 2)^3.

fracdydx =
Reads asYour answer shows here as maths.
Interactive

Where the chain rule gives a zero gradient

Here u=x2−1u = x^2 - 1 and dydx=2u×2x=4x(x2−1)\frac{dy}{dx} = 2u \times 2x = 4x(x^2 - 1). Drag the point to x=−1x = -1, 00 and 11. The tangent is horizontal at x=±1x = \pm 1 because the outside factor 2u2u is zero, and at x=0x = 0 because the inside gradient 2x2x is zero.

Common mistake

Two ways to lose the mark

  • Forgetting dudx\frac{du}{dx}. ddx(3x−1)5=5(3x−1)4×3=15(3x−1)4\frac{d}{dx}(3x - 1)^5 = 5(3x - 1)^4 \times 3 = 15(3x - 1)^4, not 5(3x−1)45(3x - 1)^4.
  • Changing the inside. The bracket stays as it is in dydu\frac{dy}{du}: ddx(x2+1)3=3(x2+1)2×2x\frac{d}{dx}(x^2 + 1)^3 = 3(x^2 + 1)^2 \times 2x, not 3(2x)23(2x)^2.

When the inside is just xx, dudx=1\frac{du}{dx} = 1 and the chain rule is the plain power rule. That is why the power rule always worked before.

Find dydx\frac{dy}{dx} for y=(1−x2)5y = (1 - x^2)^5.

fracdydx =
Reads asYour answer shows here as maths.
Why the chain rule works

Let xx change by a small amount Δx\Delta x. Then uu changes by Δu\Delta u, and yy changes by Δy\Delta y. As long as Δu≠0\Delta u \ne 0, ordinary fractions cancel:

ΔyΔx=ΔyΔu×ΔuΔx.\frac{\Delta y}{\Delta x} = \frac{\Delta y}{\Delta u} \times \frac{\Delta u}{\Delta x}.

As Δx→0\Delta x \to 0, Δu→0\Delta u \to 0 too, because uu changes smoothly. Each fraction becomes a derivative:

dydx=dydu×dudx.\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}.

The derivatives are not really fractions, but Leibniz notation is designed so that the rule looks like cancelling dudu. A complete proof also handles the case where Δu=0\Delta u = 0, which is beyond this course.

Summary

  • A composite function y=f(g(x))y = f(g(x)) has an inside function u=g(x)u = g(x) and an outside function y=f(u)y = f(u).

  • The chain rule: dydx=dydu×dudx\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}. Rates of change multiply, like gears.

  • Differentiate the outside with the inside kept as it is, then multiply by the derivative of the inside.

  • The most common error is leaving out dudx\frac{du}{dx}.

  • When the inside is just xx, the chain rule reduces to the power rule.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 1 of 70% read

Save your progress with a free account