Calculus
Intermediate

Chain Rule

Derivative of a composite function.

Formula

ddxf(g(x))=f′(g(x)) g′(x)\frac{d}{dx}f(g(x)) = f'(g(x))\,g'(x)

Variables

f, gFunctions

Example

d/dx (3x+1)⁵ = 5(3x+1)⁴ · 3 = 15(3x+1)⁴.

How it works

The chain rule tells you how to differentiate a function that is built by feeding one function into another, like f(g(x)). The outside function changes as the inside function changes, so you first take the derivative of the outside function and keep the inside expression unchanged, then multiply by the derivative of the inside function. This works because a small change in x affects the output in two stages: through g(x) and then through f.

When to use it

Use this whenever you see a composition, such as a power of a polynomial, a trigonometric function with a nontrivial input, an exponential like e^(something), or a logarithm of an expression. It is essential in calculus problems involving nested functions, related rates, and implicit differentiation.

Worked example, step by step

Differentiate y = sqrt(2x^2 - 5x + 1) Rewrite as y = (2x^2 - 5x + 1)^(1/2) Outer function: u^(1/2), so derivative is (1/2)u^(-1/2) Inner function: u = 2x^2 - 5x + 1, so du/dx = 4x - 5 Apply the chain rule: dy/dx = (1/2)(2x^2 - 5x + 1)^(-1/2)(4x - 5) Simplify: dy/dx = (4x - 5) / [2sqrt(2x^2 - 5x + 1)]

Common mistakes to avoid

  • forgetting to multiply by the derivative of the inside function
  • differentiating the inside expression twice or the outside expression twice instead of once each
  • leaving the inside expression out after differentiating the outside function

Did You Know?

The chain rule is what lets you differentiate functions inside functions — the engine behind neural-network training today.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026