01 / 20

The Chain Rule

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

Calculus 1

What is a Composite Function?

A composite function is created when one function is plugged into another. If we have an outer function \( f \) and an inner function \( g \), the composite is written:

For example, in \( \sin(x^2) \), the outer function is \( \sin(u) \) and the inner function is \( u = x^2 \). The Chain Rule tells us how to differentiate these nested structures.

Visualizing the Chain

\( x \)
Inner
\( g(x) \)
\( u = g(x) \)
Outer
\( f(u) \)
\( f\bigl(g(x)\bigr) \) = Composite Output

Why Do We Need the Chain Rule?

Basic derivative rules like the Power Rule or the derivative of \( \sin(x) \) apply to simple functions. But most real-world functions are composites:

\( (3x+1)^5 \)
Power of a linear expression
\( e^{x^2} \)
Exponential of a polynomial
\( \ln(\sin x) \)
Log of a trig function

The Chain Rule: Formal Statement

In words: differentiate the outer function (keeping the inner function unchanged), then multiply by the derivative of the inner function.

How the Derivatives Multiply

Inner: \( g(x) \)
\( u = g(x) \)
Outer: \( f(u) \)
\( y = f(u) \)
\( g'(x) \)
\( \frac{du}{dx} \)
\( f'(u) \)
\( \frac{dy}{du} \)
× =
\( f'\bigl(g(x)\bigr) \cdot g'(x) \)
\( \frac{dy}{dx} \)
differentiate differentiate

Chain Rule vs. Basic Rules

Basic Rule Chain Rule Needed
Power \( \frac{d}{dx} x^3 = 3x^2 \) \( \frac{d}{dx} (2x+1)^3 \)
Trig \( \frac{d}{dx} \sin x = \cos x \) \( \frac{d}{dx} \sin(5x) \)
Exponential \( \frac{d}{dx} e^x = e^x \) \( \frac{d}{dx} e^{-x^2} \)
Logarithm \( \frac{d}{dx} \ln x = \frac{1}{x} \) \( \frac{d}{dx} \ln(x^2+1) \)

How to Apply the Chain Rule

1
Identify the layers. Find the outer function \( f \) and the inner function \( g(x) \). Set \( u = g(x) \).
2
Differentiate the outer. Compute \( f'(u) \), treating \( u \) as the variable. Leave \( u \) in place (do not substitute back yet).
3
Differentiate the inner. Compute \( g'(x) = \frac{du}{dx} \).
4
Multiply and substitute. The result is \( f'(g(x)) \cdot g'(x) \). Replace \( u \) with \( g(x) \) everywhere.

Example 1: Power of a Linear

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: \( 5(3x+1)^4 \cdot 3 = \) \( 15(3x+1)^4 \).

Example 2: Trig Composite

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: \( \cos(x^2) \cdot 2x = \) \( 2x\cos(x^2) \).

Example 3: Exponential Composite

1
Identify: Outer: \( f(u) = e^u \). Inner: \( u = -x^2 \).
2
Outer derivative: \( f'(u) = e^u \) (exponential's derivative is itself).
3
Inner derivative: \( g'(x) = -2x \).
4
Result: \( e^{-x^2} \cdot (-2x) = \) \( -2x\,e^{-x^2} \).

Nested Chains: Two Layers Deep

Here we have three layers: \( \cos(\cdot) \) wrapping \( (\cdot)^3 \) wrapping \( 2x+1 \). Apply the chain rule twice:

1
Outermost derivative: \( -\sin\!\bigl((2x+1)^3\bigr) \)
2
Middle derivative: \( \times\; 3(2x+1)^2 \)
3
Innermost derivative: \( \times\; 2 \)

Combining with Other Rules

In practice, the Chain Rule often appears alongside the Product Rule or Quotient Rule. Always handle the Chain Rule inside the other rule.

Product Rule
Splits into \( u'v + uv' \)
Chain Rule
Gives the 3 in \( 3e^{3x} \) when differentiating \( e^{3x} \)

Common Mistakes

✕ Forgetting the Inner Derivative
Writing \( \frac{d}{dx}\sin(3x) = \cos(3x) \) instead of \( 3\cos(3x) \). Always multiply by \( g'(x) \).
✕ Differentiating the Inner Too
Replacing \( g(x) \) inside the outer derivative. Keep \( g(x) \) intact: \( f'(\,g(x)\,) \), not \( f'(\,g'(x)\,) \).
✕ Stopping at One Layer
With nested composites like \( \sin((x^2+1)^3) \), you need to chain through every layer, not just the outermost.

Quick Reference Table

Function Derivative (Chain Rule)
\( \bigl[g(x)\bigr]^n \) \( n\bigl[g(x)\bigr]^{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)} \)
\( \tan\!\bigl(g(x)\bigr) \) \( \sec^2\!\bigl(g(x)\bigr) \cdot g'(x) \)

Question 1 of 5

What is \( \dfrac{d}{dx}(5x-2)^4 \)?

Question 2 of 5

What is \( \dfrac{d}{dx}\cos(3x) \)?

Question 3 of 5

What is \( \dfrac{d}{dx}\,e^{4x+1} \)?

Question 4 of 5

What is \( \dfrac{d}{dx}\ln(x^2+1) \)?

Question 5 of 5

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