Mathematics · AP Calculus · College Level

Derivatives and the Chain Rule

TheChain Ruleis the fundamental differentiation technique in calculus used to compute the derivative of acomposite functionf(g(x))f(g(x)), multiplying the derivative of the outer function by the derivative of the inner function.

1What is the Chain Rule? Visual Overview

In calculus, simple formulas like the power rule ddx[xn]=nxn−1\frac{d}{dx}[x^n] = n x^{n-1} only work when the base is simply xx. When an expression is "nested" inside another function—such as (3x2+1)5(3x^2 + 1)^5 or sin⁡(4x)\sin(4x)—we must apply theChain Rule. Think of it as coupled gears transmitting rates of change.

The Chain Rule: Rate of Change Transmission: Input x, Inner Function g(x), Inner Rate du/dx, Outer Function f(u), Outer Rate dy/du, Chain Multiplier Full size

The Chain Rule: Rate of Change Transmission

Think of composite functions as coupled gears: the rate of change of y with respect to x equals the rate of change of y relative to u multiplied by the rate of change of u relative to x.

  1. 1Input x — The base independent variable driving the system
  2. 2Inner Function g(x) — Transforms input x into intermediate variable u = g(x)
  3. 3Inner Rate du/dx — How fast the intermediate value u changes as x moves
  4. 4Outer Function f(u) — Operates on u to produce the final output y = f(u)
  5. 5Outer Rate dy/du — Differentiates the outer structure while holding the inside frozen
  6. 6Chain Multiplier — Multiplying the two rates yields dy/dx = (dy/du) * (du/dx)

Definition

Composite Function — A function y=f(g(x))y = f(g(x)) where the output of an inner function u=g(x)u = g(x) serves as the input to an outer function f(u)f(u).

The Chain Rule (Function Notation)

ddx[f(g(x))]=f′(g(x))⋅g′(x)\frac{d}{dx}\Big[f(g(x))\Big] = f'(g(x)) \cdot g'(x)
  • f(g(x)) = The composite function
  • f'(g(x)) = Derivative of outer function evaluated at unchanged inner function
  • g'(x) = Derivative of the inner function

The Chain Rule (Leibniz Notation)

dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}
  • y = Outer dependent variable ($y = f(u)$)
  • u = Intermediate inner variable ($u = g(x)$)
  • x = Independent input variable

24-Step Algorithm & Worked Examples

4-Step Algorithm to Differentiate Any Composite Function

  1. 1

    1. Identify Layers

    Isolate the outer shell f(u) and the inner expression u = g(x)

  2. 2

    2. Differentiate Outer

    Take derivative of f, leaving the inner argument completely untouched

  3. 3

    3. Differentiate Inner

    Compute g'(x) separately on scrap paper

  4. 4

    4. Multiply & Simplify

    Multiply outer result by g'(x) and simplify algebraic factors

Real-life example · Example 1: General Power Rule

Differentiate y=(2x3−5x)4y = (2x^3 - 5x)^4.
• Step 1: Let inner u=2x3−5xu = 2x^3 - 5x, outer y=u4y = u^4.
• Step 2: dydu=4u3=4(2x3−5x)3\frac{dy}{du} = 4u^3 = 4(2x^3 - 5x)^3.
• Step 3: dudx=6x2−5\frac{du}{dx} = 6x^2 - 5.
• Step 4: dydx=4(2x3−5x)3⋅(6x2−5)\frac{dy}{dx} = 4(2x^3 - 5x)^3 \cdot (6x^2 - 5).

Real-life example · Example 2: Trigonometric Composite

Differentiate y=cos⁡(5x2+1)y = \cos(5x^2 + 1).
• Outer is cos⁡(u)\cos(u), so derivative is −sin⁡(u)=−sin⁡(5x2+1)-\sin(u) = -\sin(5x^2 + 1).
• Inner is 5x2+15x^2 + 1, derivative is 10x10x.
• Result: dydx=−10xsin⁡(5x2+1)\frac{dy}{dx} = -10x \sin(5x^2 + 1).

3Common Derivative Patterns & Traps

Common Standard Chain Rule Patterns

  • Power Chain

    Composite Formula y
    [g(x)]n[g(x)]^n
    Derivative dy/dx
    n[g(x)]n−1⋅g′(x)n[g(x)]^{n-1} \cdot g'(x)
    Quick Example
    ddx[(x2+1)3]=3(x2+1)2(2x)\frac{d}{dx}[(x^2+1)^3] = 3(x^2+1)^2(2x)
  • Exponential

    Composite Formula y
    eg(x)e^{g(x)}
    Derivative dy/dx
    eg(x)⋅g′(x)e^{g(x)} \cdot g'(x)
    Quick Example
    ddx[e3x]=3e3x\frac{d}{dx}[e^{3x}] = 3e^{3x}
  • Natural Log

    Composite Formula y
    ln⁡(g(x))\ln(g(x))
    Derivative dy/dx
    g′(x)g(x)\frac{g'(x)}{g(x)}
    Quick Example
    ddx[ln⁡(x2+4)]=2xx2+4\frac{d}{dx}[\ln(x^2+4)] = \frac{2x}{x^2+4}
  • Trig (Sine)

    Composite Formula y
    sin⁡(g(x))\sin(g(x))
    Derivative dy/dx
    cos⁡(g(x))⋅g′(x)\cos(g(x)) \cdot g'(x)
    Quick Example
    ddx[sin⁡(4x)]=4cos⁡(4x)\frac{d}{dx}[\sin(4x)] = 4\cos(4x)
Common mistake: The Most Common Student Mistake: Differentiating the inside function INSIDE the outer function! For example, writing ddx[sin⁡(x2)]=cos⁡(2x)\frac{d}{dx}[\sin(x^2)] = \cos(2x). This is WRONG! The correct answer is cos⁡(x2)⋅2x\cos(x^2) \cdot 2x. The inner function must remain intact during outer differentiation!

4Exam-Style AP Question

Exam question · AP Calculus AB / BC

If h(x)=f(g(x))h(x) = f(g(x)), g(2)=3g(2) = 3, g′(2)=−4g'(2) = -4, and f′(3)=5f'(3) = 5, what is the value of h′(2)h'(2)?
  1. A.-20
  2. B.15
  3. C.-12
  4. D.1

Remember

  • The chain rule is required whenever a function has another function nested inside it.
  • Core formula: ddx[f(g(x))]=f′(g(x))⋅g′(x)\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x).
  • Never differentiate the inner function inside the outer function — differentiate the outer shell first, keeping the inner argument intact, then multiply by the inner derivative.
  • In Leibniz notation: dydx=dydu⋅dudx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}.
  • For nested compositions f(g(h(x)))f(g(h(x))), apply the chain rule iteratively from outside to innermost.

Check yourself

  1. Question 1

    What is the derivative of y=(4x−1)5y = (4x - 1)^5 with respect to xx?
  2. Question 2

    Find ddx[ecos⁡(x)]\frac{d}{dx}[e^{\cos(x)}].
  3. Question 3

    Differentiate y=x3+7y = \sqrt{x^3 + 7}.
  4. Question 4

    If y=tan⁡(3x)y = \tan(3x), what is dydx\frac{dy}{dx}?

Read it? Now test it. Timed exam questions on this topic, then a report on what to revise.

Take a test

Want a lesson on another topic? Type any topic or add a photo of your notes — get a lesson like this in seconds.

Learn a topic

More Mathematics explained