The rule for a function inside a function, and the one students most often apply without noticing they needed to.
By the end of this chapter you can
Identify the outer and inner function in a composition
Differentiate nested compositions correctly
Explain why the inner derivative appears as a factor
Recognise a composition disguised as something simpler
Everything so far differentiated functions that were added, multiplied or
divided. The chain rule handles the remaining way to build a function: putting
one inside another.
dxdf(g(x))=f′(g(x))⋅g′(x)
In words: differentiate the outside, leave the inside alone, then multiply by
the derivative of the inside.
That final factor is the whole rule. Forgetting it is the single most common
mistake in differential calculus, and it is silent — the answer looks plausible.
Why the inner derivative is there
Think about rates. If y changes three times as fast as u, and u changes
five times as fast as x, then y changes fifteen times as fast as x. Rates
through a chain multiply:
dxdy=dudy⋅dxdu
which is the same statement in Leibniz notation, and is the version worth
remembering because the cancellation is a useful mnemonic — even though the
symbols are not really fractions being cancelled.
dxdsin(2x)=2cos(2x)
dxdsin(x2)=2xcos(x2)
dxde3x=3e3x
dxd(x2+1)5=10x(x2+1)4
checked by the build
Look at the first: sin(2x) oscillates twice as fast as sinx, so its slope
is twice as steep. The factor of 2 is not bookkeeping — it is the function
genuinely changing twice as quickly.
{
"kind": "secant",
"title": "sin(2x) — the inner factor of 2 is visible as the steeper slope",
"fn": "sin(2*x)",
"domain": [-0.2, 3.2],
"range": [-1.6, 1.6],
"at": 0,
"controls": [
{ "name": "h", "label": "h", "min": 0.02, "max": 1.5, "step": 0.01, "value": 1.0 }
]
}
Drag h towards zero at x=0: the slope heads for 2, not 1. The
derivative of sinx at zero is 1; compressing the input doubles it.
Spotting the composition
The hard part is not the rule, it is noticing that a composition is present.
Ask: to evaluate this at a number, what would I compute first? That inner
computation is g.
Expression
Inner g
Outer f
sin(x2)
x2
sin
(3x+1)7
3x+1
()7
ecosx
cosx
e()
1−x2
1−x2
ln(5x)
5x
ln
dxd(3x+1)7=21(3x+1)6
dxdecos(x)=−ecos(x)sin(x)
dxd1−x2=−1−x2x
dxdlog(5x)=x1
checked by the build
The last one is worth pausing on. The chain rule gives
5x1⋅5=x1 — the 5 cancels entirely. That is not a
coincidence: ln(5x)=ln5+lnx, and ln5 is a constant, so the two
functions differ by a constant and must have the same derivative. Two routes,
one answer, and each checks the other.
Nesting deeper
Three layers is the same rule applied twice, working outward in:
dxdf(g(h(x)))=f′(g(h(x)))⋅g′(h(x))⋅h′(x)
dxdsin(e2x)=2e2xcos(e2x)
dxdsin3(x2)=6xsin2(x2)cos(x2)
checked by the build
Peel one layer at a time and write each factor as you go. The mechanical
discipline matters more than cleverness here — most errors in nested problems
are dropped factors, not misunderstood rules.
Where it shows up next
The chain rule is not one topic among several. It is the machinery behind:
implicit differentiation — every y is secretly y(x), so differentiating
it produces dxdy as an inner derivative,
related rates — every quantity is secretly a function of t,
u-substitution in integration, which is the chain rule run backwards.
Getting comfortable now pays three more times before the course ends.
{
"question": "What is the derivative of (x³ + 1)⁴?",
"options": [
{
"text": "12x²(x³ + 1)³",
"correct": true,
"why": "Outer: 4( )³. Inner: x³ + 1, whose derivative is 3x². Multiply: 4(x³+1)³ · 3x² = 12x²(x³+1)³."
},
{
"text": "4(x³ + 1)³",
"correct": false,
"why": "This is the classic omission — correct only if the inside were x. The inner derivative 3x² is owed, and the answer looks entirely reasonable without it, which is what makes the mistake dangerous."
},
{
"text": "4(3x²)³",
"correct": false,
"why": "This differentiates the inside and then applies the outer power to the result. The outer function must be evaluated at the inside itself, not at the inside's derivative."
},
{
"text": "12x²(x³ + 1)⁴",
"correct": false,
"why": "The inner factor is right but the outer power was not reduced. Differentiating ( )⁴ gives 4( )³ — the exponent drops by one, exactly as in the power rule."
}
]
}