01 / 20

The Chain Rule

Master the technique for differentiating composite functions: functions nested inside other functions.

AP Calculus AB

What Is a Composite Function?

A composite function is a function built by plugging one function into another. If you have an outer function \( f \) and an inner function \( g \), the composite is written:

$$ (f \circ g)(x) = f\!\bigl(g(x)\bigr) $$

Visualizing Composition

x Inner g(x) g(x) Outer f(u) f(g(x)) output

Why Do We Need the Chain Rule?

Basic differentiation rules (power, product, quotient) handle simple expressions. But as soon as a function is nested, those rules alone are not enough.

Simple
\( \frac{d}{dx}\bigl[x^5\bigr] = 5x^4 \) : just the power rule.
Composite
\( \frac{d}{dx}\bigl[(3x+1)^5\bigr] = \;? \) : power rule alone is not enough.

The Chain Rule: Formal Statement

If \( y = f\!\bigl(g(x)\bigr) \) and both \( f \) and \( g \) are differentiable, then:

$$ \frac{dy}{dx} = f'\!\bigl(g(x)\bigr) \cdot g'(x) $$

The Rule in Action

\( y = f(g(x)) \)
differentiate Outer derivative
\( f'(g(x)) \)
× Inner derivative
\( g'(x) \)
\( \frac{dy}{dx} = f'(g(x)) \cdot g'(x) \)

Chain Rule vs. Product Rule

Chain Rule Product Rule
Structure \( f\!\bigl(g(x)\bigr) \) : nested \( f(x) \cdot g(x) \) : multiplied
Formula \( f'(g) \cdot g' \) \( f'\,g + f\,g' \)
Example \( \sin(x^2) \) \( x^2 \sin x \)
Key cue "function of a function" "two functions multiplied"

How to Apply the Chain Rule

1
Identify the outer and inner functions. Rewrite as \( y = f(u) \) where \( u = g(x) \).
2
Differentiate the outer function with respect to \( u \): find \( \frac{dy}{du} = f'(u) \).
3
Differentiate the inner function with respect to \( x \): find \( \frac{du}{dx} = g'(x) \).
4
Multiply the two derivatives and substitute \( u = g(x) \) back in: \( \frac{dy}{dx} = f'(g(x)) \cdot g'(x) \).

Example 1: Power of a Linear

Find \( \dfrac{d}{dx}\bigl[(3x+1)^5\bigr] \).

1
Identify: outer \( f(u) = u^5 \), inner \( u = 3x+1 \).
2
Outer derivative: \( f'(u) = 5u^4 \).
3
Inner derivative: \( g'(x) = 3 \).
4
Multiply and substitute: \( 5(3x+1)^4 \cdot 3 = \) \( 15(3x+1)^4 \).

Example 2: Trig Composite

Find \( \dfrac{d}{dx}\bigl[\sin(x^2)\bigr] \).

1
Identify: outer \( f(u) = \sin u \), inner \( u = x^2 \).
2
Outer derivative: \( f'(u) = \cos u \).
3
Inner derivative: \( g'(x) = 2x \).
4
Result: \( 2x\cos(x^2) \).

Example 3: Exponential Composite

Find \( \dfrac{d}{dx}\bigl[e^{5x^2}\bigr] \).

1
Identify: outer \( f(u) = e^u \), inner \( u = 5x^2 \).
2
Outer derivative: \( f'(u) = e^u \).
3
Inner derivative: \( g'(x) = 10x \).
4
Result: \( 10x\,e^{5x^2} \).

Nested Chains: Two Layers Deep

When three functions are nested, apply the Chain Rule twice. Differentiate the outermost function first, then work inward, multiplying derivatives at each layer.

Graphing \( \sin(x^2) \) and Its Derivative

x y 2 4 -2 -4 5 -5
\( \sin(x^2) \)
\( 2x\cos(x^2) \)

Common Mistakes

Forgetting the Inner Derivative
Writing \( \frac{d}{dx}[\sin(3x)] = \cos(3x) \) instead of \( 3\cos(3x) \). The factor of \( 3 \) from the inner derivative is essential.
Applying Power Rule Alone
Writing \( \frac{d}{dx}[(2x+1)^4] = 4(2x+1)^3 \) instead of \( 8(2x+1)^3 \). You must multiply by \( g'(x) = 2 \).
Confusing Chain with Product
Using the product rule on \( e^{x^2} \) as if it were two separate factors. It is a composition, not a product.

Chain Rule Quick Reference

Composite Function Derivative
\( [g(x)]^n \) \( n[g(x)]^{n-1} \cdot g'(x) \)
\( \sin\!\bigl(g(x)\bigr) \) \( \cos\!\bigl(g(x)\bigr) \cdot g'(x) \)
\( \cos\!\bigl(g(x)\bigr) \) \( -\sin\!\bigl(g(x)\bigr) \cdot g'(x) \)
\( e^{g(x)} \) \( e^{g(x)} \cdot g'(x) \)
\( \ln\!\bigl(g(x)\bigr) \) \( \dfrac{g'(x)}{g(x)} \)

Question 1 of 5

What is \( \dfrac{d}{dx}\bigl[(2x+3)^4\bigr] \)?

Question 2 of 5

Find \( \dfrac{d}{dx}\bigl[\cos(5x)\bigr] \).

Question 3 of 5

What is \( \dfrac{d}{dx}\bigl[e^{3x^2+1}\bigr] \)?

Question 4 of 5

Find \( \dfrac{d}{dx}\bigl[\ln(x^2+4)\bigr] \).

Question 5 of 5

If \( h(x) = \bigl(\sin(2x)\bigr)^3 \), what is \( h'(x) \)?