🧮

Chain Rule Calculator

Chain Rule Calculator

Supported patterns: (ax+b)^n, sin(ax+b), cos(ax+b), e^(ax+b), ln(ax+b), sqrt(ax+b)

Enter a composite function (e.g., (3x+2)^5) and click "Differentiate".

Our calculator shows the step‑by‑step derivation using the chain rule.

The Chain Rule Calculator is an essential online tool for mastering one of the most important differentiation techniques in calculus. It instantly computes the derivative of any composite function while showing each step of the process. Whether you are dealing with polynomials, trigonometric, exponential, or logarithmic functions, this calculator breaks down the chain rule application so you can learn or verify your work with confidence.

What is the Chain Rule?

The chain rule is a fundamental formula in calculus for differentiating the composition of two or more functions. If a function h is defined as h(x) = f(g(x)), then the derivative is given by h'(x) = f'(g(x)) × g'(x) . In words: differentiate the outer function, leaving the inner function unchanged, then multiply by the derivative of the inner function.

This rule is essential because many real‑world relationships are formed by combining simpler functions. For example, the position of a piston in an engine can be modelled as a sinusoidal function of time, which itself is a composite of trigonometric and linear functions. The chain rule allows us to find rates of change in such cases efficiently.

The Chain Rule Formula

d/dx[f(g(x))] = f'(g(x)) · g'(x)

Using Leibniz notation, if y = f(u) and u = g(x), then dy/dx = (dy/du) × (du/dx). This representation emphasises that the total derivative is the product of the derivative of the outer function with respect to the inner function and the derivative of the inner function with respect to the independent variable.

Key Definitions for Chain Rule Differentiation

Composite Function f(g(x))
A function created when one function is nested inside another (e.g. $(3x+2)^5$ where outer function is $u^5$ and inner function is $u = 3x+2$).
Leibniz Chain Rule Notation
The expression dy/dx = (dy/du) · (du/dx), emphasizing rate-of-change multiplication between outer and inner variable dependencies.
Inner & Outer Functions
The outer function $f(u)$ acts on the expression as a whole, while the inner function $g(x)$ operates directly on the independent variable $x$.

Common Chain Rule Differentiation Patterns Reference Table

Composite Pattern f(x)Outer Function f(u)Inner Function g(x)Derivative Formula f'(x)Calculus Example & Solution
(ax + b)ⁿuⁿax + bn · a · (ax + b)ⁿ⁻¹d/dx[(2x+3)⁴] = 8(2x+3)³
sin(ax + b)sin(u)ax + ba · cos(ax + b)d/dx[sin(4x+1)] = 4 cos(4x+1)
cos(ax + b)cos(u)ax + b-a · sin(ax + b)d/dx[cos(3x-2)] = -3 sin(3x-2)
tan(ax + b)tan(u)ax + ba · sec²(ax + b)d/dx[tan(2x)] = 2 sec²(2x)
e^(ax + b)e^uax + ba · e^(ax + b)d/dx[e^(2x-5)] = 2e^(2x-5)
ln(ax + b)ln(u)ax + ba / (ax + b)d/dx[ln(5x+7)] = 5 / (5x+7)
√(ax + b)√u = u¹ᐟ²ax + ba / (2√(ax + b))d/dx[√(3x+4)] = 3 / (2√(3x+4))
a^xa^uxa^x · ln(a)d/dx[2^x] = 2^x ln(2)
Why the Chain Rule Works (Intuition)

Suppose a car travels at 20 m/s, and a passenger inside the car walks forward at 2 m/s relative to the car. The passenger's speed relative to the ground is 20 m/s + 2 m/s = 22 m/s. In calculus terms, if we let F(t) be the passenger's position and G(t) be the car's position, the derivative (speed) satisfies dF/dt = (dF/dG) × (dG/dt) . The chain rule generalises this idea to any composition of differentiable functions.

In a more formal sense, the chain rule follows from the definition of the derivative and the fact that differentiable functions are locally linear. Multiplying the linear approximations of the two functions yields the linear approximation of their composition, which is exactly what the derivative represents.

Step‑by‑Step Guide to Using the Chain Rule

Applying the chain rule correctly is straightforward if you follow these steps:

  1. Identify the outer function – Look at the expression and determine which function is applied last. For (3x+2)⁵, the outer function is "to the fifth power".
  2. Identify the inner function – The inner function is what's inside the outer function. For (3x+2)⁵, the inner function is u = 3x+2.
  3. Differentiate the outer function with respect to the inner function – Treat the inner function as a variable. For u⁵, the derivative is 5u⁴.
  4. Differentiate the inner function with respect to the original variable – For u = 3x+2, the derivative is 3.
  5. Multiply them together – The final derivative is (5u⁴) × 3 = 15(3x+2)⁴.

For compositions of more than two functions, you apply the chain rule repeatedly, differentiating one layer at a time from the outermost to the innermost.

The chain rule also extends to partial derivatives in multivariable calculus. If z = f(x,y) and both x and y depend on t, then the total derivative dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt). This is especially useful in physics and engineering.

Frequently Asked Questions about the Chain Rule

What is the chain rule in calculus?
The chain rule is a fundamental formula for computing the derivative of the composition of two or more functions. If h(x) = f(g(x)), then h'(x) = f'(g(x)) × g'(x). In words: differentiate the outer function while keeping the inner function intact, then multiply by the derivative of the inner function.
How do you apply the chain rule step‑by‑step?
Step 1: Identify the outer function f(u) and inner function u = g(x). Step 2: Differentiate the outer function: f'(u). Step 3: Differentiate the inner function: g'(x). Step 4: Multiply them together: f'(g(x)) × g'(x). Step 5: Simplify the derivative.
When should I use the chain rule?
Use the chain rule whenever you need to differentiate a composite function – a function nested inside another function. Examples include (3x+2)⁵, sin(4x+1), e^(2x-5), ln(5x+7), and √(3x+4).
Can the chain rule be applied more than once (double chain rule)?
Yes! When dealing with triply composite functions like sin²(4x) = [sin(4x)]², apply the chain rule iteratively from the outermost layer to the innermost layer: d/dx[f(g(h(x)))] = f'(g(h(x))) × g'(h(x)) × h'(x).
What is Leibniz notation for the chain rule?
In Leibniz notation, if y = f(u) and u = g(x), then dy/dx = (dy/du) × (du/dx). This formulation visually highlights how rates of change multiply together.
What is the derivative of (ax + b)^n using the chain rule?
The derivative of (ax + b)ⁿ is n · a · (ax + b)ⁿ⁻¹. For instance, d/dx[(2x+3)⁴] = 4 · (2x+3)³ · 2 = 8(2x+3)³.
What is the derivative of e^(ax + b) using the chain rule?
The derivative of e^(ax + b) is a · e^(ax + b). For instance, d/dx[e^(3x-2)] = 3e^(3x-2).
How does the chain rule apply to partial derivatives in multivariable calculus?
In multivariable calculus, if z = f(x, y) where x = x(t) and y = y(t), the total derivative is dz/dt = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt).