Chain Rule Calculator
Every calculus student hits the same wall: differentiating a function like $\sin(x^2)$ or $e^{3x+1}$ is not a simple power or trig rule – it requires the chain rule. Getting the inner and outer functions mixed up leads to wrong answers and lost points. A reliable chain rule calculator eliminates that guesswork by showing every differentiation step.
What is the chain rule?
The chain rule is a differentiation rule for composite functions – functions formed by nesting one function inside another. If $y = f(g(x))$, where $g(x)$ is the inner function and $f$ is the outer function, the chain rule states:
$$\frac{dy}{dx} = f'(g(x)) \cdot g'(x)$$In words: differentiate the outer function (keeping the inner function unchanged), then multiply by the derivative of the inner function.
The German mathematician Wilhelm Gottfried Leibniz published the rule in 1676, and it remains one of the most frequently used tools in differential calculus.
How does the chain rule formula work?
The logic behind the formula is a ratio of tiny changes. If $y$ depends on $u$, and $u$ depends on $x$, then:
$$\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$$This Leibniz notation makes the rule intuitive – the intermediate $du$ “cancels,” linking the rate of change of $y$ with respect to $x$ through the intermediate variable $u$.
Step-by-step: how to apply the chain rule
Follow these four steps every time:
- Identify the inner function $u = g(x)$ – the expression “inside” the outer function.
- Identify the outer function $y = f(u)$ – the operation applied to the result of $g(x)$.
- Differentiate the outer function with respect to $u$: find $f'(u)$.
- Multiply by the derivative of the inner function: $g'(x)$.
Result: $\dfrac{dy}{dx} = f'(u) \cdot g'(x)$.
Chain rule examples
Example 1 – Power of a polynomial
Differentiate $y = (3x + 4)^5$.
- Inner function: $u = 3x + 4$, so $du/dx = 3$.
- Outer function: $y = u^5$, so $dy/du = 5u^4$.
Example 2 – Trigonometric composite
Find $dy/dx$ for $y = \sin(2x^2)$.
- Inner function: $u = 2x^2$, so $du/dx = 4x$.
- Outer function: $y = \sin(u)$, so $dy/du = \cos(u)$.
Example 3 – Exponential composite
Differentiate $y = e^{5x-1}$.
- Inner function: $u = 5x - 1$, so $du/dx = 5$.
- Outer function: $y = e^u$, so $dy/du = e^u$.
Example 4 – Multiple chain rule applications
Differentiate $y = \sin^4(x^3)$, which is $[\sin(x^3)]^4$.
This is a triple composition: power → sine → cube. Apply the chain rule twice:
- Outermost: $u^4 \to 4u^3$ where $u = \sin(x^3)$.
- Middle: $\sin(v) \to \cos(v)$ where $v = x^3$.
- Innermost: $x^3 \to 3x^2$.
The chain rule calculator handles these multi-layer compositions automatically, applying the rule at each nesting level.
Common chain rule derivatives to memorize
| Function $y$ | Derivative $y'$ |
|---|---|
| $(ax + b)^n$ | $an(ax+b)^{n-1}$ |
| $e^{ax+b}$ | $ae^{ax+b}$ |
| $\ln(ax+b)$ | $\dfrac{a}{ax+b}$ |
| $\sin(ax+b)$ | $a\cos(ax+b)$ |
| $\cos(ax+b)$ | $-a\sin(ax+b)$ |
| $\tan(ax+b)$ | $a\sec^2(ax+b)$ |
| $a^x$ | $a^x \ln a$ |
These patterns appear on nearly every calculus exam. Recognizing the inner linear function $ax + b$ lets you apply the chain rule instantly.
Chain rule combined with other rules
Many functions require the chain rule together with the product or quotient rule. For example:
$$y = x^2 \cdot \sin(3x)$$Here the product rule gives:
$$y' = 2x\sin(3x) + x^2 \cdot \cos(3x) \cdot 3$$The second term uses the chain rule to differentiate $\sin(3x)$.
Frequent mistakes
- Forgetting to multiply by the inner derivative. Differentiating $(2x+1)^3$ as $3(2x+1)^2$ without the factor of 2 is the most common error.
- Differentiating the inner function too early. Keep the inner function intact when you differentiate the outer one.
- Confusing the chain rule with the product rule. $\sin(x) \cdot \cos(x)$ is a product (use the product rule); $\sin(\cos(x))$ is a composition (use the chain rule).
Frequently asked questions
What is the chain rule in simple terms?
The chain rule tells you how to differentiate a “function inside a function.” You take the derivative of the outside (leaving the inside alone) and multiply by the derivative of the inside.
When should I use the chain rule versus the product rule?
Use the chain rule when one function is applied to another, like $\sin(x^2)$. Use the product rule when two functions are multiplied, like $x^2 \cdot \sin(x)$. Some problems need both.
What is the generalised power rule?
The generalised power rule is the chain rule combined with the power rule: $\dfrac{d}{dx}[g(x)^n] = n \cdot g(x)^{n-1} \cdot g'(x)$. It handles expressions like $(x^2 + 1)^7$.
Can the chain rule handle logarithmic functions?
Yes. For $y = \ln(g(x))$, the derivative is $y' = \dfrac{g'(x)}{g(x)}$. For instance, $\dfrac{d}{dx}[\ln(5x+2)] = \dfrac{5}{5x+2}$.
How does the chain rule extend to three or more nested functions?
If $y = f(g(h(x)))$, apply the rule iteratively: $y' = f'(g(h(x))) \cdot g'(h(x)) \cdot h'(x)$. Each layer contributes one factor to the product.
Is the chain rule the same as the “outside-inside” rule?
Yes – “outside-inside” is a common classroom nickname for the chain rule. You differentiate the outside function first (holding the inside unchanged), then multiply by the derivative of the inside function.
This article is for educational purposes. Verify critical calculations with your instructor or a textbook, especially for exam-level problems.