Skip to main content
Mathovia

Calculus / Calculus 1 · Derivatives

Chain Rule

The chain rule differentiates a function inside another function, like (3x + 1)⁵ or sin(x²). Differentiate the outside function, leave the inside alone, then multiply by the derivative of the inside. It's the most used derivative rule in calculus.

Practice Problems
Written by
MPhil in Mathematics, Founder of Mathovia
Published

Mathematics verification: Mathematical formulas, calculations, worked examples and solutions are reviewed for accuracy before publication. How we check our work

How would you differentiate ? Expanding it gives six terms and a lot of arithmetic. And for or , expanding isn’t even an option. These are composite functions, one function inside another, and the chain rule handles all of them with the same short recipe. It’s the rule you’ll use more than any other for the rest of calculus.

The chain rule: the derivative of f of g of x equals f prime of g of x times g prime of x. In Leibniz notation, dy over dx equals dy over du times du over dx
The chain rule in function notation and in Leibniz notation

What Is the Chain Rule?

If , where is differentiable at and is differentiable at , then

In words: differentiate the outside function, leaving the inside exactly as it is, then multiply by the derivative of the inside. Writing the inside as gives the Leibniz form, which is easier to remember:

To use it you need to see the function as an outer layer wrapped around an inner one. That decomposition skill comes from function composition in algebra: is “raise to the fifth power” applied to .

Chain Rule Explanation: Why Rates Multiply

Three circles linked by arrows: x, then u, the inside function, then y, the outside function. u moves 3 per unit of x, so du over dx equals 3. y moves 2 per unit of u, so dy over du equals 2. Therefore y moves 2 times 3 equals 6 per unit of x, and dy over dx equals dy over du times du over dx
The chain rule is a multiplication of rates

Think of gears. If the middle gear turns 3 times for every turn of the first, and the last gear turns 2 times for every turn of the middle one, then the last gear turns times for every turn of the first. Rates along a chain multiply.

A composite function is exactly that kind of chain. Changing changes the inside , at a rate . Changing changes , at a rate . So changes with at the product of the two rates. That’s the whole idea; the formula is just bookkeeping.

Graphs of y equals sin x and y equals sin 2x crossing at the origin, each with its tangent line there. The tangent to sin x has slope cos 0 equals 1 and the tangent to sin 2x has slope 2 cos 0 equals 2. The inside 2x runs twice as fast, so every slope is multiplied by 2
Squeeze the input by 2 and every slope doubles

The picture shows it on a real graph. goes through its cycle twice as fast as , because its inside, , moves twice as fast as . So it’s twice as steep at every matching point: its derivative is , the outer derivative times the inner derivative 2.

How to Use the Chain Rule

Four steps for y equals 3x plus 1 to the fifth. Step 1, split it: outer u to the fifth, inner u equals 3x plus 1. Step 2, outer derivative: 5u to the fourth, keeping the inside, 5 times 3x plus 1 to the fourth. Step 3, inner derivative: 3. Step 4, multiply: y prime equals 15 times 3x plus 1 to the fourth
Split, differentiate the outside, differentiate the inside, multiply
  1. Split the function into an outer function and an inner one. Ask: “what’s the last thing I’d do if I were calculating this?” That’s the outer layer.
  2. Differentiate the outer function, keeping the inside untouched in its slot.
  3. Differentiate the inner function.
  4. Multiply the two results.

The most common mistake by far is stopping after step 2. The inner derivative is not optional: forgetting it is like saying the last gear turns twice per turn of the first gear because it turns twice per turn of the middle one.

The Chain Rule and the Power Rule Together

The most frequent use of the chain rule is a whole expression raised to a power. Combining it with the power rule gives the general power rule:

Bring the exponent down, lower it by one, keep the inside, then multiply by the derivative of the inside. For example, . Roots and fractions work too, once they’re rewritten as powers.

Example 1: A Power of a Linear Expression

Differentiate .

Outer: , derivative . Inner: , derivative 3.

Example 2: A Square Root

Differentiate .

