The Chain Rule: Derivatives of Nested Functions

The Chain Rule: Derivatives of Nested Functions
The Chain Rule: Derivatives of Nested Functions | Ideasthesia

The chain rule handles functions inside functions.

If y = f(g(x)), then dy/dx = f'(g(x)) · g'(x)

Here's the unlock: the chain rule says derivatives multiply through composition. When you change x, that changes g(x), which changes f(g(x)). The total rate of change is the product of the individual rates.

It's like compound conversion: miles per hour × hours per day = miles per day. Each rate multiplies the next.


The Intuition

Suppose:

  • g converts x to u
  • f converts u to y

How fast does y change with respect to x?

If x changes by 1, u changes by g'(x). If u changes by 1, y changes by f'(u).

So if x changes by 1, y changes by f'(u) · g'(x).

The rates compound. That's the chain rule.


The Formula

d/dx f(g(x)) = f'(g(x)) · g'(x)

Or in Leibniz notation:

dy/dx = (dy/du) · (du/dx)

This looks like fraction cancellation — and while it's not rigorously "canceling," the notation captures the intuition perfectly.


Example: (x² + 1)⁵

Find d/dx (x² + 1)⁵

Identify the layers:

  • Outer function: f(u) = u⁵
  • Inner function: g(x) = x² + 1

Apply the chain rule:

  • f'(u) = 5u⁴
  • g'(x) = 2x

d/dx (x² + 1)⁵ = 5(x² + 1)⁴ · 2x = 10x(x² + 1)⁴

Differentiate the outside, keep the inside, multiply by the derivative of the inside.


Example: sin(x²)

Find d/dx sin(x²)

Outer function: f(u) = sin(u) → f'(u) = cos(u) Inner function: g(x) = x² → g'(x) = 2x

d/dx sin(x²) = cos(x²) · 2x = 2x cos(x²)


Example: √(3x + 1)

Find d/dx √(3x + 1) = d/dx (3x + 1)^(1/2)

Outer: f(u) = u^(1/2) → f'(u) = (1/2)u^(-1/2) Inner: g(x) = 3x + 1 → g'(x) = 3

d/dx √(3x + 1) = (1/2)(3x + 1)^(-1/2) · 3 = 3/(2√(3x + 1))


Example: e^(x²)

Find d/dx e^(x²)

Outer: f(u) = eᵘ → f'(u) = eᵘ Inner: g(x) = x² → g'(x) = 2x

d/dx e^(x²) = e^(x²) · 2x = 2x e^(x²)


Multiple Layers

The chain rule extends to deeper nesting:

d/dx f(g(h(x))) = f'(g(h(x))) · g'(h(x)) · h'(x)

Work from outside in, multiplying each derivative.

Example: sin((2x + 1)³)

Layer 1: sin(u) → cos(u) Layer 2: u³ → 3u² Layer 3: 2x + 1 → 2

d/dx sin((2x + 1)³) = cos((2x + 1)³) · 3(2x + 1)² · 2 = 6(2x + 1)² cos((2x + 1)³)


Why "Chain"?

The name comes from the chain of dependencies:

x → g(x) → f(g(x))

Each link affects the next. The derivative of the whole chain is the product of derivatives at each link.

Leibniz notation shows it clearly: dy/dx = dy/du · du/dv · dv/dx

Each intermediate variable contributes its rate of change.


Common Mistakes

Forgetting the inner derivative: Wrong: d/dx (x² + 1)⁵ = 5(x² + 1)⁴ Right: d/dx (x² + 1)⁵ = 5(x² + 1)⁴ · 2x

The chain rule always requires multiplying by the inner derivative, even if it seems simple.

Misidentifying inside vs. outside: For sin(x²), the inside is x² (applied first when computing), the outside is sin.


Proof Idea

From the limit definition, if y = f(g(x)):

dy/dx = lim[h→0] (f(g(x+h)) - f(g(x))) / h

Let Δu = g(x+h) - g(x). Then:

= lim[h→0] (f(g(x) + Δu) - f(g(x))) / Δu · Δu/h

As h→0, Δu→0 also (if g is continuous). The first factor approaches f'(g(x)), the second approaches g'(x).

Hence: dy/dx = f'(g(x)) · g'(x)


The Chain Rule and Substitution

In integration, "u-substitution" is the chain rule in reverse.

If you see an integral like ∫2x·e^(x²) dx, recognize it as the derivative of e^(x²).

The chain rule creates a specific pattern (inner derivative times outer). Recognizing that pattern lets you undo it.


Implicit Chain Rule

When y is defined implicitly (like x² + y² = 1), differentiating y requires the chain rule:

d/dx (y²) = 2y · dy/dx

The y² is a function of y, and y is a function of x. Chain rule multiplies by dy/dx.


The Core Insight

The chain rule says: rates of change multiply through composition.

If f amplifies changes in u by a factor of f'(u), and g amplifies changes in x by g'(x), then f(g(x)) amplifies changes in x by f'(g(x)) · g'(x).

This isn't a special calculus fact — it's how compound rates work everywhere. The chain rule formalizes it for derivatives.

When you differentiate from outside to inside, multiply each layer's derivative. That's the chain.


Part 4 of the Calculus Derivatives series.

Previous: The Power Rule: Why the Exponent Comes Down Next: The Product Rule: When Two Functions Multiply