Differentiation: Chapter 05

The Chain Rule

How to differentiate a function inside another function: the single most useful technique in all of calculus. Plain English, full proof, and 12 escalating exercises.

✦ What a Composite Function Is ✦ The Inside/Outside Method ✦ Full Proof ✦ Leibniz Notation ✦ 12 Worked Exercises ✦ 10-Question Quiz
Share this page

§ 01What Is a Composite Function?

Before you can apply the chain rule, you need to recognise when you have a composite function. That is the only real skill this page teaches, everything else follows automatically.

A composite function is simply a function inside another function. When you see sin(x²), the x² is sitting inside the sine. When you see e^(3x), the 3x is sitting inside the exponential. The chain rule is the rule for differentiating exactly these situations.

The crucial thing to get comfortable with is identifying the two layers:

Identifying the layers — outer and inner
sin(x²)   outer: sin(□)   inner: x²
e^(3x)    outer: e^(□)    inner: 3x
(x²+1)⁵   outer: (□)⁵    inner: x²+1
ln(cos x)  outer: ln(□)    inner: cos x
√(2x+3)   outer: √(□)    inner: 2x+3

If you can write a function as f(g(x)), something applied to something else, it is composite and needs the chain rule.

Product vs composite — how to tell the difference sin(x²) is composite — x² is inside sine. But x² · sin x is a product — two functions sitting side by side, multiplied. Products need the product rule. Composites need the chain rule. This distinction matters and will come up in every exercise below.

§ 02The Formula — and Why It Works

The chain rule has two equivalent forms. Both say the same thing; which one you use depends on what feels natural. We derive both from scratch.

Form 1 — Function notation (f and g)

If y = f(g(x)), then:

Chain Rule — Function Notation
dy/dx = f′(g(x)) · g′(x)

In plain English: differentiate the outer function (leaving the inner unchanged), then multiply by the derivative of the inner function.

Form 2 — Leibniz notation (u substitution)

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

Chain Rule — Leibniz Notation
dy/dx = dy/du · du/dx

This form looks like a fraction cancelling, the du's appear to cancel. That is not a rigorous justification, but it is a useful memory aid. The Leibniz form is particularly helpful in longer problems where you want to track each step explicitly.

Why it works — an intuitive argument

Suppose x changes by a tiny amount Δx. This causes u = g(x) to change by roughly Δu ≈ (du/dx)·Δx. That change in u then causes y = f(u) to change by roughly Δy ≈ (dy/du)·Δu. Substituting:

Informal derivation of the chain rule

A small change in x causes a change in u:

Δu ≈ (du/dx) · Δx

That change in u causes a change in y:

Δy ≈ (dy/du) · Δu

Substitute the first into the second:

Δy ≈ (dy/du) · (du/dx) · Δx

Divide both sides by Δx and take the limit as Δx → 0:

dy/dx = dy/du · du/dx The formal proof uses limits carefully to handle the case du = 0, but this argument shows exactly why the chain rule has the structure it does. The rates of change chain together — hence the name.

§ 03The Inside/Outside Method — 3 Steps

For most chain rule problems you can work quickly with three mental steps. You do not need to introduce u formally unless the problem is complex.

Step 01
Identify outer and inner

Ask: what is the last operation applied? That is the outer function. What is inside it? That is the inner function.

Step 02
Differentiate the outer

Apply the usual rule to the outer function, but leave the inner function completely untouched inside.

Step 03
Multiply by the inner derivative

Differentiate the inner function on its own, then multiply the whole thing by it.

Three quick examples

Example 1 — (3x + 2)⁴
Outer: (□)⁴   →   derivative: 4(□)³
Inner: 3x + 2   →   derivative: 3
Result: 4(3x+2)³ · 3 = 12(3x+2)³
Example 2 — sin(5x)
Outer: sin(□)   →   derivative: cos(□)
Inner: 5x   →   derivative: 5
Result: cos(5x) · 5 = 5 cos(5x)
Example 3 — e^(x²)
Outer: e^(□)   →   derivative: e^(□)
Inner: x²   →   derivative: 2x
Result: e^(x²) · 2x = 2x·e^(x²)