Write it as . The outer derivative is and the inner derivative is :

Example 3: A Trig Function With a Non-Trivial Inside

Differentiate .

The outer function is sine, whose derivative is cosine; the inside stays put:

Compare , where the outer function is the square: its derivative is . Where the brackets go decides which layer is outside.

Example 4: Exponentials

Differentiate and .

Since , the exponential stays the same and gets multiplied by the derivative of its exponent:

Example 5: One Over a Power

Differentiate .

Rewrite as instead of reaching for the quotient rule:

Example 6: The Chain Rule With Three Functions

Nested boxes for y equals sin cubed of 2x, written as sin of 2x, all cubed. The outer box is the cube, the middle box is sine, and the inner box is 2x. Differentiate each layer, keeping what is inside it, and multiply: 3 sin squared 2x, times cos 2x, times 2, equals 6 sin squared 2x cos 2x
One derivative per layer, multiplied together

Differentiate .

Using the chain rule is like peeling an onion: work from the outside in, one layer at a time. Here there are three layers, the cube, the sine and :

The rule for any number of layers is the same: one derivative per layer, each with everything inside it left alone, all multiplied together.

Example 7: The Chain Rule With the Product Rule

Differentiate .

This is a product, so start with the product rule. The second factor needs the chain rule, but its inner derivative is just 1:

Factoring out the common is worth the effort: it shows the slope is zero at , and .

Example 8: Using a Table of Values

Suppose , and . Find the derivative of at .

The key step is that is evaluated at , not at 1. Exam tables often include a tempting value to catch exactly this.

Example 9: The Chain Rule With Logs

Differentiate .

Using :

For any , the derivative is the derivative of the something divided by the something itself.

Why the Chain Rule Works

The derivation of the chain rule starts from the average rate of change. If a small change causes a change in the inside, which causes a change in the outside, then

As , as well, because a differentiable function is continuous. The two fractions become and . (A fully rigorous proof also handles the case where is zero for small , but the idea is exactly this cancellation, which is why Leibniz notation makes the rule look so natural.)

Common Mistakes With the Chain Rule

  • Forgetting the inner derivative. is , not .
  • Changing the inside. The outer derivative keeps the inside as it is: , not .
  • Stopping one layer early with three or more layers. Count the layers and make sure you have that many factors.
  • Evaluating at the wrong point with tables: it’s , not .
  • Mixing up and . The first is a square of a sine; the second is a sine of a square.

Practice Problems

Try each one before opening the answer. The practice set has 12 more with instant checking.

Problem 1. Differentiate .

Show answer

.

Answer:

Problem 2. Differentiate .

Show answer

.

Answer:

Problem 3. Differentiate .

Show answer

.

Answer:

Problem 4. Differentiate .

Show answer

.

Answer:

Problem 5. If , and , find the derivative of at .

Show answer

.

Answer:

With the power, product, quotient and chain rules in hand, you can differentiate almost any formula built from powers. Next come the derivatives of trig functions, where the chain rule gets put to work straight away.

Frequently Asked Questions

What is the chain rule?+

The chain rule is the derivative rule for a composite function, one function inside another. If , then : the derivative of the outer function, evaluated at the inner function, times the derivative of the inner function. In Leibniz notation, .

How do you know when to use the chain rule?+

Use it whenever something other than plain sits inside a function: , , , , . If the inside is just , as in or , the inner derivative is 1 and the chain rule isn't needed.

How does the chain rule work?+

Rates of change multiply. If changes 3 times as fast as , and changes 2 times as fast as , then changes times as fast as . The chain rule is that multiplication: .

How do you use the chain rule with three functions?+

Work from the outside in and multiply one derivative per layer. For : the outer cube gives , the sine gives , and the inner gives 2, so the derivative is .

What is the difference between the chain rule and the product rule?+

The product rule is for two functions multiplied together, like . The chain rule is for one function inside another, like . Some functions need both, such as , which is a product whose second factor needs the chain rule.

What is the chain rule with the power rule?+

Combining the two gives the general power rule: . For example, .

Related lessons