Uni-Sine
MathematicsCalculus

The chain rule for differentiation

The chain rule is how you differentiate a function of a function, such as (4x − 3)⁶ or sin(x²). If y is a function of u, and u is a function of x, then dy/dx = dy/du × du/dx. In practice: differentiate the outside function, leave the inside alone, then multiply by the derivative of the inside.

The chain rule formula

There are two ways to write the chain rule. UK A-level textbooks mostly use the first, with a substitution u. US textbooks and calculators often use the second.

\frac{dy}{dx} = \frac{dy}{du} \times \frac{du}{dx}Leibniz notation, with u as the inside function
\frac{d}{dx}\left[f(g(x))\right] = f'(g(x)) \times g'(x)Function notation: outside derivative times inside derivative

They say the same thing. In y = (4x − 3)⁶, the inside function is u = 4x − 3 and the outside function is "raise to the power 6". The derivative of the outside is 6u⁵, and the derivative of the inside is 4, so dy/dx = 6(4x − 3)⁵ × 4 = 24(4x − 3)⁵.

The Leibniz form looks as if the du terms cancel, like fractions. They are not really fractions, but it is a fair way to remember the rule, and it extends to longer chains: dy/dx = dy/dv × dv/du × du/dx.

How to use the chain rule

  1. Spot the inside function and call it u. It is usually whatever is inside a bracket, under a root, in a power of e or inside sin, cos or ln.
  2. Write y in terms of u. For example, y = u⁶.
  3. Differentiate both: find dy/du and du/dx.
  4. Multiply them, then put u back in terms of x.

With practice you will skip the u and do it in one line: differentiate the outside with the inside left as it is, then multiply by the derivative of the inside.

When to use the chain rule

Use it whenever the thing being raised to a power, square rooted, put into e, ln, sin, cos or tan is anything other than plain x. Here is how to tell it apart from the other rules:

FunctionWhat it isRule
sin(x²)One function inside anotherChain rule
x² sin xTwo functions multipliedProduct rule
sin x ÷ x²One function divided by anotherQuotient rule
(x² + 1)⁵A bracket raised to a powerChain rule
x⁵ + 1Plain powers of xNeither: differentiate term by term
x² e^(3x)A product, and e^(3x) is a compositeProduct rule and chain rule

Chain rule results worth knowing

These all come straight from the chain rule, with f(x) as the inside function. Learning them saves you writing out u every time.

FunctionDerivative
(ax + b)ⁿan(ax + b)ⁿ⁻¹
[f(x)]ⁿn f′(x) [f(x)]ⁿ⁻¹
√f(x)f′(x) ÷ 2√f(x)
e^f(x)f′(x) e^f(x)
ln f(x)f′(x) ÷ f(x)
sin f(x)f′(x) cos f(x)
cos f(x)−f′(x) sin f(x)
sin kxk cos kx

The graph shows why the inside derivative appears. Here x is the input and y = sin(3x). Squeezing sin x so that it repeats three times as often makes every slope three times as steep: at the origin sin x has gradient 1, but sin(3x) has gradient 3. That factor of 3 is the derivative of the inside, 3x.

y = \sin\left(3 x\right)
-3-2.5-2-1.5-1-0.50.511.522.53-1-0.50.51gradient 3 at the originpeak at π/6
Drag to pan, scroll to zoom. x from -3.14 to 3.14, y from -1.4 to 1.4.

Chain rule examples

Example 1: a bracket to a power

Differentiate y = (4x − 3)⁶.

Let u = 4x − 3, so y = u⁶. Then dy/du = 6u⁵ and du/dx = 4.

\frac{dy}{dx} = 6u^5 \times 4 = 24(4x - 3)^5

Do not expand the bracket first. (4x − 3)⁶ has seven terms, and the chain rule avoids all of them.

Example 2: a square root

Differentiate y = √(x² + 5) and find the gradient at x = 2.

Write the root as a power: y = (x² + 5)^(1/2). The outside derivative is ½(x² + 5)^(−1/2) and the inside derivative is 2x.

\frac{dy}{dx} = \frac{1}{2}(x^2 + 5)^{-\frac{1}{2}} \times 2x = \frac{x}{\sqrt{x^2 + 5}}

