Key takeaways
- Chain rule: derivative of the outside (inside left alone) × derivative of the inside.
- In symbols: d/dx f(g(x)) = f′(g(x)) × g′(x).
- The #1 mistake is forgetting to multiply by the derivative of the inside.
- Use it whenever something more than plain x sits inside brackets, a sine, a root or an exponent.
In this guide
What is the chain rule?
A derivative measures how fast something changes. Sometimes one change causes another. Turn a bicycle pedal and the chain turns the back wheel. To know how fast the wheel spins, you multiply the two rates together. That is the chain rule.
In math, a function inside another function is called a composite function. In (x² + 1)³, the inside is x² + 1 and the outside is “something cubed”.
Why does the chain rule matter?
Almost every interesting function has something inside something else: sin(5x), e^(3x), √(x² + 9). Without the chain rule you could only differentiate the simplest formulas.
Rates multiply. If a gear turns 3 times for every pedal turn, and you pedal 2 turns per second, the gear turns 3 × 2 = 6 times per second.
The formula
| Symbol | What it means | Example with (x² + 1)³ |
|---|---|---|
| g(x) | The inside function | x² + 1 |
| f | The outside function | u³ |
| f′(g(x)) | Derivative of the outside, inside left untouched | 3(x² + 1)² |
| g′(x) | Derivative of the inside | 2x |
Multiply the last two rows: 3(x² + 1)² × 2x = 6x(x² + 1)².
This calculator handles functions of the form (a·xⁿ)ᵐ at a chosen x. The inside is a·xⁿ, the outside is “to the power m”, so the derivative is m(a·xⁿ)ᵐ⁻¹ × a·n·xⁿ⁻¹.
How to use the chain rule step by step
- 1Spot the inside and the outside. The inside is usually in brackets.
- 2Differentiate the outside. Treat the inside as a single letter u. For u³ that gives 3u².
- 3Put the inside back. 3u² becomes
3(x² + 1)². Don’t change the inside. - 4Multiply by the inside’s derivative.
3(x² + 1)² × 2x = 6x(x² + 1)². - 5Put in x if you need a number. At x = 1:
6 × 1 × 2² = 24.
Now try it yourself. Enter a, n, m and x in the calculator below and it will show the outside and inside parts separately.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Changing the inside while differentiating the outside. In step 2, the inside stays exactly as it was.
- Using the chain rule on a product.
x² × sin xis two functions multiplied, not one inside another. Use the product rule for that. - Stopping too early. Some functions have layers:
sin((2x + 1)³)needs the chain rule twice.
Tips and tricks
- Common patterns:
d/dx sin(5x) = 5cos(5x)andd/dx e^(3x) = 3e^(3x). See the derivative of sin(ax) and the derivative of eᵃˣ. - Linear insides are easy. If the inside is ax + b, the chain rule just multiplies by a.
- Backwards: run the chain rule in reverse and you get u-substitution for integrals.
Where you'll use it in real life
- Waves: sound and light are written as sin(ωt), so their rates need the chain rule.
- Growth and decay: population or medicine levels like e^(kt).
- Related rates: how fast a balloon’s radius grows as air is pumped in.
- Machine learning: training a neural network (“backpropagation”) is the chain rule applied layer by layer.
Quick summary
The chain rule differentiates a function inside a function: take the derivative of the outside, keep the inside the same, then multiply by the derivative of the inside. Use the calculator above to check any (a·xⁿ)ᵐ at a point, with both parts shown.
Worked example
The side of a square grows by 3 cm every second, so after x seconds the side is 3x cm and the area is (3x)². How fast is the area growing (in cm² per second) at x = 2 seconds? Here the inside is 3x¹ (a = 3, n = 1) and the outside is a square (m = 2).
- 01Let f(u) = u^2 and g(x) = 3x^1
- 02f'(u) = 2u^1
- 03g'(x) = 3x^0
- 04Chain Rule: d/dx = f'(g(x)) · g'(x)
- 05= 2(3x^1)^1 · 3x^0
- 06At x = 2: inner = 3 × 2^1 = 6
- 07outer deriv = 2 × 6^1 = 12
- 08inner deriv = 3 × 2^0 = 3
- 09Result = 12 × 3 = 36
These numbers are pre-filled in the calculator above.
Frequently asked questions
How do I know when to use the chain rule?
Use it whenever something more than plain x sits inside another function, such as inside brackets with a power, inside sin or cos, or in an exponent like e^(2x).
What is the derivative of (2x + 1)⁴?
Outside: 4(2x + 1)³. Inside derivative: 2. Multiply them to get 8(2x + 1)³.
What’s the difference between the chain rule and the product rule?
The chain rule is for a function inside another, like sin(x²). The product rule is for two functions multiplied, like x² × sin x.
What is the derivative of √(x² + 9)?
Write it as (x² + 9)^(1/2). Outside: (1/2)(x² + 9)^(−1/2). Inside derivative: 2x. Multiply to get x ÷ √(x² + 9).


