On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Introduction to Calculus · Grade 9-12

Chain Rule

The chain rule differentiates a composite function — a function nested inside another — by multiplying the outer derivative (evaluated at the inner) by the inner derivative.

(f∘g)′(x)=f′(g(x))⋅g′(x)

Quick Answer

The chain rule differentiates a composite function — a function nested inside another — by multiplying the outer derivative (evaluated at the inner) by the inner derivative. Use it whenever one function is plugged into another, such as (3x+1)5, sin⁡(x2) or 1+x2. If y depends on u and u depends on x, the rates multiply: dydx=dydu⋅dudx. So (3x+1)5 has derivative 5(3x+1)4⋅3=15(3x+1)4.

Why This Matters

Most functions that model real things are built in layers: a balloon's volume depends on its radius, which depends on time; a sound wave is the sine of something that keeps changing. The chain rule lets you differentiate any such stack one layer at a time. Without it, (3x+1)5 means expanding a fifth power by hand, and sin⁡(x2) cannot be done with the other rules at all.

Intuitive Explanation

Picture three gears in a row. Gear B turns 3 times for every turn of gear A, and gear C turns 5 times for every turn of B, so C turns 3×5=15 times for every turn of A. Rates of change of linked quantities multiply the same way. If u=3x+1, then u changes 3 times as fast as x; if y=u5, then y changes 5u4 times as fast as u. So y changes 5u4⋅3 times as fast as x.

The outer rate has to be measured where the outer function actually is, at the inner value. In sin⁡(x2) the outer function is sin⁡, whose rate is cos⁡, but taken at x2: the derivative is cos⁡(x2)⋅2x. Writing cos⁡x⋅2x reads the outer gear's speed at the wrong place.

Nesting is not the same as multiplying. sin⁡(x2) feeds x2 into sin⁡, so it needs the chain rule. x2sin⁡x puts two separate functions side by side and multiplies them, so it needs the product rule: 2xsin⁡x+x2cos⁡x. To tell them apart, think about the last step in computing the value for a given x: applying sin⁡ to a number means a composite, multiplying two results means a product. Some functions need both, such as xsin⁡(x2).

Think of it like this. The chain rule works like converting currency in two steps. If 1 euro buys 1.1 dollars and 1 dollar buys 150 yen, then 1 euro buys 1.1×150=165 yen: the rates multiply. Each layer of a composite is one exchange, with its derivative as the rate. Unlike exchange rates, these rates vary from point to point, so the outer one is read at the inner value.

Core idea. The chain rule differentiates a composite f(g(x)) as f′(g(x)) times g′(x), peeling layers from outside in.


When to Use

Use the chain rule when you can see an inside and an outside: a bracket raised to a power, (x2+1)3; a function applied to something other than plain x, such as sin⁡(3x) or e−x2; a square root of an expression. In word problems, look for a quantity that depends on another quantity that is itself changing over time. If two functions are multiplied side by side, use the product rule; if the base is plain x, the power rule alone is enough.

Tip. Ask: Is one function plugged into another, so I must multiply the outer derivative by the inner derivative?

How to Recognize It

Before differentiating, find what plain x has been replaced by: anything more than x inside a power, root, trig function or exponential is an inner layer.

  1. To evaluate the expression for a number, would you first work out something like 3x+1 and then apply a second step to that result?

    Yes means a composite, so the chain rule applies: the first step is the inner function and the second is the outer one. No, as in x5 or sin⁡x, means the power rule or a basic derivative is enough.

  2. Are two factors sitting side by side, like x2cos⁡x, rather than one inside the other?

    Side by side means the product rule; one inside the other, as in cos⁡(x2), means the chain rule. Many problems need both: x2cos⁡(3x) takes the product rule outside and the chain rule on cos⁡(3x).

  3. In a word problem, does one quantity depend on a second quantity that is itself changing with time?

    Yes, as when a balloon's volume depends on its radius and the radius grows, means the rates multiply: dVdt=dVdr⋅drdt. Problems built on this are related rates. With no middle quantity, an ordinary derivative is enough.

  4. Are you integrating rather than differentiating?

    Then the chain rule runs backwards as u-substitution: ∫2xcos⁡(x2) dx=sin⁡(x2)+C, because the inner derivative 2x is already present. The chain rule itself only ever differentiates.

Chain Rule compared with Product rule, Power rule alone, and u-Substitution

All four rows handle expressions built from more than one function, so they look alike. Ask how the pieces are joined: one inside another (chain rule), side by side (product rule), nothing but plain x under a power (power rule), or a composite inside an integral (u-substitution).