At x = 2, the gradient is 2 ÷ √9 = 2/3.

Example 3: an exponential

Differentiate y = e^(x² − 3x).

The derivative of e^u is e^u, so the outside part stays the same. Multiply by the derivative of the power, 2x − 3.

\frac{dy}{dx} = (2x - 3)e^{x^2 - 3x}

Example 4: a natural logarithm

Differentiate y = ln(3x² + 1).

The derivative of ln u is 1/u, then multiply by du/dx = 6x. The result is the inside derivative over the inside.

\frac{dy}{dx} = \frac{1}{3x^2 + 1} \times 6x = \frac{6x}{3x^2 + 1}

Example 5: a power of a trig function

Differentiate y = sin³x.

sin³x means (sin x)³, so the outside function is the cube and the inside is sin x.

\frac{dy}{dx} = 3(\sin x)^2 \times \cos x = 3\sin^2 x\cos x

Differentiate y = sin²(3x).

There are three layers here: squaring, then sine, then 3x. Differentiate each from the outside in and multiply them all.

\frac{dy}{dx} = 2\sin(3x) \times \cos(3x) \times 3 = 6\sin(3x)\cos(3x)

Using the double angle formula sin 2A = 2 sin A cos A, this simplifies to 3 sin(6x).

Example 7: the equation of a tangent

Find the equation of the tangent to y = (3x − 2)⁴ at the point where x = 1.

At x = 1, y = 1⁴ = 1. The chain rule gives dy/dx = 4(3x − 2)³ × 3 = 12(3x − 2)³, so the gradient at x = 1 is 12.

y - 1 = 12(x - 1)

The tangent is y = 12x − 11.

Example 8: connected rates of change

A circular ripple spreads out so that its radius increases at 3 cm per second. How fast is its area increasing when the radius is 10 cm?

Area and radius are linked by A = πr², and r depends on time t. The chain rule links the rates:

\frac{dA}{dt} = \frac{dA}{dr} \times \frac{dr}{dt} = 2\pi r \times 3

When r = 10, dA/dt = 2π × 10 × 3 = 60π, which is about 188 cm² per second. Rates of change questions in A-level Maths are the chain rule with a story around them: write down the rate you know, the rate you want and the formula that links the two quantities.

Try the chain rule yourself

This practice from the Calculus course starts with chain rule questions, then mixes in the product and quotient rules. Type the derivative, then press Mark to check it in the course.

Differentiate using the chain, product, or quotient rule.

Press Mark to have your answer marked in the Calculus course.

Why the chain rule works

Suppose a small change δx in x causes a small change δu in u, which in turn causes a small change δy in y. As long as δu is not zero, you can write:

\frac{\delta y}{\delta x} = \frac{\delta y}{\delta u} \times \frac{\delta u}{\delta x}

As δx tends to 0, δu tends to 0 too, and each fraction becomes a derivative. That gives dy/dx = dy/du × du/dx. Think of rates multiplying: if y changes 6 times as fast as u, and u changes 4 times as fast as x, then y changes 24 times as fast as x.

A useful special case follows from it: dy/dx = 1 ÷ (dx/dy). That is how you differentiate when x is given as a function of y, such as x = y³ + y.

Chain rule, product rule and quotient rule together

Harder questions mix the rules. Read the function from the outside in and ask what the last operation is.

  • If the last step is multiplying two parts, start with the product rule.
  • If the last step is dividing, start with the quotient rule.
  • If the last step is applying a function such as a power, root, e, ln or sin to something, start with the chain rule.

For y = x²(5x + 1)³, the last step is multiplying, so you use the product rule, and the chain rule appears inside it when you differentiate (5x + 1)³. Our Derivative Calculator shows which rule it uses at each step, which is a good way to check your reading of a function. For the full story, the Calculus course covers all three rules.

The chain rule in integration

Integration has a reverse chain rule: if you can spot a function multiplied by the derivative of its inside, the integral is the outside function. For example, the integral of 2x(x² + 1)⁴ is (x² + 1)⁵ ÷ 5 + c, which you can check by differentiating with the chain rule.

