Differentiating composite functions using the chain rule.
Answer at least 3 of 3 correctly to complete this section.
You already know how to differentiate x3, sinx, and ex. But what about sin(x2)? Or (3x+1)5? Or e2x?
These are all composite functions — one function applied inside another. The basic rules you learnt for polynomials, trig, and exponentials do not work directly here. You need a new tool: the chain rule.
The chain rule is one of the most frequently tested differentiation techniques at A-Level. It appears in almost every calculus question, often combined with the product rule or quotient rule. Master it here, and the rest of differentiation becomes far more manageable.
A composite function is a “function of a function” — you apply one function, then apply another to the result. In notation: f(g(x)).
Here is the key question to ask yourself:
Is the argument of the function just x? If not, you probably need the chain rule.
Compare these pairs:
| Simple (no chain rule needed) | Composite (chain rule needed) |
|---|---|
| sin(x) | sin(x2) — the argument is x2, not x |
| ex | e3x+1 — the argument is 3x+1, not x |
| x4 | (2x+3)4 — the base is 2x+3, not x |
| ln(x) | ln(x2+1) — the argument is x2+1, not x |
In each composite case, there is an outer function (the sin, exp, power, or log) and an inner function (what is inside the brackets). The chain rule tells you how to differentiate the whole thing.
Watch out: Students often try to differentiate (2x+3)4 by writing 4(2x+3)3 and stopping there. This is incomplete — you must also multiply by the derivative of the inner function. Forgetting this is the single most common chain rule error in exams.
Use the tool below to pick an outer and inner function. Step through to see what happens when you differentiate the composite. Can you spot the pattern before we state the rule?
Answer at least 3 of 4 correctly to complete this section.
If y=f(g(x)), let u=g(x) so that y=f(u). Then:
dxdy=dudy⋅dxdu
In function notation: dxd[f(g(x))]=f′(g(x))⋅g′(x)
Think of it as a rate-of-change chain. If y changes 3 times as fast as u, and u changes 5 times as fast as x, then y changes 3×5=15 times as fast as x. The chain rule simply multiplies these rates together.
The Leibniz notation makes this intuitive — it looks like the du terms “cancel”:
dxdy=dudy⋅dxdu
(They do not literally cancel as fractions, but the pattern is a reliable way to remember the rule.)
Differentiate y=(2x+3)4
Step 1: Let u=2x+3, so y=u4
Step 2: dudy=4u3
Step 3: dxdu=2
Step 4: dxdy=4u3⋅2=8u3
Step 5: Substitute back: dxdy=8(2x+3)3
Differentiate y=sin(x2)
Let u=x2, so y=sinu
dxdu=2x,dudy=cosu
dxdy=cos(x2)⋅2x=2xcos(x2)
Differentiate y=e3x+1
Let u=3x+1, so y=eu
dxdu=3,dudy=eu
dxdy=3e3x+1
Watch out: The derivative of e3x+1 is 3e3x+1, not e3x+1. The factor of 3 (derivative of the inner function) is essential. If you forget it, you will lose marks every time.
Differentiate y=ln(x2+1)
Let u=x2+1, so y=lnu
dxdu=2x,dudy=u1
dxdy=x2+12x
Answer at least 3 of 4 correctly to complete this section.
These results follow directly from the chain rule applied to the linear inner function ax+b. They come up so often that you should memorise them — it will save you time in exams.
| y | dxdy |
|---|---|
| (ax+b)n | an(ax+b)n−1 |
| sin(ax+b) | acos(ax+b) |
| cos(ax+b) | −asin(ax+b) |
| eax+b | aeax+b |
| ln(ax+b) | ax+ba |
Take the first row. If y=(ax+b)n, let u=ax+b:
dudy=nun−1,dxdu=a
dxdy=nun−1⋅a=an(ax+b)n−1
Every row in the table follows the same pattern: differentiate the outer, then multiply by a (the derivative of the inner function ax+b).
Tip: Notice that dxd[ln(ax+b)]=ax+ba. The numerator is the derivative of what is inside the log. This “derivative on top, function on the bottom” pattern is extremely useful for integration too.
Without looking at the table above, find the derivative of each function. Then check your answers against the standard results.
When the inner function is not linear (e.g., x2, x3, sinx), you cannot use the table directly. You must apply the full chain rule method from Section 2. For example:
dxd[sin(x2)]=cos(x2)⋅2x=2xcos(x2)
The derivative of the inner function here is 2x, not a constant.
Answer at least 3 of 4 correctly to complete this section.
A very common application of the chain rule is differentiating powers of trig functions — expressions like sin2(x), cos3(x), or tan4(x).
The notation cos3(x) means [cos(x)]3 — that is, “take cos(x) and cube the result”. It does not mean cos(x3). These are completely different functions:
| Notation | Meaning | Outer function | Inner function |
|---|---|---|---|
| cos3(x) | [cos(x)]3 | Cube | cos(x) |
| cos(x3) | cos of x3 | cos | x3 |
Tip: If the notation confuses you, rewrite with square brackets: cos3(x)=[cos(x)]3. This makes the structure completely clear.
Differentiate y=cos3(x)=[cos(x)]3
Here the outer function is the cube, and the inner is cos(x):
dxdy=3[cos(x)]2⋅(−sinx)=−3sin(x)cos2(x)
Differentiate y=sin2(x)=[sin(x)]2
Outer: square. Inner: sin(x).
dxdy=2sin(x)⋅cos(x)=2sin(x)cos(x)
(This also equals sin(2x) by the double angle formula.)
For any trig function raised to a power:
dxd[sinn(x)]=nsinn−1(x)⋅cos(x)
dxd[cosn(x)]=ncosn−1(x)⋅(−sinx)=−nsin(x)cosn−1(x)
The chain rule structure is always the same: differentiate the outer power, then multiply by the derivative of the trig function inside.
Answer at least 3 of 4 correctly to complete this section.
Sometimes you need to apply the chain rule twice (or more). This happens when you have three or more functions nested inside each other — for example, an exponential of a trig function of a linear expression.
Differentiate y=esin(2x)
There are three layers here:
Apply the chain rule from outside in:
dxdy=deriv of outeresin(2x)⋅deriv of middlecos(2x)⋅deriv of inner2
dxdy=2cos(2x)esin(2x)
Each time you “peel off” a layer, multiply by the derivative of that layer. You stop when you reach plain x.
For esin(2x):
Answer at least 3 of 3 correctly to complete this section.
These questions mix all the techniques from this lesson. In the exam, you will not be told “use the chain rule” — you must recognise when it is needed.
Differentiate y=4x2+1
Rewrite as a power: y=(4x2+1)1/2
Let u=4x2+1, so y=u1/2
dxdu=8x,dudy=21u−1/2
dxdy=21(4x2+1)−1/2⋅8x=4x2+14x
Differentiate y=e−x2
Let u=−x2, so y=eu
dxdu=−2x,dudy=eu
dxdy=−2xe−x2
Exam tip: When you see e−x2, this is the basis of the normal distribution curve. Its derivative −2xe−x2 appears frequently in statistics-related calculus questions.
Answer at least 3 of 4 correctly to complete this section.
Lock in what you've learned with exam-style questions and spaced repetition.
First principles, differentiating x^n, gradient functions, rates of change.
Derivatives of sin x, cos x, tan x and their compositions.
Derivatives of e^x, a^x, ln x and their compositions.
Differentiating implicitly defined functions, finding tangents to implicit curves.
Using the chain rule to connect rates of change in applied contexts.
Using substitution to integrate composite functions, reversing the chain rule.