Chain Rule

Meaning
Use this when you are differentiating a composite where one function is plugged into another.
Key test
Is one function plugged into another, so I must multiply the outer derivative by the inner derivative?
Formula
(f∘g)′(x)=f′(g(x))⋅g′(x)
Example
Differentiate (x2+1)3.

Product rule

Meaning
Differentiates two functions multiplied together, not nested inside each other.
Key test
Use when functions are multiplied side by side, like x2sin⁡x, not composed.
Formula
(fg)′=f′g+fg′
Example
x⋅ex is a product; ex2 is a composite

Power rule alone

Meaning
Differentiates a power of x but ignores any inner function.
Key test
Use when the base is just x, like x5, with nothing nested inside.
Formula
ddxxn=nxn−1
Example
x5 needs only the power rule; (2x)5 needs the chain rule

u-Substitution

Meaning
The reverse of the chain rule, used inside integrals not derivatives.
Key test
Use when integrating a composite times its inner derivative.
Formula
∫f(g(x))g′(x) dx=∫f(u) du
Example
Integrating 2xcos⁡(x2)

Formula & Notation

(f∘g)′(x)=f′(g(x))⋅g′(x)
If g is differentiable at x and f is differentiable at g(x), then (f∘g)′(x)=f′(g(x))⋅g′(x).

How to read it: In Leibniz notation: dydx=dydu⋅dudx where y=f(u) and u=g(x).

Worked Examples

Example 1 — Composite power

Easy

Differentiate (x2+1)3.
Show the steps and the answer
  1. Split the layers: inner u=x2+1, outer y=u3.

    The bracket is computed first and then cubed, so cubing is the outer function.

  2. Differentiate each layer: dydu=3u2 and dudx=2x.

    Each derivative is the rate for one link in the chain.

  3. Multiply and put the inner back: 3(x2+1)2⋅2x=6x(x2+1)2.

    The outer rate is read at u=x2+1, not at x.

  4. Check at x=1: the formula gives 6⋅1⋅22=24. Expanding, (x2+1)3=x6+3x4+3x2+1 has derivative 6x5+12x3+6x, which is also 24 at x=1.

    Two methods agreeing at a test point would catch a dropped inner factor.

Answer: 6x(x2+1)2

Takeaway: Differentiate the outside at the inside, then multiply by the inside's derivative; the factor 2x is the inner layer's rate.

Example 2 — A product, not a composite

Standard

Differentiate x3⋅(x2+1).
Show the steps and the answer
  1. Look at the last step: x3 and x2+1 are each computed, then multiplied.

    Side-by-side factors make a product. Neither function is plugged into the other.

  2. Apply the product rule with f=x3 and g=x2+1: 3x2(x2+1)+x3(2x).

    Each factor's derivative times the other factor, added.

  3. Simplify: 3x4+3x2+2x4=5x4+3x2.

    Combine the two x4 terms.

  4. Check by expanding first: x5+x3 has derivative 5x4+3x2.

    The answers agree, which confirms the product rule was the right tool here.

Answer: 5x4+3x2

Takeaway: Multiplied functions get the product rule; nested functions get the chain rule. Ask which operation comes last.

Example 3 — Find the mistake: the missing inner factor

Application

Find the slope of y=4x2+9 at x=2. Kai writes: "y′=124x2+9, so the slope at x=2 is 110." Find the mistake and correct it.
Show the steps and the answer
  1. Split the layers: inner u=4x2+9, outer y=u=u1/2.

    The square root is applied last, so it is the outer function.

  2. Outer derivative at the inner: 12u=124x2+9.

    This is what Kai wrote, and it is only half of the chain.

  3. Multiply by the inner derivative dudx=8x: y′=8x24x2+9=4x4x2+9.

    Kai dropped this factor; every layer of a composite contributes its own rate.

  4. Evaluate at x=2: 4⋅216+9=85.

    The missing factor 8x equals 16 at x=2, which is why Kai's 110 is 16 times too small.

Answer: y′=4x4x2+9, and the slope at x=2 is 85.

Takeaway: After differentiating the outer layer, multiply by the derivative of whatever is inside it.