§ 04All the Notation Forms You Will Encounter

Different textbooks write the chain rule in different ways. They all mean exactly the same thing. This table shows every form so nothing surprises you in an exam.

FormWhat it saysWhen to use it
dy/dx = dy/du · du/dx Leibniz chain — rates multiply Long problems; makes each step visible
d/dx[f(g(x))] = f′(g(x))·g′(x) Function notation — outer prime at inner, times inner prime Quick work; most common in proofs
y′ = f′(u)·u′ Prime notation with u substitution Compact; common in textbooks
[outer deriv, inner untouched] × [inner deriv] The inside/outside method in words Mental arithmetic on simple forms

Using u-substitution explicitly

For harder problems it helps to introduce u formally. Write u = inner function, express y in terms of u, find dy/du and du/dx separately, then multiply. This avoids errors in complex cases.

u-substitution for y = (x² + 3x)⁷

Let u = x² + 3x (the inner function). Then y = u⁷.

Find dy/du using the power rule on u⁷:

dy/du = 7u⁶

Find du/dx:

du/dx = 2x + 3

Multiply and substitute u back:

dy/dx = 7u⁶ · (2x+3) = 7(x²+3x)⁶ · (2x+3)

§ 05Twelve Worked Exercises

Work each problem yourself before revealing the answer. The groups escalate from straightforward power composites to nested functions and combined rules.

Exercises opened: 0 / 12

Group A — Power and Polynomial Composites (Exercises 1–4)

Exercise 01 Basic
Differentiate   y = (4x − 1)³
  1. Outer function: (□)³. Inner function: 4x − 1.
  2. Differentiate the outer, leaving the inner untouched: 3(4x − 1)²
  3. Differentiate the inner: d/dx[4x − 1] = 4.
  4. Multiply: dy/dx = 3(4x−1)² · 4 = 12(4x−1)²
Exercise 02 Basic
Differentiate   y = (x² + 5)⁴
  1. Outer: (□)⁴, inner: x² + 5.
  2. Outer derivative (inner untouched): 4(x² + 5)³.
  3. Inner derivative: d/dx[x² + 5] = 2x.
  4. Multiply: dy/dx = 4(x²+5)³ · 2x = 8x(x²+5)³
Exercise 03 Basic
Differentiate   y = √(3x + 2)
Write √(3x+2) as (3x+2)^(1/2). Then the outer is (□)^(1/2) with derivative (1/2)(□)^(−1/2), and the inner is 3x+2.
  1. Rewrite: y = (3x+2)^(1/2). Outer: (□)^(1/2), inner: 3x+2.
  2. Outer derivative (inner untouched): (1/2)(3x+2)^(−1/2).
  3. Inner derivative: 3.
  4. Multiply: dy/dx = (1/2)(3x+2)^(−1/2) · 3 = 3 / (2√(3x+2)) dy/dx = 3 / (2√(3x+2))
Exercise 04 Basic
Differentiate   y = (2x³ − x)⁵
  1. Outer: (□)⁵, inner: 2x³ − x.
  2. Outer derivative (inner untouched): 5(2x³−x)⁴.
  3. Inner derivative: 6x² − 1.
  4. Multiply and factorise: dy/dx = 5(2x³−x)⁴ · (6x²−1)

Group B — Trig and Exponential Composites (Exercises 5–8)

Exercise 05 Medium
Differentiate   y = sin(3x²)
  1. Outer: sin(□), inner: 3x².
  2. Outer derivative (inner untouched): cos(3x²). The inner function stays inside, do not differentiate it yet.
  3. Inner derivative: 6x.
  4. Multiply: dy/dx = cos(3x²) · 6x = 6x cos(3x²)
