Asymptote Studios

Calculus Guide · Part 5

Mastering the Chain Rule

How to recognize composite functions, differentiate them with the outside-inside method, and avoid the most common mistake in all of calculus.

What the chain rule is for

The power rule tells you how to differentiate . The sine rule tells you how to differentiate sin(x). But neither, on its own, tells you how to differentiate sin(x²) — a function inside another function. That is what the chain rule is for: it is the tool for differentiating composite functions, and it shows up in more problems than any other differentiation rule.

Formally, if y = f(g(x)), then:

y′ = f′(g(x)) · g′(x)

In words: differentiate the outer function while leaving the inside untouched, then multiply by the derivative of the inner function. That final multiplication is the part people forget, and forgetting it is probably the single most common error in introductory calculus.

How to recognize a composite function

Before you can apply the chain rule you have to notice that you need it. The telltale sign is that the argument of a function is something more complicated than a bare x. Compare:

  • sin(x) — plain function, no chain rule needed.
  • sin(x²) — the inside is , so the chain rule applies.
  • (x² + 1)³ — a whole expression raised to a power; the inside is x² + 1.
  • e^(2x) — the exponent is 2x, not x, so the chain rule applies.
  • ln(cos(x)) — a function of a function: the inside of the log is cos(x).

A useful habit: every time you write down a derivative, ask “is the thing inside this function just x?” If the answer is no, the chain rule owes you a factor.

The outside-inside method

Every chain rule problem reduces to three steps:

  1. Identify the outer function and the inner function.
  2. Differentiate the outside, keeping the inside exactly as it is.
  3. Multiply by the derivative of the inside.

That’s the whole rule. The difficulty in practice is never the rule itself — it is correctly spotting what counts as “outside” and “inside,” especially when the rule has to be applied more than once.

Worked examples

Example 1: sin(x²)

The outer function is sine; the inner function is . Differentiating the outside gives cos(x²) — note the inside stays put. The derivative of the inside is 2x. Multiply them:

d/dx[sin(x²)] = cos(x²) · 2x

Example 2: (x² + 1)³

Here the outer function is “cube it” and the inner function is x² + 1. The power rule on the outside gives 3(x² + 1)²; the derivative of the inside is 2x:

d/dx[(x² + 1)³] = 3(x² + 1)² · 2x = 6x(x² + 1)²

Example 3: e^(x²)

The exponential function is its own derivative, so differentiating the outside leaves e^(x²) unchanged. The inside contributes a factor of 2x:

d/dx[e^(x²)] = e^(x²) · 2x

Example 4: a double chain — ln(sin(x²))

Nothing stops a composite function from containing another composite function. Work from the outside in, one layer at a time. The log differentiates to one-over-its-argument: 1/sin(x²). The sine layer contributes cos(x²). The innermost layer contributes 2x:

d/dx[ln(sin(x²))] = (1/sin(x²)) · cos(x²) · 2x

Each layer of nesting adds exactly one factor to the product. If you peel the layers one at a time and never skip a step, a triple chain is no harder than a single one — just longer.

The mistakes to watch for

Every calculus student makes these at least once — the goal isn’t to never slip, it’s to recognize the slip quickly when it happens.

  • Dropping the inner derivative. Writing d/dx[sin(2x)] = cos(2x) and stopping. The correct answer is 2cos(2x) — the inside is 2x, and its derivative of 2 must come along.
  • Differentiating the inside of the outside. The outer derivative keeps the inner expression as is. d/dx[sin(x²)] begins with cos(x²), never cos(2x).
  • Confusing composition with multiplication. sin(x²) needs the chain rule; x² · sin(x) needs the product rule. Composition is one function applied to the output of another; a product is two functions multiplied side by side.

Practice with full solutions

Each of these opens a complete step-by-step solution where you can see the chain rule applied line by line:

Or try your own expression in the derivative calculator — it names every rule as it applies it, so you can check exactly where your work matches and where it doesn’t.

Mastering the Chain Rule | Derivative Calculator