Where You'll See It

  • Blowing up a balloon

    A balloon's volume is V=43πr3, and its radius changes with time, so dVdt=4πr2⋅drdt. Pumping 100 cm³ of air per second when r=10 cm gives drdt=100400π≈0.08 cm/s. The bigger the balloon, the slower its radius grows for the same pumping rate.

  • Fuel burned per hour on a highway

    A car that uses 0.04 gallons per mile (25 miles per gallon) at 60 miles per hour burns 0.04×60=2.4 gallons per hour. Fuel depends on distance and distance depends on time, so the two rates multiply, exactly as dGdt=dGdm⋅dmdt.

  • Air temperature on a climbing plane

    In the standard atmosphere, air cools about 6.5 °C per kilometre of altitude. A plane climbing at 0.5 km per minute therefore sees the outside temperature fall at about 6.5×0.5=3.25 °C per minute: temperature depends on height, height depends on time.

Common Mistakes

  1. The slip: Forgetting the inner-derivative factor g′(x)

    Instead: every composite contributes a multiply-by-the-inside step.

  2. The slip: Evaluating the outer derivative at x instead of at g(x)

    Instead: f′ must be applied to the inner function, e.g. cos⁡(x2) not cos⁡x.

  3. The slip: Confusing nesting with multiplication

    Instead: sin⁡(x2) is composite (chain rule) while x2sin⁡x is a product (product rule).


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Find the derivative of f(x)=(3x−5)4.

    Hint: The outer function is a fourth power and the inner function is 3x−5.

  2. Find the derivative of y=sin⁡(5x2) with respect to x.

    Hint: Differentiate sine, keep 5x2 inside, then multiply by the derivative of 5x2.

  3. Let f(x)=x2+9. Find f′(4).

    Hint: Write the root as the power 12, then multiply by the derivative of x2+9.

  4. Differentiate cos⁡3(2x), which means (cos⁡2x)3.

    Hint: There are three layers: a cube, a cosine, and 2x. Multiply one derivative for each layer.

  5. You must differentiate x2cos⁡x and cos⁡(x2). Which one needs the chain rule?

    Hint: In which expression is x2 fed into the cosine?

  6. A student writes "ddxsin⁡(x3)=cos⁡(3x2)." Correct the work.

    Hint: The outer derivative keeps the original inside. Then what still has to be multiplied on?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

How do I handle three layers, like sin⁡2(5x)?

Read it as (sin⁡(5x))2(\sin(5x))^2 and peel from the outside in, multiplying one derivative per layer. The square gives 2sin⁡(5x)2\sin(5x), the sine gives cos⁡(5x)\cos(5x), and the 5x5x gives 5. So the derivative is 2sin⁡(5x)⋅cos⁡(5x)⋅5=10sin⁡(5x)cos⁡(5x)2\sin(5x)\cdot\cos(5x)\cdot5=10\sin(5x)\cos(5x). Each layer leaves its own inside untouched until that inside's turn comes, which is why cos⁡(5x)\cos(5x) still contains 5x5x.

Why is the derivative of sin⁡(2x) equal to 2cos⁡(2x) and not just cos⁡(2x)?

Because sin⁡(2x)\sin(2x) runs through its cycle twice as fast as sin⁡x\sin x: it completes a full wave over a length of π\pi instead of 2π2\pi. Squeezing a graph sideways by a factor of 2 makes every slope twice as steep, and the inner factor 2 from the chain rule is exactly that steepening. In general, ddxf(kx)=kf′(kx)\frac{d}{dx}f(kx)=kf'(kx).

Where does the chain rule show up outside a maths class?

Anywhere one rate feeds another. A car that uses 0.08 litres of fuel per kilometre while driving at 90 km per hour burns 0.08×90=7.20.08\times90=7.2 litres per hour: litres per kilometre times kilometres per hour. Machine-learning software applies the chain rule through every layer of a network, in a step called backpropagation, to work out how each setting affects the final error.

Do I have to write u for the inside every time?

No. Naming the inner part, say u=x3−2u=x^3-2, helps while you learn, because it makes the two derivatives dydu\frac{dy}{du} and dudx\frac{du}{dx} visible. With practice you can write ddx(x3−2)4=4(x3−2)3⋅3x2\frac{d}{dx}(x^3-2)^4=4(x^3-2)^3\cdot3x^2 in one line: derivative of the outside with the inside left alone, times the derivative of the inside. Both ways are correct; the letter only keeps track of the layer.

Learning Path

Chain Rule

You are here

Next →

Nothing after this yet
You need the Derivative (rate of change at a point) and Function Composition (feeding one function's output into another). The chain rule adds the multiply-the-rates step that differentiates any composite. No single concept comes next because this rule is used everywhere afterwards: related-rates problems, implicit differentiation, derivatives of ekx and ln⁡x, and, run backwards, u-substitution for integrals.

See Also