Exercise 06 Medium
Differentiate   y = e^(x³ − 2x)
  1. Outer: e^(□), inner: x³ − 2x.
  2. Key fact: d/du[eᵘ] = eᵘ. So the outer derivative leaves e^(x³−2x) unchanged: Outer deriv (inner untouched): e^(x³−2x)
  3. Inner derivative: 3x² − 2.
  4. Multiply: dy/dx = e^(x³−2x) · (3x²−2) = (3x²−2)e^(x³−2x)
Exercise 07 Medium
Differentiate   y = cos²(x)   [i.e. y = (cos x)²]
Write it as (cos x)² so the outer is (□)² and the inner is cos x. This makes the layers clear. Don't try to apply the power rule to cos²(x) without the chain rule.
  1. Write y = (cos x)². Outer: (□)², inner: cos x.
  2. Outer derivative (inner untouched): 2(cos x)¹ = 2 cos x.
  3. Inner derivative: d/dx[cos x] = −sin x.
  4. Multiply: dy/dx = 2 cos x · (−sin x) = −2 sin x cos x
  5. Recognise the double angle identity: 2 sin x cos x = sin(2x): dy/dx = −sin(2x) This result is used often, the derivative of cos²x equals −sin(2x), which also equals d/dx[½(1 + cos 2x)] by the double-angle substitution. ✓
Exercise 08 Medium
Differentiate   y = tan(e^x)
  1. Outer: tan(□), inner: eˣ.
  2. Outer derivative (inner untouched): sec²(eˣ). Recall d/du[tan u] = sec²u.
  3. Inner derivative: d/dx[eˣ] = eˣ.
  4. Multiply: dy/dx = sec²(eˣ) · eˣ = eˣ sec²(eˣ)

Group C — Combined Rules and Nested Functions (Exercises 9–12)

Exercise 09 Hard
Differentiate   y = x² · e^(sin x)   (product + chain)
This is a product of two functions: u = x² and v = e^(sin x). Apply the product rule (u′v + uv′). To find v′ = d/dx[e^(sin x)] you will need the chain rule.
  1. Product rule: u = x², v = e^(sin x). So u′ = 2x.
  2. Find v′ using the chain rule on e^(sin x). Outer: e^(□), inner: sin x: v′ = e^(sin x) · cos x
  3. Apply product rule u′v + uv′: dy/dx = 2x · e^(sin x) + x² · e^(sin x) · cos x
  4. Factorise the common factor x · e^(sin x): dy/dx = x·e^(sin x) · (2 + x cos x)
Exercise 10 Hard
Differentiate   y = ln(x² + 1)   (chain with log)
  1. Outer: ln(□), inner: x² + 1.
  2. Outer derivative (inner untouched): 1/(x² + 1). Recall d/du[ln u] = 1/u.
  3. Inner derivative: 2x.
  4. Multiply: dy/dx = 2x / (x² + 1)
Exercise 11 Hard
Differentiate   y = sin²(3x)   (double chain)
There are three layers here: the square (□)², then sin(□), then 3x. Work from outside inward: outer is (□)², middle is sin(□), inner is 3x. Apply the chain rule twice.
  1. Write y = (sin(3x))². Three layers: (□)² wrapping sin(□) wrapping 3x.
  2. Outer derivative (leaving the rest untouched): 2 sin(3x).
  3. Now differentiate sin(3x), this is itself a chain rule. Outer sin(□), inner 3x: d/dx[sin(3x)] = cos(3x) · 3 = 3 cos(3x)
  4. Multiply everything: dy/dx = 2 sin(3x) · 3 cos(3x) = 6 sin(3x) cos(3x)
  5. Recognise 2 sin A cos A = sin(2A): dy/dx = 3 sin(6x)
Exercise 12 Hard
Differentiate   y = e^(√(1+x²))
Three layers again: outer e^(□), middle √(□) = (□)^(1/2), inner 1+x². Write out u = 1+x², v = √u, y = eᵛ, then chain together dv/du · du/dx, and finally dy/dv · (dv/du · du/dx).
  1. Let u = 1 + x² and v = √u = u^(1/2), so y = eᵛ.
  2. dy/dv = eᵛ = e^(√(1+x²)).
  3. dv/du = (1/2)u^(−1/2) = 1/(2√(1+x²)).
  4. du/dx = 2x.
  5. Chain all three together: dy/dx = dy/dv · dv/du · du/dx: = e^(√(1+x²)) · 1/(2√(1+x²)) · 2x
  6. Simplify: the 2 and 2 cancel: dy/dx = x·e^(√(1+x²)) / √(1+x²)

