The chain rule is the method for differentiating a function nested inside another function. When one quantity depends on a middle step, and that middle step depends on xx, the total rate of change is the product of the two layer-by-layer changes.

When To Reach For The Chain Rule

Use the chain rule whenever the expression is a composition: an outer function wrapped around an inner expression. If y=f(g(x))y = f(g(x)), with gg differentiable at xx and ff differentiable at g(x)g(x), then

ddxf(g(x))=f(g(x))g(x)\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)

The reason it works is that a composite changes in two layers. A small change in xx first changes the inner expression g(x)g(x), and that change in g(x)g(x) then changes the outer value f(g(x))f(g(x)). The rule simply multiplies the outer change by the inner change. You need it for powers of expressions like (x2+4x1)7(x^2 + 4x - 1)^7, trig functions like sin(5x)\sin(5x) or cos(x3)\cos(x^3), exponentials and logs like ex2e^{x^2} or ln(1+x4)\ln(1 + x^4), and implicit differentiation, where several chain-rule steps often stack up at once. You do not need it when there is no composition: x3+1x^3 + 1 requires no extra inner derivative.

The Steps

  1. Identify the inner function. Find the expression inside the outermost function and give it a temporary name if that clarifies the structure.
  2. Differentiate the outer function. Differentiate the outside while keeping the inner expression in place.
  3. Differentiate the inner function. Compute the derivative of the inside expression with respect to xx.
  4. Multiply and simplify. Multiply the two derivatives, then substitute the original inner expression back if you used a temporary variable.

A Full Run-Through

Differentiate:

y=(3x2+1)5y = (3x^2 + 1)^5

Identify the inner and outer functions:

u=3x2+1,y=u5u = 3x^2 + 1, \qquad y = u^5

Differentiate the outer function:

dydu=5u4\frac{dy}{du} = 5u^4

Differentiate the inner function:

dudx=6x\frac{du}{dx} = 6x

Multiply the two derivatives:

dydx=dydududx=5u46x\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} = 5u^4 \cdot 6x

Substitute u=3x2+1u = 3x^2 + 1 back:

dydx=30x(3x2+1)4\frac{dy}{dx} = 30x(3x^2 + 1)^4

That last factor, the 6x6x, is the part people most often forget.

Where Each Step Goes Wrong, And How To Check

The first step fails when you misidentify the outer function. In sin(x2)\sin(x^2), the outer function is sin()\sin(\cdot), not the square, so name the inner expression carefully before doing anything else. The second and fourth steps fail when you differentiate the outer function and stop too early; for (3x2+1)5(3x^2 + 1)^5, writing 5(3x2+1)45(3x^2 + 1)^4 is only half the derivative. The third step fails when you apply the chain rule to something that is not a composition at all.

There is one fast self-check that catches almost all of these. After differentiating a composite, ask: did the derivative of the inner expression show up somewhere in the answer? If g(x)g'(x) is missing, the chain-rule step is almost certainly incomplete. Run that check on a fresh case: differentiate y=(2x3)4y = (2x - 3)^4, naming the inner function first. If your final answer does not contain the derivative of 2x32x - 3, redo the last step and find where the factor vanished.

Frequently Asked Questions

When do I use the chain rule?
Use the chain rule whenever one function is nested inside another, such as powers, trig functions, exponentials, or logs of expressions.
What is the most common chain rule mistake?
The most common mistake is differentiating the outer function and forgetting to multiply by the derivative of the inner expression.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →