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.

Calculate Derivative Supports: sin, cos, tan, exp, log, sqrt, and power functions.
Reference Table
$y$$y'$
$(ax+b)^n$$an(ax+b)^{n-1}$
$\sin(ax+b)$$a\cos(ax+b)$
$e^{ax+b}$$ae^{ax+b}$

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:

  1. Identify the inner function $u = g(x)$ – the expression “inside” the outer function.
  2. Identify the outer function $y = f(u)$ – the operation applied to the result of $g(x)$.
  3. Differentiate the outer function with respect to $u$: find $f'(u)$.
  4. 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$.
$$\frac{dy}{dx} = 5(3x+4)^4 \cdot 3 = 15(3x+4)^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)$.
$$\frac{dy}{dx} = \cos(2x^2) \cdot 4x = 4x\cos(2x^2)$$

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$.
$$\frac{dy}{dx} = e^{5x-1} \cdot 5 = 5e^{5x-1}$$

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$.
$$\frac{dy}{dx} = 4\sin^3(x^3) \cdot \cos(x^3) \cdot 3x^2 = 12x^2\sin^3(x^3)\cos(x^3)$$

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.

Frequently Asked Questions

When do I use the chain rule?
Use the chain rule whenever you differentiate a function that is a composition of two or more functions – for example, sin(x²), e^(3x), or (2x + 1)⁵. If an “inner” function sits inside an “outer” function, the chain rule applies.
What is the difference between the chain rule and the product rule?
The chain rule applies to nested (composed) functions like f(g(x)), while the product rule applies to two functions multiplied together, like f(x) · g(x). If a function is both a product and a composition, you may need both rules together.
Can the chain rule be used for higher-order derivatives?
Yes, but second and higher derivatives of composite functions become significantly more complex. You apply the chain rule repeatedly, often combining it with the product rule at each stage.
What is the chain rule for multivariable functions?
In multivariable calculus, the chain rule involves partial derivatives. If z depends on u and v, and both depend on t, then dz/dt = (∂z/∂u)(du/dt) + (∂z/∂v)(dv/dt). This is sometimes called the total derivative.
Does the calculator show step-by-step solutions?
Yes. The chain rule calculator above breaks down each differentiation step – identifying the outer and inner functions, computing their derivatives separately, and combining them into the final result.
Can I use the chain rule with trigonometric functions?
Absolutely. Common examples include d/dx[sin(3x)] = 3cos(3x) and d/dx[tan(x²)] = 2x·sec²(x). The trigonometric function is the outer function, and its derivative is evaluated at the inner function, then multiplied by the derivative of the inner function.
  1. Implicit Differentiation Calculator – Find dy/dx Instantly
  2. Derivatives in Calculator
  3. Derivative Calculator with Steps
  4. Partial Derivative Calculator
  5. Rate of Change Calculator – Free Online Tool
  6. Integration by Parts Calculator - Free Online Tool