Ekuation

purpose

Chain Rule Calculator

Compute derivatives of composite functions step by step using the chain rule. Enter f(g(x)) and see the chain rule applied at every layer.

Back to Derivative Calculator

Enter a math expression using standard notation. Use * for multiplication, ^ for exponents.

Variable of differentiation. For partial derivatives, change to y, z, etc.

Derivative Calculator Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

Power Rule

Differentiate a polynomial using the power rule.

Key values: f(x) = x^3 - 2x^2 + x · 1st derivative

Chain Rule

Differentiate a composite function with sin(x^2).

Key values: f(x) = sin(x^2) · Chain rule applied

Product Rule with Tangent

Differentiate exp(x)*cos(x) and evaluate the tangent at x = 0.

Key values: f(x) = exp(x)*cos(x) · Tangent at x = 0

Second Derivative

Compute the second derivative to analyze concavity.

Key values: f(x) = x^4 - 6x^2 + 4 · 2nd derivative

Documentation

The Chain Rule

The chain rule differentiates composite functions — functions nested inside other functions. If y=f(g(x))y = f(g(x)), then:

dydx=f(g(x))g(x)\frac{dy}{dx} = f'(g(x)) \cdot g'(x)

In words: differentiate the outer function (leaving the inner function unchanged), then multiply by the derivative of the inner function.

Leibniz notation: If y=f(u)y = f(u) and u=g(x)u = g(x), then dydx=dydududx\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}. The dudu terms “cancel” — a useful mnemonic, though not rigorous.


Common Patterns

FunctionOuterInnerDerivative
sin(3x)\sin(3x)sin(u)\sin(u)3x3x3cos(3x)3\cos(3x)
ex2e^{x^2}eue^ux2x^22xex22x \, e^{x^2}
(2x+1)5(2x+1)^5u5u^52x+12x+110(2x+1)410(2x+1)^4
ln(cosx)\ln(\cos x)lnu\ln ucosx\cos xtanx-\tan x
1x2\sqrt{1 - x^2}u\sqrt{u}1x21 - x^2x1x2\frac{-x}{\sqrt{1-x^2}}

Multiple Layers (Triple Chain)

When three or more functions are nested, the chain rule extends naturally. For y=f(g(h(x)))y = f(g(h(x))):

dydx=f(g(h(x)))g(h(x))h(x)\frac{dy}{dx} = f'(g(h(x))) \cdot g'(h(x)) \cdot h'(x)

Example: sin(e3x)\sin(e^{3x})

ddxsin(e3x)=cos(e3x)e3x3=3e3xcos(e3x)\frac{d}{dx}\sin(e^{3x}) = \cos(e^{3x}) \cdot e^{3x} \cdot 3 = 3e^{3x}\cos(e^{3x})

Common Mistakes

  • Forgetting the inner derivative: ddxsin(3x)cos(3x)\frac{d}{dx}\sin(3x) \neq \cos(3x) — the factor of 3 from the inner function is essential.
  • Applying the chain rule when it's not needed: ddxsin(x)=cos(x)\frac{d}{dx}\sin(x) = \cos(x), not cos(x)1\cos(x) \cdot 1 (though technically correct, the ×1 is unnecessary).
  • Confusing with the product rule: sin(x2)\sin(x^2) needs the chain rule (composition); x2sin(x)x^2 \sin(x) needs the product rule (multiplication).

Frequently Asked Questions

What is the chain rule?

The chain rule differentiates composite functions f(g(x))f(g(x)). The derivative is f(g(x))g(x)f'(g(x)) \cdot g'(x): differentiate the outer function leaving the inner unchanged, then multiply by the derivative of the inner function.

How do I recognize when to use the chain rule?

Use the chain rule whenever you see a function nested inside another function. For example, sin(x2)\sin(x^2) is sin\sin applied to x2x^2, and e3xe^{3x} is the exponential applied to 3x3x. If the argument is anything other than plain xx, the chain rule applies.

What is the most common chain rule mistake?

The most common mistake is forgetting to multiply by the inner derivative. For example, ddx[sin(3x)]=cos(3x)×3\frac{d}{dx}[\sin(3x)] = \cos(3x) \times 3, not just cos(3x)\cos(3x). The factor of 3 from the inner function is essential.

How does the chain rule extend to triple composites?

For f(g(h(x)))f(g(h(x))), the derivative is f(g(h(x)))g(h(x))h(x)f'(g(h(x))) \cdot g'(h(x)) \cdot h'(x). Each layer contributes a factor. For example, ddx[sin(e3x)]=cos(e3x)e3x3\frac{d}{dx}[\sin(e^{3x})] = \cos(e^{3x}) \cdot e^{3x} \cdot 3.

How is the chain rule different from the product rule?

The chain rule applies to composition (one function inside another), like sin(x2)\sin(x^2). The product rule applies to multiplication (two functions multiplied together), like x2sin(x)x^2 \cdot \sin(x). Misidentifying composition as multiplication is a common error.

Related purpose Variants

Explore more purpose options

More Math Calculators

Explore the category

Calculator Search

Search and find calculators