3.6 The Chain Rule

The chain rule for compositions and the intuition that rates multiply along a chain, the power form for a function raised to a power, chains of three or more functions, combining the chain rule with the product and quotient rules, the Leibniz form and why it resembles cancellation, and the proof.

Subject: Calculus I · 65 slides · symbolic lesson

Open the interactive version of this deck

What this lesson covers

The lesson, slide by slide

1. Section 3.6 The Chain Rule

Title

Calculus I · Chapter 3 — Derivatives

The Chain Rule

2. By the end of this lesson you can

Objectives

Five outcomes. This is the last structural rule, and after it every function built from Chapter 1's families is differentiable.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 250-258 — the section these objectives are drawn from

3. What you already have

Warm-up

Section 3.3 gave rules for sums, products and quotients, and Section 3.5 for the trigonometric functions. One kind of assembly is still missing.

Discussion prompt

You can differentiate sine, and you can differentiate 2x plus 1. Can you differentiate the sine of 2x plus 1 with any rule so far?

Hint: Composition is not a sum, a product or a quotient.

Answer:

\[ \sin(2x+1) \quad \text{- neither a sum, nor a product, nor a quotient} \]

No rule so far applies. Composition is a fourth way of building functions, and Section 1.1 already flagged it as different in kind from the arithmetic combinations.

The guess that the answer is simply cosine of 2x plus 1 is wrong, and testing it on a case you can expand shows why. This section supplies the missing rule, and it turns out to be a multiplication.

4. Rates multiply along a chain

Concept

If u changes three times as fast as x, and y changes five times as fast as u, then y changes fifteen times as fast as x. The derivative of a composition is the outer derivative, evaluated at the inner output, times the inner derivative.

the chain rule — For differentiable f and g, the derivative of f composed with g at x is f prime evaluated at g of x, multiplied by g prime of x. The outer derivative is evaluated at the inner function's output, never at x.

\[ \frac{d}{dx}\Big[f\big(g(x)\big)\Big] = f'\big(g(x)\big)\cdot g'(x) \]

The multiplication is the natural thing once you think in rates: each stage scales whatever the previous stage delivered, exactly as gear ratios compound. Adding would be the wrong operation entirely.

Figure (svg): Two machines in series with their rates multiplying along the chain

The bottom line is the whole rule, and the red warning is the whole difficulty.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 250-252

5. The rule and the intuition

Section

Section 1

6. Outer rate at the inner output, times inner rate

Concept

Differentiate the outer function, leaving its input alone, then multiply by the derivative of that input. The outer derivative must be evaluated at the inner function's output, which is what makes the rule more than a product.

outer and inner functions — In a composition, the outer function is the one applied last and the inner is applied first. The chain rule differentiates the outer at the inner's output and multiplies by the inner's derivative.

\[ y = f(u), \; u = g(x) \;\Longrightarrow\; \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} \]

The gear picture makes the multiplication inevitable. Three turns of the middle shaft per turn of the first, five of the last per turn of the middle, gives fifteen — the ratios compound rather than accumulate.

Figure (svg): Two gear pairs in series, showing why the ratios multiply rather than add

The gear picture is why the rule multiplies: each stage scales whatever the previous stage delivered.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 250-253 — the chain rule

7. Gears in series

Picture it

Two ratios compounding into one.

Figure (svg): Two gear pairs in series, showing why the ratios multiply rather than add

The gear picture is why the rule multiplies: each stage scales whatever the previous stage delivered.

Nothing about this requires calculus: it is how ratios behave whenever one thing drives another. The chain rule is that observation applied to instantaneous rates.

8. Worked example: a first chain rule

Worked example

Example 3.43. Outer first, then multiply.

\[ \text{Differentiate } y = \sin(2x + 1). \]

Name the layers

Why: Which function is applied last?

\[ \text{outer } \sin e,\text{ inner } 2 x + 1 \]

Differentiate the outer, leaving its input alone

Why: The derivative of sine is cosine.

\[ \cos(2 x + 1) \]

Differentiate the inner

Why: A linear function.

\[ 2 \]

Multiply

Why: The rule.

