Skip to content

Chain Rule

Derivative of a composite function.

Variables

f
Outer function
g
Inner function

Explanation

Differentiate the outside (leaving the inside alone), then multiply by the derivative of the inside.

Example

.

How to use it

  1. Spot the inner function and the outer function .
  2. Differentiate the outer function, leaving the inside unchanged: .
  3. Multiply by the derivative of the inside: .

In Leibniz notation: .

Another worked example

Differentiate . The outer function is and the inner is .

Common patterns

  • , so .
  • , so .
  • .
  • .

Several layers

Work from the outside in, multiplying a derivative for each layer. For , which is :

Where it shows up

Related-rates problems are the chain rule with time: if a balloon's radius grows at , its volume grows at . Implicit differentiation and u-substitution in integrals are also the chain rule in disguise.

Common mistakes

  • Forgetting to multiply by the inner derivative. This is by far the most common error.
  • Changing the inside while differentiating the outside, such as writing as .

Where it's used

  • Related rates: how fast a shadow lengthens or a tank's water level rises.
  • Physics: a wave has a rate of change with factors and from the chain rule.
  • Machine learning: backpropagation, the method that trains neural networks, is the chain rule applied layer by layer.
  • Finance: continuous growth changes at rate .

Key takeaways

  • Differentiate the outside, keep the inside, multiply by the inside's derivative.
  • Work from the outermost layer inward.
  • It's behind u-substitution and implicit differentiation.

Try it: Derivative Calculator

Differentiate functions step by step using the power, product, quotient and chain rules. Supports higher-order and partial derivatives.

Open calculator

Practice problems

Try each one first, then open the answer to check your work.

  1. 1.Differentiate .

    Show answer

    .

  2. 2.Differentiate .

    Show answer

    .

  3. 3.Differentiate .

    Show answer

    .

  4. 4.Differentiate .

    Show answer

    .

  5. 5.Differentiate .

    Show answer

    .

Key terms

Composite function
A function inside another, .
Inner function
The function that is applied first.
Outer function
The function applied to the result.
Implicit differentiation
Differentiating both sides of an equation, using the chain rule for .
Related rates
Rates of change linked through an equation.

Frequently asked questions

How do I spot when to use the chain rule?

Whenever something other than plain sits inside a function: inside a power, a root, a trig function, an exponential or a log.

What's the most common mistake?

Forgetting to multiply by the derivative of the inside. A quick check: if the inside is just , the extra factor is 1, so you can't miss it.

How does it connect to u-substitution?

u-substitution is the chain rule in reverse. Seeing inside an integral tells you to let .

What are related rates?

Problems where several quantities change with time. You differentiate an equation with respect to , using the chain rule on every variable.

How do I differentiate $y$ in an implicit equation like $x^2 + y^2 = 25$?

Differentiate both sides, treating as a function of : , so .

What's the derivative of $2^x$?

Write . The chain rule gives .

What's the derivative of $\sin^2 x$?

It's , so , which equals .

How do I differentiate $e^{\sin x}$?

The outside is and the inside is , so the derivative is .

Is the chain rule the same as multiplying fractions?

In Leibniz notation, looks like cancelling . It isn't real fraction cancelling, but it's a good memory aid.

Related formulas

More calculus formulas