§ 06Common Mistakes

These errors appear in almost every set of chain rule exam scripts. Knowing them in advance is a genuine advantage.

✗ Forgetting to multiply by the inner derivative

Wrong: d/dx[sin(3x)] = cos(3x)

Correct: d/dx[sin(3x)] = cos(3x) · 3 = 3 cos(3x). The chain rule always requires that final multiplication. If you stop after differentiating the outer, you have only done half the job.

✗ Differentiating the inner function when writing the outer derivative

Wrong: d/dx[(x²+1)⁵] → starts by writing 5(2x)⁴ · 2x, substituting 2x (the inner derivative) before the outer derivative step

Correct: Outer derivative step: 5(x²+1)⁴. Then separately compute the inner derivative 2x. Multiply: 5(x²+1)⁴ · 2x = 10x(x²+1)⁴. Keep the two steps cleanly separate.

✗ Applying the chain rule when it is not needed

d/dx[sin(x)] does not need the chain rule: x is already the variable and there is no inner function to differentiate. The chain rule is only for composite functions where something other than x sits inside the outer function.

✗ Confusing chain rule with product rule

sin(x²) needs the chain rule (x² is inside sine (a composite). But x · sin(x) needs the product rule (two functions multiplied) not composite). The test: can you write it as f(g(x))? If yes, chain. If it is f(x) · g(x), product.

✗ Stopping after one chain rule application in nested functions

For y = sin²(3x), you need to apply the chain rule twice: once for the square, and again for the sin(3x) inside. After 2 sin(3x) · [derivative of sin(3x)], you must still compute d/dx[sin(3x)] = 3 cos(3x). A common slip is to write just cos(3x) and miss the factor of 3.

§ 0710-Question Quiz

Select one answer per question then press Submit to see your score with full explanations.

Chain Rule — Quiz

Question 01 of 10
For y = f(g(x)), the chain rule states dy/dx equals:
  • f′(x) · g′(x)
  • f′(g(x)) · g′(x)
  • f(g′(x))
  • f′(g(x)) + g′(x)
Question 02 of 10
Differentiate y = (5x − 3)⁴
  • 4(5x−3)³
  • 20(5x−3)³
  • 4(5x−3)⁴
  • 5(5x−3)³
Question 03 of 10
Differentiate y = sin(4x)
  • cos(4x)
  • −cos(4x)
  • 4 cos(4x)
  • 4 sin(4x)
Question 04 of 10
Differentiate y = e^(2x)
  • e^(2x)
  • 2e^x
  • 2e^(2x)
  • xe^(2x)
Question 05 of 10
For y = (x² + 1)⁵, the inner function is:
  • (□)⁵
  • x² + 1
  • 2x
  • 5(x²+1)⁴
Question 06 of 10
Differentiate y = √(x² + 9)
  • 1 / (2√(x²+9))
  • 2x / √(x²+9)
  • x / √(x²+9)
  • x / (2√(x²+9))
Question 07 of 10
Differentiate y = cos(x³)
  • −sin(x³)
  • −3x² sin(x³)
  • 3x² sin(x³)
  • −3x² cos(x³)
Question 08 of 10
Differentiate y = ln(sin x)
  • 1/sin x
  • cos x · ln(sin x)
  • cot x
  • −cot x
Question 09 of 10
Differentiate y = sin²(x)
  • 2 sin x
  • cos²(x)
  • sin(2x)
  • 2 cos x
Question 10 of 10
Which of these functions requires the chain rule to differentiate?
  • y = x · sin x
  • y = x³ + sin x
  • y = sin(x³)
  • y = sin x / x
❧     ❧     ❧

Cookie Settings