\[ y' = 2 \cos(2 x + 1) \]

Figure (svg): The solution to Worked example a first chain rule shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ y' = 2\cos(2x+1) \]

Verify: check the amplitude against the graph

Why: The function sine of 2x plus 1 completes a cycle twice as fast as sine, so its slopes must be twice as steep — and the derivative's amplitude is 2 rather than 1, exactly as required. Note that the cosine's ARGUMENT is unchanged: it is still 2x plus 1, because the outer derivative is evaluated at the inner output. Writing cosine of x there would be a different function entirely.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 252-253

9. Is the chain rule needed?

Sorting

Ask whether the inside is a bare x.

Sort into buckets

Sort each expression.

No chain rule
sin x; x^5
Chain rule needed
sin(3x); (x^2+1)^5; cos(x^3)
no
The input to the outer function is a bare x, so the inner derivative is 1 and contributes nothing.
yes
The input is something other than x, so its derivative is a genuine extra factor.

The question is always the same: what is the outer function being applied TO? If the answer is anything but x, the chain rule applies. Asking it aloud is more reliable than recognising shapes.

10. Worked example: verifying the rule by expanding

Worked example

Checkpoint 3.43. A case where both routes are available.

\[ \text{Differentiate } y = (2x+1)^2 \text{ two ways.} \]

Apply the chain rule

Why: Outer square, inner linear.

\[ 2(2 x + 1) (2) \]

Simplify

Why: Multiply out.

\[ 8 x + 4 \]

Now expand first

Why: Square the binomial.

\[ y = 4 x ^{2} + 4 x + 1 \]

Differentiate termwise

Why: Power rule.

\[ y' = 8 x + 4 \]

Compare

Why: Identical.

Figure (svg): A concrete check showing what happens when the inner derivative is forgotten

Expanding a square is the cheapest possible test of whether the chain rule was applied correctly.

\[ y' = 2(2x+1)(2) = 8x+4 \]

Verify: see what omitting the inner factor would have given

Why: Without the factor of 2 the answer would be 2 times 2x plus 1, which is 4x plus 2 — exactly half the correct value. The expansion route settles it beyond doubt, and the missing factor is precisely the inner function's derivative. This is the cheapest available test of the rule: whenever a chain rule answer feels uncertain and the inside is linear, expanding the square confirms or refutes it in two lines.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 253-253

11. Trap: forgetting the inner derivative

Trap

The trap

\[ y = \sin(2x+1) \]

Differentiate the outer and stop

Why: The student treats the inside as if it were x.

\[ y' = \cos(2x+1) \quad \text{(missing a factor of 2)} \]

The function oscillates twice as fast as sine, so its slopes must be twice as steep. A derivative with amplitude 1 cannot be right.

The fix

\[ y' = \cos(2x+1)\cdot 2 = 2\cos(2x+1) \]

Always multiply by the derivative of whatever is inside

Why: The rule has two factors, and the second is the one that gets dropped.

A reduction check makes the habit automatic: when the inside is a bare x its derivative is 1, so the extra factor changes nothing and the rule collapses to the ordinary one. Whenever the inside is anything else, that factor is doing real work.

12. Supply the missing factor

Fill the middle

The composition from the worked example, with the outer differentiated.

Fill in the blanks

\frac2___\left[\sin(2x+1)\right] = \cos(2x+1)\cdot___

Why: The inside is 2x plus 1, whose derivative is 2. That factor is what the chain rule adds, and dropping it halves the answer.

13. Why do the rates multiply?

Prediction

Commit before reasoning.

Predict first

If u changes 3 times as fast as x and y changes 5 times as fast as u, how fast does y change with x?

  • 8 times as fast, by adding
  • 15 times as fast, by multiplying
  • 5 times as fast, taking the outer rate only
  • It cannot be determined

Correct: Fifteen times as fast — the rates multiply.

\[ \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} = 5\cdot 3 = 15 \]

Why: Each unit of x produces 3 units of u, and each unit of u produces 5 units of y, so each unit of x produces 15 units of y. This is how ratios compose in any chain, from gear trains to unit conversions to exchange rates. Adding would be the wrong operation, and taking only the outer rate ignores the amplification the inner stage supplies — which is exactly the error of forgetting the inner derivative.

14. One of these claims is false

Two truths and a lie

All three are about the rule.

Eliminate the wrong options

Two of these are true. Knock those out and keep the false one.

  • A. The outer derivative is evaluated at the inner output
  • C. When the inside is a bare x, the rule reduces to the ordinary one
  • B. The chain rule adds the two derivatives

Survives elimination: B

Why: The survivor is the false one. The rates multiply, as the gear picture shows, and expanding the square of 2x plus 1 confirms it numerically: the answer is 8x plus 4, which is 2 times 2x plus 1 times 2, a product. Adding would give 2 times 2x plus 1 plus 2, which does not match.

15. The power form

Section

Section 2

16. Something raised to a power

Concept

The commonest case of the chain rule is a whole expression raised to a power. Apply the power rule to the outer power, leaving the inside untouched, then multiply by the inside's derivative.

the general power rule — For a differentiable function g and any real n, the derivative of g of x raised to the n is n times g of x to the n minus 1, multiplied by g prime of x.

\[ \frac{d}{dx}\Big[\big(g(x)\big)^{n}\Big] = n\big(g(x)\big)^{n-1}g'(x) \]

This single form covers a large fraction of the differentiation you will do, because roots and reciprocals are powers too. The square root of a polynomial and one over a polynomial are both instances.

Figure (svg): The power form of the chain rule, with the inner derivative highlighted

The reduction check is worth running: when the inside is just x, the extra factor is 1 and nothing changes.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 253-255 — the chain and power rule combined

17. Power rule, then the inside

Picture it

The form, with the extra factor marked.

Figure (svg): The power form of the chain rule, with the inner derivative highlighted

The reduction check is worth running: when the inside is just x, the extra factor is 1 and nothing changes.

The reduction check at the bottom is the one worth remembering: with a bare x inside, the extra factor is 1 and the rule collapses to the familiar power rule, which is exactly as it should be.

18. Worked example: a polynomial raised to a power

Worked example

Example 3.45. Power rule outside, derivative inside.

\[ \text{Differentiate } y = (3x^2 - 4x + 1)^{5}. \]

Apply the power rule to the outer power

Why: Exponent down, reduced by one, inside untouched.

\[ 5(3 x ^{2} - 4 x + 1) ^{4} \]

Differentiate the inside

Why: Termwise.

\[ 6 x - 4 \]

Multiply

Why: The chain rule.

\[ 5(3 x ^{2} - 4 x + 1) ^{4}(6 x - 4) \]

Tidy if useful

Why: A common factor of 2 in the last bracket.

\[ 10(3 x - 2) (3 x ^{2} - 4 x + 1) ^{4} \]

Figure (svg): The solution to Worked example a polynomial raised to a power shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ y' = 10(3x-2)(3x^2-4x+1)^{4} \]

Verify: check the degree

Why: The original has degree 10, since a quadratic to the fifth power is degree 10. Its derivative should have degree 9 — and the answer is a degree-8 factor times a degree-1 factor, giving 9 exactly. Had the inner derivative been forgotten, the answer would have degree 8, which the check catches immediately. Degree checking is the fastest sanity test available for these, and it detects the standard error without any recomputation.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 254-254

19. Apply the power form

Fill the middle

The quintic from the worked example, with the outer power differentiated.

Fill in the blanks

5(3x^2-4x+1)^(6x-4)\cdot___

Why: The inside's derivative is 6x minus 4. It multiplies the outer result rather than replacing the inside, which stays exactly as it was.

20. Worked example: a root and a reciprocal

Worked example

Checkpoint 3.45. Both are powers.

\[ \text{Differentiate } y = \sqrt{x^2 + 9} \text{ and } z = \frac{1}{(2x-5)^{3}}. \]

Rewrite the root as a power

Why: One half.

\[ (x ^{2} + 9) ^{\frac{1}{2}} \]

Apply the rule

Why: Half down, exponent to negative one half, times the inside's derivative.

\[ (\frac{1}{2}) (x ^{2} + 9) ^{-\frac{1}{2}}(2 x) \]

Simplify

Why: The 2s cancel.

\[ x / \sqrt{x ^{2} + 9} \]

Rewrite the reciprocal as a power

Why: Negative 3.

\[ (2 x - 5) ^{-3} \]

Apply the rule

Why: Negative 3 down, exponent to negative 4, times 2.

\[ -3(2 x - 5) ^{-4}(2) = -6 / (2 x - 5) ^{4} \]

Figure (svg): The solution to Worked example a root and a reciprocal shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ \frac{x}{\sqrt{x^2+9}}, \qquad \frac{-6}{(2x-5)^{4}} \]

Verify: check the signs and a value

Why: The first is positive for positive x and negative for negative x, matching a curve that falls to a minimum at the origin and rises after — which the square root of x squared plus 9 does. The second is negative everywhere, matching a function that decreases on each branch. At x equal to 0 the first gives 0, confirming the minimum. Rewriting as powers first is what let a single rule handle both, and it is always the right opening move.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 255-255

21. Find the error: the inner derivative applied to the wrong place

Error analysis

A student differentiates a power of a polynomial.

Annotate

On: \( \frac{d}{dx}\left[(x^{2}+1)^{5}\right] = 5(2x)^{4} \)

  • The exponent has correctly come down and been reduced by one.
  • But the inside was differentiated INSIDE the bracket rather than multiplied outside.
  • The rule leaves the inside untouched in the power and multiplies by its derivative separately.
  • The correct derivative is 5(x^2+1)^4 times 2x, which is 10x(x^2+1)^4.

The outer function's input never changes. Differentiating inside the bracket produces a completely different function, and the degree check exposes it: the correct answer has degree 9 and the student's has degree 4.

22. Expression to derivative

Matching

Rewrite as a power, then apply the rule.

Match the pairs

  • l1. (2x+1)^2
  • l2. sqrt(x^2+9)
  • l3. 1/(2x-5)^3
  • l4. (x^2+1)^5
  • r1. 4(2x+1)
  • r2. x/sqrt(x^2+9)
  • r3. -6/(2x-5)^4
  • r4. 10x(x^2+1)^4

Why: Every one needed the inside rewritten or differentiated as a separate factor. The middle two show why rewriting as a power first matters: neither a root nor a fraction looks like a power until it is written as one.

23. One of these claims is false

Two truths and a lie

All three are about the power form.

Eliminate the wrong options

Two of these are true. Knock those out and keep the false one.

  • A. The inside is left untouched in the power and differentiated separately
  • C. Roots and reciprocals are covered by the same form
  • B. Differentiating inside the bracket gives the same answer

Survives elimination: B

Why: The survivor is the false one. Differentiating x squared plus 1 inside the fifth power gives 5 times 2x to the fourth, a degree-4 expression, while the correct answer has degree 9. The two are not the same function and not even the same size. The outer function's input is never altered by the rule.

24. What does the degree check catch?

Prediction

Commit before reasoning.

Predict first

A quadratic raised to the fifth power has degree 10. What degree should its derivative have?

  • 10, since differentiating does not change degree
  • 9, and an answer of degree 8 means the inner derivative was dropped
  • 5
  • 8

Correct: Nine — and degree 8 means the inner factor was forgotten.

\[ 5(3x^2-4x+1)^{4}(6x-4): \quad 8 + 1 = 9 \;\checkmark \]

Why: Differentiation lowers a polynomial's degree by exactly one, so the derivative must have degree 9. The correct answer is a degree-8 factor times a degree-1 factor. Omitting the inner derivative leaves only the degree-8 part, which the check detects instantly. This makes the degree a reliable automatic test for the section's characteristic error, and it costs nothing to run.

25. Chains of three or more

Section

Section 3

26. One factor per layer, peeled from the outside

Concept

A composition of three functions has three layers and its derivative has three factors. Differentiate the outermost, then the next, then the innermost, multiplying as you go.

nested composition — A function built by applying three or more functions in succession. Its derivative is the product of each layer's derivative, each evaluated at the output of the layers inside it.

\[ \frac{d}{dx}\Big[f\big(g(h(x))\big)\Big] = f'\big(g(h(x))\big)\,g'\big(h(x)\big)\,h'(x) \]

The bookkeeping is what makes these look hard. Writing the layers down as a list before differentiating anything turns a daunting expression into three routine steps.

Figure (svg): A chain of three functions, with one factor contributed by each layer

Each layer contributes exactly one factor, and the peeling order is outside first.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 255-257 — composition of three or more functions

27. Three layers, three factors

Picture it

The cube of the sine of a linear function.

Figure (svg): A chain of three functions, with one factor contributed by each layer

Each layer contributes exactly one factor, and the peeling order is outside first.

Each row contributes exactly one factor, and the order of peeling is outside in. Listing the layers first is the whole technique, and it scales to any depth.

28. Worked example: a three-layer chain

Worked example

Example 3.48. List the layers, then peel.

\[ \text{Differentiate } y = \sin^{3}(2x+1). \]

List the layers from the outside

Why: Cube, then sine, then linear.

\[ \text{cube } / \sin e / 2 x + 1 \]

Differentiate the outermost

Why: Power rule on the cube, inside untouched.

\[ 3 \sin ^{2}(2 x + 1) \]

Multiply by the next layer's derivative

Why: The derivative of sine, at the innermost input.

\[ \times \cos(2 x + 1) \]

Multiply by the innermost derivative

Why: The derivative of 2x+1.

\[ \times 2 \]

Collect

Why: Three factors.

\[ 6 \sin ^{2}(2 x + 1) \cos(2 x + 1) \]

Figure (svg): A chain of three functions, with one factor contributed by each layer

Each layer contributes exactly one factor, and the peeling order is outside first.

\[ y' = 6\sin^{2}(2x+1)\cos(2x+1) \]

Verify: check the argument of every factor and a value

Why: Both trigonometric factors have argument 2x plus 1, not x — each layer's derivative is evaluated at whatever is inside it, and that never becomes a bare x until the innermost layer. At x equal to negative one half the inside is 0, so the sine factor is 0 and the derivative vanishes: the function has a horizontal tangent there, which it must, since sine cubed is at its minimum of 0. Checking one such landmark confirms the whole expression.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 256-256

29. Order the peeling

Ranking

Differentiating a three-layer composition.

Put in order

  1. Write the layers as a list, outermost first
  2. Differentiate the outermost, leaving its input untouched
  3. Multiply by the next layer's derivative, at its own input
  4. Multiply by the innermost derivative
  5. Collect the constants and check every argument

Why: Step a is what makes the rest mechanical, and skipping it is why these look hard. Step e's argument check catches the characteristic error of letting an inner expression collapse to a bare x too early.

30. Worked example: a root of a trigonometric function

Worked example

Checkpoint 3.48. Three layers again, differently arranged.

\[ \text{Differentiate } y = \sqrt{\cos(3x)}. \]

List the layers

Why: Root, cosine, linear.

\[ \text{power } \frac{1}{2} /\text{ cosine } / 3 x \]

Differentiate the outermost

Why: Power rule with exponent one half.

\[ (\frac{1}{2}) (\cos 3 x) ^{-\frac{1}{2}} \]

Multiply by the cosine's derivative

Why: Minus sine, at the same argument.

\[ \times(-\sin 3 x) \]

Multiply by the innermost derivative

Why: Three.

\[ \times 3 \]

Collect

Why: Combine the constants.

\[ -3 \sin(3 x) / (2 \sqrt{\cos 3 x}) \]

Figure (svg): The solution to Worked example a root of a trigonometric function shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ y' = \frac{-3\sin(3x)}{2\sqrt{\cos(3x)}} \]

Verify: check the sign and the domain

Why: For small positive x the cosine is decreasing, so its square root is too, and the derivative is negative — which it is, since sine of 3x is positive there. The domain also matters: the expression requires cosine of 3x to be strictly positive, so the derivative exists only where the original is defined AND non-zero. Where cosine of 3x hits zero the square root has a vertical tangent, which the vanishing denominator correctly signals.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 257-257

31. Trap: evaluating an inner derivative at x

Trap

The trap

\[ y = \sin^{3}(2x+1) \]

Write the middle factor as cosine of x

Why: The student forgets that each layer keeps its own input.

\[ y' = 3\sin^{2}(2x+1)\cos(x)\cdot 2 \quad \text{(wrong argument)} \]

The sine layer receives 2x plus 1, so its derivative is the cosine of 2x plus 1. Nothing becomes a bare x until the innermost layer.

The fix

\[ y' = 3\sin^{2}(2x+1)\cdot\cos(2x+1)\cdot 2 \]

Every layer's derivative is evaluated at that layer's own input

Why: Only the innermost function receives x itself.

A quick structural check: every factor except the last should still contain the inner expression. If a bare x appears anywhere but the final factor, a layer's argument has been lost. Writing the layers as a list before differentiating makes this almost impossible to get wrong.

32. Supply the middle factor

Fill the middle

The three-layer composition from the worked example, with the outer and inner factors in place.

Fill in the blanks

y' = 3\sin^\cos(2x+1)(2x+1)\cdot___\cdot 2

Why: The sine layer receives 2x plus 1, so its derivative is the cosine of 2x plus 1. Writing cosine of x would evaluate that layer at the wrong input.

33. How many layers?

Sorting

Count the functions applied in succession.

Sort into buckets

Sort each expression.

Two layers
sin(2x); (x^2+1)^5; cos(x^2)
Three layers
sin^3(2x+1); sqrt(cos 3x)
two
One outer function applied to one inner expression, so the derivative has two factors.
three
Three functions in succession, so the derivative has three factors and each argument must be tracked.

The number of layers is exactly the number of factors in the answer, which is a useful check: a three-layer expression whose derivative has two factors is missing one.

34. How deep can a chain go?

Prediction

Commit before reasoning.

Predict first

A composition of five functions gives a derivative with how many factors?

  • Two
  • Five, one per layer
  • Ten
  • It cannot be differentiated

Correct: Five — one factor per layer.

\[ (f\circ g\circ h\circ k\circ m)' = f'\,g'\,h'\,k'\,m' \quad \text{(each at its own input)} \]

Why: The rule applies repeatedly, contributing one factor for each function in the chain, each evaluated at the output of everything inside it. There is no limit to the depth, and the bookkeeping is the only difficulty — which is why listing the layers before starting matters more as the chain lengthens. The count also gives a free check: five layers must produce five factors.

35. Combining with the other rules

Section

Section 4

36. Decide what the whole thing is first

Concept

When an expression is a product or quotient whose parts need the chain rule, apply the outer structural rule first and use the chain rule on each part as it arises.

combined rules — Differentiation of an expression requiring several rules proceeds from the outermost structure inward, with the chain rule applied wherever a function's input is not a bare variable.

\[ \frac{d}{dx}\left[x^{2}\sin(3x)\right] = 2x\sin(3x) + x^{2}\cdot 3\cos(3x) \]

The decision is the same one as Section 3.3: what is the whole expression? A product needs the product rule outermost, and the chain rule then appears inside one or both of its terms.

Figure (svg): A decision guide for recognising when the chain rule is needed

One question decides it every time, and asking it aloud is faster than pattern-matching.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 257-258 — combining the chain rule with other rules

37. One question, every time

Picture it

Whether the chain rule is needed, decided by inspection.

Figure (svg): A decision guide for recognising when the chain rule is needed

One question decides it every time, and asking it aloud is faster than pattern-matching.

The question is always what the outer function is applied to. Asking it explicitly, rather than recognising shapes, is what makes the decision reliable on an unfamiliar expression.

38. Worked example: a product needing the chain rule

Worked example

Example 3.50. Product rule outermost.

\[ \text{Differentiate } y = x^{2}\sin(3x). \]

Identify the outermost structure

Why: The whole thing is a product.

Differentiate the first factor

Why: Power rule.

\[ 2 x \]

Differentiate the second factor with the chain rule

Why: Cosine at the same argument, times 3.

\[ 3 \cos(3 x) \]

Assemble with the product rule

Why: First derivative times second, plus first times second derivative.

\[ 2 x \sin(3 x) + x ^{2}(3 \cos 3 x) \]

Tidy

Why: Collect.

\[ 2 x \sin(3 x) + 3 x ^{2} \cos(3 x) \]

Figure (svg): The solution to Worked example a product needing the chain rule shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ y' = 2x\sin(3x) + 3x^{2}\cos(3x) \]

Verify: check at a convenient input

Why: At x equal to 0 the formula gives 0 plus 0, which is 0 — and the function x squared times sine of 3x is 0 at the origin and tangent to the axis there, so a zero derivative is right. A numerical difference quotient near 0 confirms it. Note the factor of 3 appearing only in the second term: it came from the chain rule inside that term, and forgetting it would leave an answer that fails a numerical check at, say, x equal to 0.5.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 257-258

39. Which rule is outermost?

Sorting

Ask what the whole expression is.

Sort into buckets

Sort each expression.

Product rule
x^2 sin(3x); sqrt(x) cos(x^2)
Quotient rule
cos(2x)/x
Chain rule
sin^3(2x+1)
Sum rule
(x^2+1)^5 + cos(3x)
prod
The whole expression is two things multiplied, so the product rule applies first and the chain rule appears inside a factor.
quot
The whole expression is a division, so the quotient rule is outermost.
chain
The whole expression is one function applied to another, with no arithmetic at the top level.
sum
The whole expression is a sum, so each term is differentiated separately - and each term happens to need the chain rule.

In four of the five the chain rule appears somewhere, but it is outermost in only one. Identifying the top-level structure first is what keeps the rules from being applied at the wrong level.

40. Worked example: a quotient with a chain inside

Worked example

Checkpoint 3.50. Quotient outermost, chain within.

\[ \text{Differentiate } y = \frac{\cos(2x)}{x}. \]

Identify the outermost structure

Why: A quotient.

Differentiate the top with the chain rule

Why: Minus sine, at the same argument, times 2.

\[ -2 \sin(2 x) \]

Differentiate the bottom

Why: The identity.

\[ 1 \]

Apply the quotient rule

Why: Bottom times top prime, minus top times bottom prime.

\[ (-2 x \sin(2 x) - \cos(2 x)) / x ^{2} \]

State

Why: Over the bottom squared.

\[ y' = -(2 x \sin 2 x + \cos 2 x) / x ^{2} \]

Figure (svg): The solution to Worked example a quotient with a chain inside shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ y' = -\frac{2x\sin(2x) + \cos(2x)}{x^{2}} \]

Verify: check a value numerically

Why: At x equal to 1 the formula gives negative 2 sine 2 minus cosine 2, all over 1 — that is negative 1.819 plus 0.416, or about negative 1.403. A numerical difference quotient of cosine 2x over x near x equal to 1 gives about negative 1.403 as well. The chain rule contributed the factor of 2 in the first term of the numerator, and the quotient rule's order produced the overall minus — two rules, each doing its own job at its own level.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 258-258

41. Find the error: the chain rule applied at the wrong level

Error analysis

A student differentiates a product whose second factor is a composition.

Annotate

On: \( \frac{d}{dx}\left[x^{2}\sin(3x)\right] = 3\left(2x\sin(3x) + x^{2}\cos(3x)\right) \)

  • The product rule has been applied correctly to the two factors.
  • But the chain rule's factor of 3 was applied to the WHOLE expression.
  • It belongs only to the term where the composition was differentiated - the second one.
  • The correct answer is 2x sin(3x) + 3x^2 cos(3x), with the 3 attached to one term only.

Each rule operates at its own level. The chain rule's extra factor belongs to the specific derivative it came from, not to the whole assembled expression — and a numerical check at any input other than 0 exposes the difference.

42. Attach the factor to the right term

Fill the middle

The product from the worked example, differentiated.

Fill in the blanks

y' = 2x\sin(3x) + 3x^___\cos(3x)

Why: The 3 belongs only to the second term, where the composition was differentiated. Applying it to the whole expression would scale the first term as well, which a numerical check refutes.

43. One of these claims is false

Two truths and a lie

All three are about combining rules.

Eliminate the wrong options

Two of these are true. Knock those out and keep the false one.

  • A. The outermost structure decides which rule to apply first
  • C. The chain rule's extra factor belongs only to the term it came from
  • B. The chain rule is always applied last

Survives elimination: B

Why: The survivor is the false one. The chain rule may be outermost, as in sine cubed of 2x plus 1, or it may appear inside a product or quotient, or in several terms of a sum. Where it applies is determined entirely by where a function receives an input other than a bare variable — which can be at any level of the expression.

44. How do you decide the order?

Prediction

Commit before reasoning.

Predict first

For an unfamiliar expression, what determines which rule to apply first?

  • The most complicated-looking part
  • The outermost structure: what operation combines the largest pieces
  • Always the chain rule
  • Whichever gives the shortest answer

Correct: The outermost structure — what operation combines the largest pieces.

\[ x^{2}\sin(3x): \; \text{a product first, with a chain inside its second factor} \]

Why: Ask what the whole expression is before looking at any part of it. If it is two things multiplied, the product rule is outermost regardless of how complicated either factor is; if it is one function applied to another, the chain rule is. Working from the outside in means each rule reduces the problem to smaller ones handled the same way, and it is the same discipline Section 3.3 established for products inside quotients.

45. Leibniz notation and the proof

Section

Section 5

46. Designed to look like cancellation, and it is a theorem

Concept

In Leibniz notation the chain rule reads dy by dx equals dy by du times du by dx, in which the du's appear to cancel. The appearance is deliberate and the statement is true, but it is proved rather than granted by the notation.

the Leibniz form — The chain rule written as a product of two derivative symbols sharing an intermediate variable. Leibniz designed the notation so the rule would look like cancelling a common factor, which is a genuine aid to memory and not a proof.

\[ \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} \]

The proof multiplies and divides the difference quotient by the change in u, which is the honest version of the cancellation — and it needs care when that change is zero, which is exactly where the naive argument fails.

Figure (svg): The Leibniz form of the chain rule, showing why it looks like cancellation

Leibniz chose the notation so the rule would look obvious, which is a genuine aid and a standing trap.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 251-253 — the chain rule in Leibniz notation and its proof

47. A cancellation that is not one

Picture it

The Leibniz form and the warning that goes with it.

Figure (svg): The Leibniz form of the chain rule, showing why it looks like cancellation

Leibniz chose the notation so the rule would look obvious, which is a genuine aid and a standing trap.

The symbol dy by du is a single unit of notation, so there is no du to cancel. That the rule nonetheless behaves this way is a theorem, and it is why Leibniz notation is worth the confusion it can cause.

48. Worked example: using the Leibniz form

Worked example

Introduce the intermediate variable explicitly.

\[ \text{Find } \frac{dy}{dx} \text{ for } y = u^{5} \text{ where } u = 3x^{2}+1. \]

Differentiate y with respect to u

Why: Power rule.

\[ \,dy / \,du = 5 u ^{4} \]

Differentiate u with respect to x

Why: Termwise.

\[ \,du / \,dx = 6 x \]

Multiply

Why: The Leibniz form.

\[ \,dy / \,dx = 5 u ^{4}(6 x) \]

Substitute back for u

Why: So the answer is in terms of x alone.

\[ 30 x(3 x ^{2} + 1) ^{4} \]

Figure (svg): The solution to Worked example using the Leibniz form shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ \frac{dy}{dx} = 30x(3x^{2}+1)^{4} \]

Verify: check the degree and confirm the substitution was made

Why: The original is degree 10, so the derivative should be degree 9 — and a degree-1 factor times a degree-8 factor gives exactly that. The substitution back is essential: leaving the answer as 30x u to the fourth is incomplete, since u is not a variable the question asked about. Introducing u explicitly is what makes a complicated composition feel routine, and it is the main practical value of the Leibniz form.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 251-252

49. Use the Leibniz form

Fill the middle

The composition from the worked example, with both derivatives computed.

Fill in the blanks

\frac30___ = 5u^___\cdot 6x \;\text___ u = 3x^___+1 \;\Longrightarrow\; ___x(3x^___+1)^___

Why: Multiplying the two derivatives gives 30x times u to the fourth, and substituting back for u completes the answer. Leaving u in the answer would be incomplete.

50. Worked example: the idea of the proof

Worked example

Multiply and divide by the change in u.

\[ \text{Sketch the proof that } (f\circ g)' = f'(g(x))g'(x). \]

Write the difference quotient

Why: For the composite.

\[ \frac{f(g(x + h)) - f(g(x))}{h} \]

Multiply and divide by the change in the inner function

Why: The honest version of cancelling.

\[ \times(g(x + h) - g(x)) / (g(x + h) - g(x)) \]

Regroup into two quotients

Why: One for each layer.

\[ [f(...) - f(...)] / [g(x + h) - g(x)] \times [g(x + h) - g(x)] / h \]

Take limits

Why: The second is g prime; the first becomes f prime at g of x.

\[ f'(g(x)) g'(x) \]

Note the gap

Why: The step fails if the inner change is ever zero.

Figure (svg): The solution to Worked example the idea of the proof shown as a ladder of expressions, one row per legal move

The whole solution at once: each drop is one legal move.

\[ (f\circ g)'(x) = f'(g(x))\,g'(x) \]

Verify: identify why the sketch is not yet a proof

Why: Step two divides by the change in g, which can be zero for values of h arbitrarily close to zero — for instance if g is constant on a sequence of intervals. A full proof handles that case separately, and OpenStax does so. The sketch is the right idea and the right computation, and the gap is worth knowing about: it is precisely the point at which the naive cancellation argument would silently fail.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 252-253

51. Trap: treating the Leibniz form as literal cancellation

Trap

The trap

\[ \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} \]

Conclude that the du's cancel as algebraic factors

Why: The student treats each symbol as a genuine fraction.

\[ \text{so the rule needs no proof} \quad \text{(wrong reasoning)} \]

The symbol dy by du is a single unit of notation denoting a limit. There is no quantity du sitting in it to be cancelled.

The fix

\[ \text{the rule is a theorem, proved by multiplying and dividing by } \Delta u \]

Read the resemblance as a designed mnemonic

Why: Leibniz shaped the notation to match the theorem, not the other way round.

The distinction has teeth. The proof's division by the change in u genuinely can fail when that change is zero, which the notation gives no hint of at all. The same caution applies in Section 5.5, where substitution manipulates dx and dy in a way that looks algebraic and is justified by this rule.

52. Notation to meaning

Matching

Each symbol names one layer's rate.

Match the pairs

  • l1. dy/du
  • l2. du/dx
  • l3. dy/dx
  • l4. the product of the first two
  • r1. how fast y changes per unit of u
  • r2. how fast u changes per unit of x
  • r3. how fast y changes per unit of x
  • r4. equals the third, by the chain rule

Why: Read as rates, the rule is the gear statement of the first idea: each stage's amplification multiplies the previous one's. The notation's resemblance to cancellation is a mnemonic for a fact that the rates themselves make natural.

53. One of these claims is false

Two truths and a lie

All three are about the Leibniz form.

Eliminate the wrong options

Two of these are true. Knock those out and keep the false one.

  • A. The notation was designed so the rule would look like cancellation
  • C. The proof multiplies and divides by the change in the inner function
  • B. Because the du's cancel, the chain rule needs no proof

Survives elimination: B

Why: The survivor is the false one. The symbol is a single unit denoting a limit, with no du inside it to cancel, so the appearance proves nothing. The actual proof divides by a quantity that can be zero, which is a real difficulty the notation conceals entirely — and that gap is exactly why a theorem is needed rather than an observation about symbols.

54. Where does the proof need care?

Prediction

Commit before reasoning.

Predict first

The proof multiplies and divides by the change in the inner function. What can go wrong?

  • Nothing; the step is always valid
  • That change can be zero for values of h arbitrarily close to zero, so the division is not always legal
  • The limit might not exist
  • The inner function might not be continuous

Correct: The inner change can be zero arbitrarily near h equal to zero, so the division is not always legal.

\[ g(x+h) - g(x) = 0 \text{ for arbitrarily small } h \;\Longrightarrow\; \text{the division fails} \]

Why: If the inner function takes the same value at x plus h as at x — which can happen for infinitely many h approaching zero — the denominator vanishes and the regrouping is invalid. A complete proof treats that case separately. The inner function's continuity is guaranteed by its differentiability, so that is not the issue. This is precisely the difficulty the cancellation-looking notation hides, and it is why the rule is a theorem with a real proof rather than a notational observation.

55. The four structural rules

Comparison

Fill the blanks. With the chain rule the set is complete.

Comparison matrix

StructureRuleRecognise it by
A sumdifferentiate termwiseterms joined by plus or minus
A productf'g + fg'two things multiplied
A quotient(f'g - fg')/g^2one thing divided by another
A compositionf'(g(x)) g'(x)a function applied to something other than a bare x

The last row's recognition test is the one to internalise. Ask what the outer function is being applied to, and if the answer is anything but x, the chain rule is needed.

56. The procedure, in order

Pattern

Given any expression built from the standard functions.

  1. Identify the outermost structure: a sum, a product, a quotient, or a composition.
  2. If it is a composition, list the layers from the outside in before differentiating anything.
  3. Apply the matching rule, and for each layer differentiate it at its own input, never at a bare x.
  4. Multiply in each layer's inner derivative, attaching the factor to the term it came from rather than to the whole expression.
  5. Check the degree for polynomials, the arguments of every trigonometric factor, and one numerical value.

Step four is where the section's two characteristic errors live: the dropped inner factor, and the factor applied at the wrong level. Both are caught by the checks in step five.

Stewart, Calculus: Early Transcendentals 8e, §3.4 The Chain Rule §3.4, pp. 197-207

57. Check yourself 1 of 3

Check

The basic rule. Do not drop the inner factor.

Check your understanding

Differentiate sin(2x + 1).

  • A. 2 cos(2x + 1) (correct)
  • B. cos(2x + 1)
  • C. 2 cos x
  • D. cos(2)

Answer: A

Why: The outer derivative is cosine at the same argument; the inner derivative is 2.

Why B tempts people
The inner derivative was dropped. The function oscillates twice as fast as sine, so its slopes must be twice as steep.
Why C tempts people
The argument was changed to a bare x. The outer derivative is evaluated at the inner OUTPUT, which is still 2x + 1.
Why D tempts people
The inner function was substituted into the cosine rather than differentiated.

58. Check yourself 2 of 3

Check

The power form. Leave the inside untouched.

Check your understanding

Differentiate (x^2 + 1)^5.

  • A. 10x(x^2+1)^4 (correct)
  • B. 5(x^2+1)^4
  • C. 5(2x)^4
  • D. 10x(x^2+1)^5

Answer: A

Why: The power rule gives 5(x^2+1)^4, and multiplying by the inner derivative 2x gives 10x(x^2+1)^4.

Why B tempts people
The inner derivative was dropped. A degree check catches it: this has degree 8 and the answer should have degree 9.
Why C tempts people
The inside was differentiated within the bracket rather than multiplied outside, giving a degree-4 expression.
Why D tempts people
The exponent was not reduced. Differentiating must lower the outer power by one.

59. Check yourself 3 of 3

Check

Combining rules. Attach the factor to the right term.

Check your understanding

Differentiate x^2 sin(3x).

  • A. 2x sin(3x) + 3x^2 cos(3x) (correct)
  • B. 2x sin(3x) + x^2 cos(3x)
  • C. 3(2x sin(3x) + x^2 cos(3x))
  • D. 6x cos(3x)

Answer: A

Why: The product rule gives two terms, and the chain rule's factor of 3 belongs only to the second.

Why B tempts people
The chain rule factor of 3 was omitted from the second term.
Why C tempts people
The factor of 3 was applied to the whole expression rather than to the term it came from.
Why D tempts people
The product rule was replaced by multiplying the two derivatives, which is not a rule.

60. Where this shows up outside the textbook

Real world

A spherical balloon is being inflated. Its radius r is growing at 2 centimetres per second, and its volume is four thirds pi times the cube of the radius.

Discussion prompt

Find the rate at which the volume is growing when the radius is 5 centimetres, and explain which part of the calculation is the chain rule.

Hint: Volume depends on radius, and radius depends on time — two links in a chain.

Answer:

Volume depends on the radius, and the radius depends on time. That is a composition, and the chain rule is what links the two rates:

\[ \frac{dV}{dt} = \frac{dV}{dr}\cdot\frac{dr}{dt} \]

\[ V = \tfrac{4}{3}\pi r^{3} \;\Longrightarrow\; \frac{dV}{dr} = 4\pi r^{2} \]

At a radius of 5 centimetres, with the radius growing at 2 centimetres per second:

\[ \frac{dV}{dt} = 4\pi(25)\cdot 2 = 200\pi \approx 628 \text{ cm}^{3}\text{/s} \]

The chain rule is the multiplication itself. The volume's sensitivity to the radius is 4 pi r squared — which is, satisfyingly, the sphere's surface area, since growing the radius adds a thin shell over the whole surface. Multiplying by how fast the radius grows converts that sensitivity into a rate per second.

Note what the answer depends on: the volume grows faster and faster as the balloon inflates, even at a constant radius growth, because the surface being coated is larger. At a radius of 10 the same 2 centimetres per second would give four times the volume rate. This kind of two-link rate problem is the whole subject of Section 4.1.

61. How sure are you?

Commit first

Answer, then rate your confidence honestly.

Predict first

What is the derivative of (2x + 1)^2?

  • 2(2x + 1)
  • 4(2x + 1), which equals 8x + 4
  • 4x + 2
  • 2

Correct: Four times 2x plus 1, which is 8x plus 4.

\[ (2x+1)^2 = 4x^2+4x+1 \;\Longrightarrow\; 8x+4 = 4(2x+1) \;\checkmark \]

Why: The power rule gives 2 times 2x plus 1, and the chain rule multiplies by the inner derivative 2, giving 4 times 2x plus 1. Expanding first settles it beyond doubt: the square is 4x squared plus 4x plus 1, whose derivative is 8x plus 4 — exactly matching. The first option omits the inner factor and gives half the correct value, which is the section's characteristic error. Expanding a square is the cheapest available test whenever a chain rule answer is uncertain.

62. Explain it to someone a year behind you

Explain it

They differentiated the square of 2x plus 1 as 2 times 2x plus 1 and cannot see what is missing.

Discussion prompt

In four sentences or fewer, show them the missing factor without quoting the rule.

Hint: Have them expand first.

Answer:

Ask them to expand the square before differentiating: 4x squared plus 4x plus 1, whose derivative is 8x plus 4. Now ask them to expand their own answer, 2 times 2x plus 1, which is 4x plus 2 — exactly half.

The missing factor of 2 is the derivative of what is inside the bracket. The reason is that the inside changes twice as fast as x does, so every slope is doubled — and if the inside had been a bare x, its derivative would be 1 and nothing would have been missing at all.

63. Exit ticket

Exit ticket

Name the weakest spot before you close the deck.

Predict first

Which of these would you least want handed to you cold?

  • Remembering to multiply by the inner derivative
  • Keeping each layer's argument right in a long chain
  • Deciding whether the chain rule is needed at all
  • Combining the chain rule with a product or quotient

Correct: Whichever you picked is tonight's ten minutes, and each has a one-line fix.

Why: For the inner factor, run a degree check on polynomials or expand a square when the inside is linear. For arguments, list the layers before differentiating and confirm no bare x appears except in the final factor. For deciding, ask aloud what the outer function is applied to. For combining, name the outermost structure before touching anything, and attach each chain factor to the term it came from. Do five of your chosen kind rather than twenty mixed ones.

64. Draw the lesson on one page

Connect it up

Paper. Fifteen minutes.

Draw it

At the top, draw two machines in series with an arrow through them, labelling the input, the intermediate output and the final output, and write the rule beneath with the outer derivative's argument circled. Beside it draw a gear pair with ratios 3 and 5 and write why the overall ratio is 15. In the middle of the page, differentiate four things in full: the sine of 2x plus 1, the fifth power of 3x squared minus 4x plus 1, the square root of x squared plus 9, and the cube of the sine of 2x plus 1 with its three layers listed first. Beside the second, run a degree check and note what degree the answer would have had if the inner factor were dropped. In the lower half, take x squared times the sine of 3x and differentiate it, marking clearly which term the factor of 3 belongs to and why. At the bottom, write the Leibniz form, and beside it one sentence saying why the du's do not literally cancel and where the proof needs care. In a margin, write the one question that decides whether the chain rule is needed.

If any of your answers contains a bare x inside a trigonometric function where the original had 2x plus 1, a layer's argument has been lost — every factor except the innermost should still carry the inner expression.

65. What you can do now

Recap

Five things, and with them the structural rules are complete.

If you seeThen
An outer function applied to something other than xThe chain rule is needed
An expression raised to a powerPower rule, inside untouched, times the inside's derivative
A root or reciprocal of an expressionRewrite as a power first
Three functions in successionThree factors, listed outside in
A product with a composition insideProduct rule outermost, chain within a term
A polynomial answer of the wrong degreeThe inner derivative was probably dropped
dy/dx = (dy/du)(du/dx)A theorem, not a cancellation

Section 3.7 uses the chain rule immediately: differentiating an inverse function comes from applying the rule to the equation saying the two functions undo each other, and it delivers the derivatives of the inverse trigonometric functions.

OpenStax Calculus Volume 1, §3.6 The Chain Rule §3.6, pp. 250-258 — everything on these slides traces back here

Sources

  1. OpenStax Calculus Volume 1, §3.6 The Chain Rule — Strang & Herman, OpenStax / Rice University, CC BY-NC-SA 4.0, pp. 250-258
  2. Stewart, Calculus: Early Transcendentals 8e, §3.4 The Chain Rule — James Stewart, Cengage Learning, 2016, pp. 197-207

Want this taught 1-on-1? Alexander tutors Calculus I — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108