Differentiation methods

How to Use the Chain Rule: Steps and Examples

A composite function changes in layers. The outer layer responds to a change in its input, while the inner layer controls how quickly that input changes. The chain rule multiplies those two rates.

Direct answer

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

Use the chain rule when one differentiable function is evaluated inside another differentiable function.

Chain rule or product rule?

Look at the top-level operation before differentiating. A function evaluated at another function is a composition; two function factors multiplied together form a product.

Ask first 1

Can the expression be written as f(g(x))?

What to do

Use the chain rule: differentiate the outer function at g(x), then multiply by g′(x).

Ask first 2

Are two x-dependent factors multiplied?

What to do

Use the product rule first, then apply the chain rule inside either composite factor.

Ask first 3

Are there three or more nested layers?

What to do

Differentiate one layer at a time from outside to inside and multiply every layer rate.

Worked method: y=(x²+1)³

Name the inner function u=x²+1 and the outer function y=u³. This separation prevents the inner derivative from being lost.

Differentiate the outer function with respect to u: dy/du=3u². Differentiate the inner function with respect to x: du/dx=2x.

Multiply and substitute u back: dy/dx=(3u²)(2x)=6x(x²+1)². This is not the product rule because the original expression is a composition, not a product of two functions.

1
u = x² + 1, y = u³
2
dy/du = 3u², du/dx = 2x
3
dydx=6 x (x2+1)2\frac{\mathrm{d}y}{\mathrm{d}x} = 6\,x\,\left(x^{2} + 1\right)^{2}

Worked examples

ddx[sin⁡(x2)]\frac{\mathrm{d}}{\mathrm{d}x}\left[\sin\left(x^{2}\right)\right]
2x cos(x²)

Cosine is the outer derivative; 2x is the inner derivative.

ddx[e3 x+1]\frac{\mathrm{d}}{\mathrm{d}x}\left[e^{3\,x + 1}\right]
3 e3 x+13\,e^{3\,x + 1}

The exponential remains and the inner derivative contributes 3.

ddx[(ln⁡x)2]\frac{\mathrm{d}}{\mathrm{d}x}\left[\left(\ln x\right)^{2}\right]
2 ln⁡xx\frac{2\,\ln x}{x}

Differentiate the square, then the logarithm, with x>0 in real calculus.

Common mistakes

  • • Differentiating only the outer function and forgetting to multiply by the inner derivative.
  • • Using the product rule merely because two layers are visible; composition and multiplication are different structures.
  • • Replacing the inner expression after differentiating instead of preserving it inside the outer derivative.

Error clinic: preserve the inner expression

Incorrect attempt

[sin(x²)]′ = cos(x²)

Why it fails

Only the outer sine was differentiated; the rate of change of x² is missing.

Correction

[sin(x²)]′ = 2x cos(x²)

Incorrect attempt

[(x²+1)³]′ = 3(x²+1)²

Why it fails

The outer power rule is correct, but the inner derivative 2x was omitted.

Correction

[(x²+1)³]′ = 6x(x²+1)²

Practice one layer at a time

Name the outer and inner functions before revealing the answer. The second problem requires three rates, not two.

ddx[ln⁡(x2+4)]\frac{\mathrm{d}}{\mathrm{d}x}\left[\ln\left(x^{2} + 4\right)\right]

Check before solving

Differentiate ln(u), then u=x²+4.

Reveal the reference answer

Reference answer

2 xx2+4\frac{2\,x}{x^{2} + 4}
ddx[sin⁡((x2+1)3)]\frac{\mathrm{d}}{\mathrm{d}x}\left[\sin\left(\left(x^{2} + 1\right)^{3}\right)\right]

Check before solving

Keep all three layers visible: sine, cube and quadratic.

Reveal the reference answer

Reference answer

6 x (x2+1)2 cos⁡((x2+1)3)6\,x\,\left(x^{2} + 1\right)^{2}\,\cos\left(\left(x^{2} + 1\right)^{3}\right)

Try the worked examples in the calculator

Each link opens the matching calculator with the expression, variable and required conditions already filled in.

Open the calculator without a preset: Chain rule calculator

References

Frequently asked questions

How can I recognize a composite function?+

Try naming an inner expression u. If the rest of the formula becomes a familiar outer function of u, the expression is composite.

Can a problem require both the product rule and chain rule?+

Yes. Apply the rule matching the top-level product first, then use the chain rule inside any composite factor.

Why must the inner expression stay unchanged?+

The outer derivative is evaluated at the original inner input. Only the separate multiplier records how quickly that input changes.

Conclusion

Read a composite derivative by layers. Preserve each inner input, multiply by every inner rate, and use the top-level operation to distinguish the chain rule from the product rule.

Compare usage plans