Common mistakes

  • Forgetting the inside derivative. The derivative of (4x − 3)⁶ is 24(4x − 3)⁵, not 6(4x − 3)⁵. Always multiply by du/dx.
  • Differentiating the inside as well as the outside in one go. The derivative of sin(x²) is 2x cos(x²), not cos(2x). Keep the inside unchanged in the outside derivative.
  • Reading sin²x as sin(x²). sin²x is (sin x)², which differentiates to 2 sin x cos x. sin(x²) differentiates to 2x cos(x²).
  • Losing a minus sign. The derivative of cos(5x) is −5 sin(5x).
  • Missing a layer. In a chain with three links, such as sin²(3x), there are three derivatives to multiply.
  • Using the chain rule on a product. x² sin x is a product, not a composite, so it needs the product rule.

Is the chain rule in the formula booklet?

No. This was checked against the A-level Maths formulae booklets in November 2026.

ExamChain rule given?Related results that are given
A-level Maths (AQA)NoDerivatives of tan x, sec x, cosec x and cot x, and the quotient rule
A-level Maths (Edexcel)NoDerivatives of tan kx, sec kx, cosec kx and cot kx, and the quotient rule

Neither booklet gives the chain rule, and neither gives the derivatives of sin, cos, e^x or ln x, so you must know those as well. The Edexcel booklet's results with kx, such as tan kx becoming k sec² kx, are the chain rule already applied for you.

Chain rule questions with answers

1. Differentiate y = (5x + 2)³.
dy/dx = 3(5x + 2)² × 5 = 15(5x + 2)²
2. Differentiate y = e^(4x²).
The inside is 4x², whose derivative is 8x.
dy/dx = 8x e^(4x²)
3. Differentiate y = ln(x² + 4x).
Inside derivative over inside:
dy/dx = (2x + 4) ÷ (x² + 4x)
4. Differentiate y = 1 ÷ (x³ + 1)².
Write y = (x³ + 1)⁻².
dy/dx = −2(x³ + 1)⁻³ × 3x² = −6x² ÷ (x³ + 1)³
5. Find the gradient of y = √(1 + 4x) at x = 2.
dy/dx = ½(1 + 4x)^(−1/2) × 4 = 2 ÷ √(1 + 4x)
At x = 2: 2 ÷ √9 = 2/3
6. Differentiate y = cos²x and simplify your answer.
y = (cos x)², so dy/dx = 2 cos x × (−sin x) = −2 sin x cos x
By the double angle formula, dy/dx = −sin 2x

Practise differentiation in a short timed paper

A-level Maths: Calculus gives you a short timed paper every day, with 8 questions worth 25 to 35 marks across differentiation and integration. The chain rule turns up in most of them, often hidden inside a product rule, tangent or rates of change question. In the US, the same practice opens as AP Calculus AB.

Paper resets in

Common questions

What is the chain rule in simple terms?
It is the rule for differentiating a function inside another function. Differentiate the outside function, keep the inside as it is, then multiply by the derivative of the inside.
What is the chain rule formula?
dy/dx = dy/du × du/dx, where u is the inside function. In function notation, the derivative of f(g(x)) is f′(g(x)) × g′(x).
How do you know when to use the chain rule?
When something other than plain x is raised to a power, square rooted, or put inside e, ln, sin, cos or tan. Examples are (2x + 1)⁴, √(x² + 3), e^(5x) and sin(x²).
What is the difference between the chain rule and the product rule?
The chain rule is for one function inside another, such as sin(x²). The product rule is for two functions multiplied, such as x² sin x. Many questions need both.
Why is it called the chain rule?
Because the derivatives link together like a chain. With several layers, you multiply one derivative for each link: dy/dx = dy/dv × dv/du × du/dx.
Is there a chain rule for integration?
Yes, in reverse. If an integral is a function of something multiplied by the derivative of that something, you can integrate it in one step. This is called the reverse chain rule, and integration by substitution is the general method behind it.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Derivative Calculator

    Differentiate any function and see each rule applied

    Open the tool
  • Learn it

    Calculus

    Differentiation, integration and the mathematics that drives physics and engineering

    Start the course
  • Test it

    A-level Maths: Calculus

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · CalculusReverse chain rule: integration by inspection, with examplesHow the reverse chain rule integrates functions like x(x² + 1)⁴ and 4x/(x² + 5) by inspection: the patterns, the adjust-the-constant method and examples.