Ad Space — Top Banner

Chain Rule

Reference for the chain rule d/dx[f(g(x))] = f'(g(x))*g'(x).
Step-by-step examples with trig, exponential, and nested polynomial composite functions.

Need to calculate, not just reference? Use the interactive version. Open Chain Rule Calculator →

The Chain Rule

If y = f(g(x)), then:

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

The chain rule is used to differentiate composite functions — a function inside another function. Think of it as peeling layers: differentiate the outer function first, then multiply by the derivative of the inner function.

In Leibniz Notation

If y = f(u) and u = g(x), then:

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

Variables

SymbolMeaning
f(g(x))A composite function (outer function f applied to inner function g)
f'(g(x))Derivative of the outer function, evaluated at g(x)
g'(x)Derivative of the inner function

Example 1 — Simple Chain Rule

Find d/dx [(3x + 2)⁵]

Outer function: u⁵, Inner function: u = 3x + 2

d/dx [u⁵] = 5u⁴ · du/dx

= 5(3x + 2)⁴ · 3

= 15(3x + 2)⁴

Example 2 — Trigonometric Chain Rule

Find d/dx [sin(x²)]

Outer function: sin(u), Inner function: u = x²

= cos(x²) · d/dx[x²]

= 2x · cos(x²)

Example 3 — Exponential Chain Rule

Find d/dx [e^(4x³)]

Outer function: e^u, Inner function: u = 4x³

= e^(4x³) · d/dx[4x³]

= 12x² · e^(4x³)

Example 4 — Double Chain Rule

Find d/dx [sin²(3x)]

This is [sin(3x)]². Three layers: square → sin → 3x

= 2·sin(3x) · d/dx[sin(3x)]

= 2·sin(3x) · cos(3x) · 3

= 6·sin(3x)·cos(3x) = 3·sin(6x)

When to Use It

Use the chain rule whenever you see:

  • A function raised to a power: (something)ⁿ
  • A trig function of an expression: sin(something), cos(something)
  • An exponential with a non-trivial exponent: e^(something)
  • A logarithm of an expression: ln(something)
  • Any nested or composite function

Key Notes

  • Formula: d/dx f(g(x)) = f'(g(x)) × g'(x): Differentiate the outer function (leaving the inner function unchanged), then multiply by the derivative of the inner function. This must be applied once for each layer of composition.
  • Leibniz notation: dy/dx = (dy/du)(du/dx): If y = f(u) and u = g(x), then dy/dx equals the product of the two intermediate rates. While not literally fraction cancellation, this notation makes the chain rule intuitive and helps organize multi-layer derivatives.
  • Multiple layers — work from outside in: For h(x) = sin(e^(x²)), differentiate outermost first: cos(e^(x²)) × d/dx[e^(x²)] = cos(e^(x²)) × e^(x²) × 2x. Each layer contributes one factor to the product.
  • Implicit differentiation uses the chain rule: When differentiating y³ with respect to x, treat y as a function of x: d/dx[y³] = 3y² × dy/dx. The extra dy/dx factor is the chain rule applied to the implicit function y(x).
  • Applications: The chain rule is used whenever composite functions arise — virtually all of applied calculus. It underlies backpropagation in neural networks (the gradient of a loss with respect to weights through layers of functions), related rates problems, and most physical equations involving coupled variables.

Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.