Watch on Instagram

Math Bytes · Calculus · Episode 8 · "Derivatives: chain rule and advanced topics"

The chain rule

The chain rule finds the derivative of a function inside another function: take the derivative of the outside, leaving the inside alone, then multiply by the derivative of the inside. dy/dx = f′(g(x)) · g′(x).

Posted · About a 1 minute watch, 2 minute read · Take the quiz

Two layers

Some functions have another function stuck inside them. In (3x + 1)² there are two layers:

  • the outside layer is the squaring, ( )²
  • the inside layer is 3x + 1

The power rule alone can't handle this, because what's being squared isn't just x.

The chain rule

If y = f(g(x)), then

dy/dx = f′(g(x)) · g′(x)

In words: outside′(inside) × inside′. Take the derivative of the outside function, but keep the inside expression sitting in it untouched. Then multiply by the derivative of the inside.

Worked example

Find the derivative of y = (3x + 1)², and its value at x = 1.

  1. Outside: the power rule on ( )² gives 2( ). Leave the inside alone: 2(3x + 1).
  2. Inside: the derivative of 3x + 1 is 3.
  3. Multiply: dy/dx = 2(3x + 1) · 3 = 6(3x + 1).
  4. At x = 1: 3 · 1 + 1 = 4, so dy/dx = 6 · 4 = 24.

Check by expanding: (3x + 1)² = 9x² + 6x + 1, whose derivative is 18x + 6. At x = 1: 18 + 6 = 24. Same answer.

Try it yourself

  1. Find the derivative of (5x − 2)². What is it at x = 1?
  2. Find the derivative of (x² + 1)³.

(Answers: 1. 2(5x − 2) · 5 = 10(5x − 2), which is 30 at x = 1. 2. 3(x² + 1)² · 2x = 6x(x² + 1)².)

Good to know

  • "Leaving the inside alone" means the outside derivative is evaluated at the inside expression, not at x: 2(3x + 1), not 2x.
  • With more layers, keep peeling: multiply by one more inside derivative for each layer.
  • Leibniz form: if y = f(u) and u = g(x), then dy/dx = dy/du · du/dx.
  • Checks: outside′ of (3x + 1)² is 2(3x + 1), inside′ is 3, product 6(3x + 1), and 24 at x = 1.

Answer to the comment question

y = (2x + 1)³. What's dy/dx at x = 0? dy/dx = 6. Outside: 3(2x + 1)². Inside: the derivative of 2x + 1 is 2. So dy/dx = 3(2x + 1)² · 2 = 6(2x + 1)². At x = 0: 6 · 1² = 6. Check by expanding: (2x + 1)³ = 8x³ + 12x² + 6x + 1, derivative 24x² + 24x + 6, which is 6 at x = 0.

Test your knowledge

Quick quiz: The chain rule

4 multiple-choice questions. Pick one answer for each, then check how you did.

1In (3x + 1)², what is the inside layer?
2What does the chain rule say dy/dx is for y = f(g(x))?
3What is the derivative of (3x + 1)²?
4What is the slope of y = (3x + 1)² at x = 1?

Sources

Video transcript

How do you take the derivative of a function stuck inside another function?

Take (3x + 1)². There's an outside layer, the squaring, and an inside layer, 3x + 1.

The chain rule says peel it like an onion. Take the derivative of the outside, leaving the inside alone. Then multiply by the derivative of the inside.

Outside: the power rule gives 2(3x + 1). Inside: the derivative of 3x + 1 is 3.

Multiply: 6(3x + 1). At x = 1, that's 6 · 4, which is 24.

Your turn. y = (2x + 1)³. What's the derivative at x = 0? Comment your answer below!

That's your byte.

More from Calculus

All Calculus lessons