Differential Calculus
The Chain Rule
Almost every function that appears outside a textbook is built by composition — , , — and none of the rules so far can differentiate a single one of them. The chain rule is the one tool that handles composition, and once you add it to the sum, product and quotient rules you can differentiate every elementary function you are able to write down. It is also the rule that is misapplied most often, and almost always in exactly one way: by forgetting the derivative of the inside.
Statement of the rule
Theorem (Chain Rule). Suppose is differentiable at , and is differentiable at the point . Then the composite , defined by , is differentiable at and
Read the hypotheses carefully. The outer function must be differentiable at — the output of the inner function — not at . It is not enough for to be differentiable at , and it is not enough for the composite to be defined. The last row of the "Common mistakes" table below, and the "Restriction" column of the templates table, show what goes wrong when this hypothesis fails: for instance with at , where is differentiable, , and is not differentiable at — and indeed has no derivative at .
Leibniz notation. Introduce an intermediate variable: let and . If is differentiable at and is differentiable at , then
where is evaluated at . That last clause carries all the content of "" and is exactly what Leibniz notation hides.
Working form. For any differentiable ,
— derivative of the outside, inside left untouched, times the derivative of the inside.
Why "cancelling " is a mnemonic, not a proof
The tempting argument needs , and can vanish at points arbitrarily close to (take , ). The repair: because is differentiable at , define
Then is continuous at and for every , including . So for ,
an identity that survives . Since is differentiable at it is continuous there, so and , while the second factor tends to . That is the theorem.
Identifying the inner and the outer function
Ask: if I evaluated this at on a calculator, which key would I press last? That last operation is the outer function; everything pressed before it is the inner function.
| Expression | Inner | Outer | Derivative |
|---|---|---|---|
Rows 2 and 3 are the point of the exercise: and are different functions and the roles of inner and outer are swapped.
Standard templates
Throughout, is differentiable and .
| Function | Derivative | Restriction |
|---|---|---|
| a negative integer: need ; not an integer: need | ||
| (not differentiable where ) | ||
| — | ||
| , , | ||
| — | ||
| — | ||
| the workhorse special case |
Worked example 1 — plain composition
Differentiate and find .
Outer: fifth power. Inner: , so .
At : and , so .
Check. Expanding the fifth power is impractical, so use a centred difference with : , , and . Agreed.
Worked example 2 — product rule and chain rule together
Differentiate . (Defined for ; differentiable for , since fails to be differentiable at .)
The outermost operation is a product, so the product rule fires first; the chain rule is then needed inside it.
Check at . Final formula: . Third line, computed independently: . The two match.
Repeated (nested) application
For three layers, , or in Leibniz form . Peel from the outside in; every layer contributes exactly one factor, and you stop when what remains inside is itself.
Take — three layers: cube, sine, .
At we have , , , so . A centred difference at with gives , confirming .
Which rule fires first
Look at the outermost operation of the whole expression:
| Outermost operation | Rule that fires first |
|---|---|
| sum or difference | sum rule, then treat each term separately |
| product of two non-constant factors | product rule |
| a fraction | quotient rule, or rewrite as a product with a negative power |
| a function applied to something | chain rule |
So is a fourth power on the outside: chain rule first, quotient rule inside. But is a fraction on the outside: quotient rule first, chain rule inside.
Common mistakes
| Wrong | Right | What went missing |
|---|---|---|
| the inner derivative | ||
| the inner derivative | ||
| the inner derivative | ||
| the inner derivative | ||
| the inner derivative | ||
| the outer derivative must be evaluated at , not at | ||
| is evaluated at and multiplied by | ||
| the chain rule multiplies; it never adds | ||
| the power rule does not apply to a variable exponent | ||
| means ; the outer function is the square | ||
| chain rule inside the product rule | ||
| stopping at | multiply by , then substitute | the answer must be a function of |
| for every | only for or | a non-integer power needs a positive base |
One structural error deserves its own line, because it is the single most common: the missing inner derivative. Whenever your answer to contains no factor of at all, and is not simply , you have made it.
Key terms
- composite function
- chain rule
- inner function
- outer function
- intermediate variable
- Leibniz notation
- general power rule
- nested composition
- outermost operation
- missing inner derivative
- product rule
- quotient rule
- differentiability at a point
- Caratheodory factorisation
- domain restriction
- horizontal tangent
Practice Problems
Differentiate and evaluate .
Show hint
The outermost operation is "raise to the tenth power". Whatever sits inside the bracket must contribute its own derivative as a separate factor.
Show answer
Set , so that and .
This is the workhorse special case with : the constant simply multiplies through.
Now evaluate at . The inside is , and
so
Check. , and can be re-derived as . Both agree.
Answer: and .
For each function, name the inner function and the outer function, then differentiate.
(a) (b) (c) (d)
Show hint
For (d), rewrite as before deciding what is on the outside — it is not the same function as .
Show answer
(a) Inner with ; outer .
(b) Inner with ; outer .
(c) Inner with ; outer .
Valid for only: the function itself needs , i.e. , and the outer function is not differentiable at . At the left endpoint the graph begins with a one-sided vertical tangent, since as .
(d) Here , so the inner function is with , and the outer function is .
Check of (d) two ways. Directly at , where :
Independently, use the identity , so and
At this is , the same value. (In general and , so the two expressions are identical.)
Answers: (a) (b) (c) for (d) .
Let . Find , state where the formula is valid, and evaluate the derivative at .
Show hint
A reciprocal is a negative power. Rewriting it that way turns a quotient-rule problem into a one-line chain-rule problem.
Show answer
Rewrite as a power: . The inner function is with ; the outer function is .
Validity: we need , so the formula holds for all except and (where itself is undefined).
Evaluate at : the inside is , and , while . Hence
Check by a second method (quotient rule). Write with , so by the chain rule. Then
the same expression. A centred difference with at also gives .
Answer: for , and the value at is .
Let . Find as a single fraction, state where it is valid, and compute .
Show hint
The outermost operation of the whole expression is a product, so decide which rule fires first before you touch the square root.
Show answer
Domain. We need , i.e. . Since is not differentiable at , is differentiable on (at there is a one-sided vertical tangent).
Set up. The outermost operation is a product, so use the product rule with and . Then , and the chain rule gives
Differentiate and combine.
(The first step uses to put both terms over the same denominator.)
Evaluate at . Here and , so
Check from the unsimplified line. . The two routes agree.
Answer: for , and .
Let . Find and evaluate .
Show hint
The whole expression is a fraction, so the quotient rule fires first — but the numerator still needs the chain rule on the way.
Show answer
Set up. Quotient rule with and . Note for every real , so there is no domain restriction.
The numerator needs the chain rule (inner , inner derivative ):
Apply the quotient rule.
Evaluate at . With and ,
Check. For small , and , so near the origin; a curve behaving like has slope at . A centred difference with gives , consistent with .
Answer: and .
Let . Find , and give the exact value of .
Show hint
There are three layers here. Start at the outermost operation — the exponential — and work inwards, picking up one factor per layer.
Show answer
Layers. Outermost: . Middle: . Innermost: .
Validity. Since , the middle square root is never being differentiated at , and the exponential is differentiable everywhere. So the formula holds for every real — no restrictions.
Evaluate at . Then and , so
Checks. (i) A centred difference with gives
matching . (ii) Structurally, is an even function of , so its derivative must be odd and must vanish at — and the formula does give .
Answer: , and .
Let . Find , state precisely where the formula is valid, and evaluate exactly.
Show hint
Three nested layers again — root, then the tangent expression, then . This time the domain deserves a full sentence of its own.
Show answer
Layers. Outermost: . Middle: . Innermost: .
Validity. The function itself is defined where and . For the derivative formula there are two separate conditions, one per layer:
- must exist and be differentiable, so , i.e. , i.e. for integers .
- The outer must be differentiable at , which requires strictly.
At a point where — that is, , so — the function is defined and equals , but the formula fails. Because is increasing, just to the left of such a point, so the function is not even defined there: the point is a left endpoint of a piece of the domain, and the graph starts with a one-sided vertical tangent ( while , so ).
Evaluate at . Then , where and , so
Therefore
Check. A centred difference with : and , so the slope is about . Compare : the two agree to four decimal places, the residual gap being the usual error of a centred difference.
Answer: wherever and ; and .
The table gives values of two differentiable functions and together with their derivatives.
Find each of the following.
(a) (b) (c) (d) (e) , where
Show hint
Write the formula down first, in symbols, and only then look up numbers — the trap is reading from the wrong row.
Show answer
In every part, apply : the outer derivative is evaluated at the output of the inner function.
(a) . From the table, and , and then . So
(b) . Here and , and . So
(c) . Here and , and . So
(d) . Here and , and . So
(e) has inner function with , so . At the inside is , so
What to notice. In (a) the outer derivative is , not : you must feed the value . Compare (a) with (b): reversing the order of composition uses entirely different table entries and gives a different answer ( versus ). And in (e), even though the inner function is as simple as , its derivative still appears as a factor.
Answers: (a) (b) (c) (d) (e) .
A student is asked to differentiate and writes
Identify every separate error in this line, produce the correct derivative in factored form, and evaluate it at .
Show hint
There are three distinct mistakes: one about which rule applies to a product, and two of exactly the same kind about missing factors.
Show answer
Error 1 — the product rule was never used. The derivative of a product is not the product of the derivatives: in general . The correct opening is , which produces two terms, not one.
Error 2 — missing inner derivative in the first factor. By the chain rule,
The factor was dropped.
Error 3 — missing inner derivative in the second factor. Again by the chain rule,
The factor was dropped.
Correct computation. Product rule with and :
Verify the factoring by expanding back: , and . Both terms are recovered.
Value at . With and ,
Check. Near we have and , so and the slope at the origin is . A centred difference with gives . By contrast, the student's expression would have produced — off by a factor of nearly three.
Answer: , and .
Let . Find , state the largest set on which the formula is valid and explain what happens at the ends, then find every point on the curve where the tangent line is horizontal.
Show hint
Product rule first, chain rule on the root, then put everything over a single denominator before you set anything equal to zero.
Show answer
Domain of . We need , i.e. .
Differentiate. The outermost operation is a product, so use the product rule with and . For the chain rule gives
Hence
Where the formula is valid. The chain rule requires the outer function to be differentiable at , and is not differentiable at . So the formula holds exactly on the open interval . At the denominator vanishes and the derivative does not exist: the numerator there is while the denominator tends to , so the one-sided derivative tends to at each end and the curve meets the -axis with a vertical tangent. This is a genuine failure of a hypothesis of the chain rule, not just a bookkeeping nuisance.
Horizontal tangents. A horizontal tangent needs , which for a fraction means the numerator vanishes while the denominator is defined and nonzero:
and both values lie inside , so both are legitimate. The corresponding -values are
Check without calculus. Squaring, . For nonnegative numbers and with fixed, the product is largest when , giving . So the largest possible value of is , attained exactly when , and there . That is precisely the pair of points found above — extreme values, so horizontal tangents. A centred difference at with gives , matching .
Answer: , valid on with vertical tangents at ; horizontal tangents occur at and .
Differentiate in two independent ways — (i) chain rule on the outside with the quotient rule inside, and (ii) after rewriting the expression as a product involving a negative power — and confirm the two answers agree. Then evaluate .
Show hint
For (i), ask which operation you would perform last when evaluating the expression. For (ii), remember .
Show answer
Throughout, .
(i) Chain rule outside, quotient rule inside. The outermost operation is the fourth power, so the inner function is and the outer function is . First differentiate by the quotient rule:
Then
(ii) Product rule with a negative power. Write . Each factor needs the chain rule:
So
(In the second line the common factor was pulled out; the first term supplies because .)
The two methods give the same expression, as they must.
Evaluate at . Here and , so
Numerical check. and , so the centred difference is , agreeing with .
Answer: for , and .
(a) Let be differentiable with , , and . Define and . Compute and , and say why they use completely different pieces of data.
(b) Applying the chain rule mechanically to gives . For which is this actually correct, and precisely which hypothesis of the chain rule fails elsewhere?
Show hint
In (a), decide for each function which piece is on the outside. In (b), recall that the theorem asks the outer function to be differentiable at , not at .
Show answer
(a)
For the outer function is and the inner function is , so
At the inside is , hence
For the outer function is the cube and the inner function is , so
At , using and ,
Why the data differ: in , the derivative is evaluated at the output of the inner function, namely , so uses and never touches or . In , is the inner function, so everything is evaluated at and never touches or . Swapping which function sits on the outside changes not only the formula but even which table entries are relevant. (Notice also that is needed for but is never used at all.)
(b)
First simplify honestly: for every real , since the square root returns the nonnegative root. The mechanical answer is
and it is undefined at .
That is correct for every : for the function is with derivative , and for it is with derivative .
At the chain rule does not apply. Take and . The inner function is fine: is differentiable at with . The hypothesis that fails is " is differentiable at ": here , and is not differentiable at , because
The conclusion fails as well, so nothing is being rescued by luck: has no derivative at , since the difference quotients equal for and for , and the two one-sided limits disagree.
Moral: differentiability of the outer function must be checked at the point , not at . This is also the reason the general power rule carries the restriction whenever is not an integer.
Answers: (a) and . (b) The formula is valid for all ; at the hypothesis that the outer function be differentiable at fails, and is genuinely not differentiable there.
