• Foundation
  • About 15 min
  • 5 practice questions

The chain rule

Differentiate composite functions such as (3x + 1)⁵, sin(x²), e^(sin x) and ln(x² + 1) using the chain rule.

If something looks wrong, please tell us.

Many functions are built by putting one function inside another: sin(x²) is 'sine of (x squared)', and (3x + 1)⁵ is 'the fifth power of (3x + 1)'. These are composite functions. The rules of the last lesson do not handle them directly. The chain rule does, and it is the rule you will use most often.

The rule

If y is a function of u, and u is a function of x, then y is a function of x and dy/dx = (dy/du) × (du/dx). In words: differentiate the outer function, keeping the inside unchanged, then multiply by the derivative of the inside.

Chain rule: if y = f(g(x)), then dy/dx = f′(g(x)) × g′(x). Outer derivative (inside left alone) times inner derivative.

A rough way to see why: if u changes a little, by Δu, then y changes by about (dy/du)Δu; and if x changes by Δx, then u changes by about (du/dx)Δx. Combining the two gives Δy ≈ (dy/du)(du/dx)Δx.

Worked example 1: a power of a bracket

Differentiate y = (3x + 1)⁵. Let u = 3x + 1, so y = u⁵. Then dy/du = 5u⁴ and du/dx = 3, so dy/dx = 5(3x + 1)⁴ × 3 = 15(3x + 1)⁴. Expanding (3x + 1)⁵ first would be far slower.

Worked example 2: a function inside sine

Differentiate y = sin(x²). The outer function is sine, the inside is x². The derivative of the outer function is cos, applied to the unchanged inside: cos(x²). The derivative of the inside is 2x. So dy/dx = 2x cos(x²). Compare with y = sin² x = (sin x)²: here the outer function is squaring, so dy/dx = 2 sin x × cos x = sin 2x.

Worked example 3: an exponential and a logarithm

Differentiate y = e^(sin x). Outer: eᵘ, whose derivative is eᵘ; inner: sin x, whose derivative is cos x. So dy/dx = cos x × e^(sin x). Next, y = ln(x² + 1): the outer derivative is 1/u and the inner derivative is 2x, so dy/dx = 2x/(x² + 1). In general, d/dx[ln g(x)] = g′(x)/g(x).

Worked example 4: a square root

Differentiate y = √(1 + x²) = (1 + x²)^(1/2). Outer: u^(1/2), derivative (1/2)u^(−1/2). Inner: 1 + x², derivative 2x. So dy/dx = (1/2)(1 + x²)^(−1/2) × 2x = x/√(1 + x²). At x = 0 the slope is 0, which matches the graph having its lowest point there.

Longer chains

The rule extends to more layers: multiply the derivatives of every layer, working from outside in. For y = sin³(2x) = [sin(2x)]³, the layers are cubing, sine and 2x. So dy/dx = 3 sin²(2x) × cos(2x) × 2 = 6 sin²(2x) cos(2x).

Common mistakes

  • Forgetting to multiply by the inner derivative: d/dx sin(3x) is 3 cos 3x, not cos 3x.
  • Changing the inside when differentiating the outer function: d/dx (x² + 1)⁴ starts with 4(x² + 1)³, not 4(2x)³.
  • Confusing sin(x²) with sin² x: they have different outer and inner functions.

A check with the rules you already know

The chain rule agrees with the earlier rules wherever both can be used. For y = (x + 1)², the chain rule gives 2(x + 1) × 1 = 2x + 2, and expanding first, y = x² + 2x + 1, gives the same 2x + 2. For y = e^(2x), the chain rule gives 2e^(2x), and writing e^(2x) = eˣ × eˣ with the product rule gives eˣeˣ + eˣeˣ = 2e^(2x). Such checks build confidence that the rule is being used correctly.

Key takeaways: identify the outer and inner functions, differentiate the outer with the inside unchanged, and multiply by the derivative of the inside. For several layers, multiply one factor per layer. The pattern d/dx[ln g(x)] = g′(x)/g(x) is worth remembering.

Check your understanding

  1. 1. What is d/dx (2x − 1)⁴?

    1. 8(2x − 1)³
    2. 4(2x − 1)³
    3. 2(2x − 1)³
    4. 8(2x − 1)⁴
    Show answer

    Answer: A. Outer: 4u³; inner derivative: 2. So 4(2x − 1)³ × 2 = 8(2x − 1)³.

  2. 2. What is d/dx sin(3x), with x in radians?

    1. 3 cos 3x
    2. cos 3x
    3. −3 cos 3x
    4. 3 sin 3x
    Show answer

    Answer: A. Outer derivative cos(3x) times inner derivative 3 gives 3 cos 3x.

  3. 3. What is d/dx e^(x²)?

    1. e^(x²)
    2. x² e^(x² − 1)
    3. 2e^(x²)
    4. 2x e^(x²)
    Show answer

    Answer: D. Outer: eᵘ; inner: x² with derivative 2x. So the derivative is 2x e^(x²).

  4. 4. What is d/dx ln(cos x), for x where cos x > 0?

    1. tan x
    2. −tan x
    3. 1/cos x
    4. −cot x
    Show answer

    Answer: B. d/dx ln g = g′/g = (−sin x)/cos x = −tan x.

  5. 5. If y = √(x² + 9), what is dy/dx at x = 4?

    1. 1/10
    2. 8/5
    3. 4/5
    4. 5/4
    Show answer

    Answer: C. dy/dx = x/√(x² + 9). At x = 4: 4/√25 = 4/5.

Privacy · Terms · Refunds · Delivery