🧮

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.

Common Chain Rule Patterns

Function f(x)Derivative f'(x)
(ax+b)^nn*(ax+b)^(n-1) * a
sin(ax+b)a*cos(ax+b)
cos(ax+b)-a*sin(ax+b)
tan(ax+b)a*sec²(ax+b)
e^(ax+b)a*e^(ax+b)
ln(ax+b)a/(ax+b)
√(ax+b)a/(2√(ax+b))
a^(x)a^x * ln(a)
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 formula for computing the derivative of the composition of two or more functions. If a function h is defined as h(x) = f(g(x)), then the derivative is h'(x) = f'(g(x)) * g'(x). In other words, differentiate the outer function, leaving the inner function unchanged, 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 and the inner function g. Step 2: Differentiate the outer function with respect to the inner function: f'(g(x)). Step 3: Differentiate the inner function with respect to x: g'(x). Step 4: Multiply them together: f'(g(x)) × g'(x). Step 5: Simplify the result if possible.
When should I use the chain rule?
Use the chain rule whenever you need to differentiate a composite function – a function inside another function. Examples include (x²+1)³, sin(3x), e^(2x), ln(5x), √(x²+1), and many more.
Can the chain rule be applied more than once?
Yes. When a function is composed of three or more functions, apply the chain rule repeatedly. For example, sin²(4x) = [sin(4x)]² is a composition of u², u=sin(v), v=4x. Differentiate one layer at a time.
What is the 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 makes it clear that the derivative of the composition is the product of the derivatives of the individual functions.
What does the chain rule calculator do?
This chain rule calculator instantly differentiates a wide range of composite functions, showing every step of the process. It supports polynomials, trigonometric, exponential, logarithmic, and square root functions.