🧮 Chain Rule Calculator
* for multiplication (2*x), ^ for powers (x^2), and function names like sin, cos, exp, ln, sqrt, asin, sinh…
sin(θ^2)
Instantly differentiate any composite function with a full algebraic walkthrough. Supports partial derivatives, multivariable functions, product & quotient rules, nested chain rule, and higher-order derivatives. Powered by a real Computer Algebra System — not a lookup table.
✓ Verified accurate · ✓ No login required · ✓ Private & offline-ready · ✓ Free chain rule solver with steps
* for multiplication (2*x), ^ for powers (x^2), and function names like sin, cos, exp, ln, sqrt, asin, sinh…
sin(θ^2)
Computing derivative…
The chain rule is the differentiation technique used whenever you need to differentiate a composite function — a function where one function is nested inside another. It is one of the five fundamental differentiation rules in calculus, alongside the power rule, product rule, quotient rule, and sum rule.
If you have a function h(x) = f(g(x)), the chain rule states:
The Chain Rule Formula
In Leibniz notation: dy/dx = (dy/du) · (du/dx), where u = g(x)
In plain language: differentiate the outer function while keeping the inner function unchanged, then multiply by the derivative of the inner function. Think of it as "peeling an onion" — you work from the outermost layer inward, multiplying derivatives at each layer.
The chain rule arises naturally from the definition of the derivative as a limit. When x changes by a small amount Δx, u = g(x) changes by approximately Δu = g′(x)·Δx, and y = f(u) changes by approximately Δy = f′(u)·Δu. Combining these: Δy/Δx ≈ f′(u)·g′(x), which becomes exact in the limit as Δx → 0 (provided g′(x) ≠ 0; the case g′(x) = 0 requires a more careful auxiliary-function argument). This informal reasoning captures the essential intuition behind the result.
The chain rule is needed whenever you can write your function as h(x) = f(g(x)). Look for these patterns:
This tool performs genuine symbolic differentiation — the same mathematical process you would carry out by hand. Here is exactly how to use it:
sin(x^2), e^(3*x), ln(x^2+1), (x^2+1)^5, x*sin(x).* for multiplication. Write 2*x, not 2x. Write e^(3*x), not e^3x. Use parentheses generously: sin(x^2) is unambiguous, but sin x^2 may be misread.
After calculating, the results panel shows:
The best way to master the chain rule is through carefully worked examples. Below are six examples ranging from basic to advanced, each with a complete step-by-step solution.
This requires applying the chain rule twice.
Knowing which rule to apply is as important as knowing how to apply it. The three "major" differentiation rules each handle a different structural situation.
| Rule | Structure | Formula | Example |
|---|---|---|---|
| Chain Rule | f(g(x)) — composition | f′(g(x)) · g′(x) | sin(x²), e^(3x) |
| Product Rule | f(x) · g(x) — multiplication | f′g + fg′ | x · sin(x) |
| Quotient Rule | f(x) / g(x) — division | (f′g − fg′) / g² | sin(x) / x |
| Power Rule | xⁿ — simple power | n · x^(n−1) | x³, x^(1/2) |
Many real-world calculus problems require combining rules. For d/dx[x²·sin(x³)]: the outermost operation is multiplication, so start with the product rule. Then the term d/dx[sin(x³)] requires the chain rule. Result: 2x·sin(x³) + x²·cos(x³)·3x² = 2x·sin(x³) + 3x⁴·cos(x³).
Wrong: d/dx[sin(x²)] = cos(x²)
Right: d/dx[sin(x²)] = cos(x²) · 2x = 2x cos(x²)
Fix: After differentiating the outer function, always ask yourself "what is the derivative of what's inside?"
Wrong order: For e^(x²), differentiating x² first to get 2x, then computing 2x·eˣ²
Right order: Outer first: derivative of eᵘ is eᵘ → e^(x²). Then multiply by inner derivative 2x → 2x·e^(x²)
Fix: Always work outside-in, never inside-out.
Unnecessary: d/dx[x³] = 3x² · 1 (technically correct but the ·1 is pointless)
Better: d/dx[x³] = 3x² by the plain power rule
The chain rule's inner derivative is 1 when the inner function is simply x — so it adds nothing.
Note: e^(x²) means "e raised to the power x²". Its derivative is e^(x²)·2x.
Not: (eˣ)^x² which is a completely different expression requiring logarithmic differentiation.
This table shows the chain rule derivative for the most frequently encountered outer functions. For each, u = g(x) is any differentiable inner function, and u′ = g′(x) is its derivative. Bookmark this as your chain rule "cheat sheet."
| Outer Function f(u) | Chain Rule Derivative | Example (u = x²+1) |
|---|---|---|
| sin(u) | cos(u) · u′ | cos(x²+1) · 2x |
| cos(u) | −sin(u) · u′ | −sin(x²+1) · 2x |
| tan(u) | sec²(u) · u′ | sec²(x²+1) · 2x |
| eᵘ | eᵘ · u′ | e^(x²+1) · 2x |
| ln(u) | u′ / u | 2x / (x²+1) |
| uⁿ (power) | n · uⁿ⁻¹ · u′ | 5(x²+1)⁴ · 2x |
| √u = u^(1/2) | u′ / (2√u) | 2x / (2√(x²+1)) |
| asin(u) | u′ / √(1−u²) | 2x / √(1−(x²+1)²) |
| atan(u) | u′ / (1+u²) | 2x / (1+(x²+1)²) |
| sinh(u) | cosh(u) · u′ | cosh(x²+1) · 2x |
| cosh(u) | sinh(u) · u′ | sinh(x²+1) · 2x |
| aᵘ (exponential) | aᵘ · ln(a) · u′ | 2^(x²+1) · ln(2) · 2x |
The chain rule extends naturally to multivariable calculus. This calculator functions as a partial derivative chain rule calculator — simply select which variable to differentiate with respect to, and all other variables are treated as constants.
To find ∂/∂x of a multivariable composite function:
sin(x^2 + y^2))When z = f(x, y) and both x = x(t), y = y(t) depend on a parameter t, the multivariable chain rule gives:
Use this calculator to compute each partial derivative (∂z/∂x and ∂z/∂y) individually, then combine them analytically. For a full guide to multivariable applications, see our Complete Chain Rule Guide.
sin(x^2 + y) or exp(x*y). Select x to get ∂/∂x, select y to get ∂/∂y. The tool correctly treats unselected variables as constants during differentiation.
The chain rule is a formula for differentiating composite functions — functions where one function is nested inside another. If h(x) = f(g(x)), then h′(x) = f′(g(x)) · g′(x). It is one of the most important rules in differential calculus and is used whenever you encounter expressions like sin(x²), e^(3x+1), or (x²+1)⁵. For a comprehensive explanation with 20+ examples, see our Complete Chain Rule Guide.
Every result is computed live in your browser using math.js, a production-grade Computer Algebra System (CAS). There are no pre-stored answers. The engine performs genuine symbolic differentiation — the same mathematical process you would carry out by hand — and has been verified against standard calculus references for all supported function types. This is a real mathematical tool, not a demo.
Three things: privacy (your expressions are never sent to a server — everything runs in your browser), no paywall on steps (the full step-by-step solution is always free, unlike Wolfram's Pro requirement), and speed (zero network latency since computation is local). For a detailed side-by-side comparison, see our Chain Rule Calculator Guide.
Yes. Select any order from 1 to 10. The engine differentiates repeatedly and presents the final result with a step-by-step explanation. For example, the 4th derivative of sin(x) returns sin(x) because sin repeats on a 4-cycle of differentiation.
Yes. The engine handles any combination of rules automatically. Enter x*sin(x) and it applies the product rule. Enter sin(x)/x and it applies the quotient rule. Enter x*sin(x^2) and it combines the product rule with the chain rule. You do not need to specify which rule — the engine identifies the structure and applies the appropriate rules. Try our dedicated Product Rule Calculator or Quotient Rule Calculator for focused practice on those rules.
For any trig function with a composite argument: d/dx[sin(f(x))] = cos(f(x)) · f′(x). Similarly, d/dx[cos(f(x))] = −sin(f(x)) · f′(x). Examples: d/dx[sin(x²)] = 2x·cos(x²); d/dx[sin(3x)] = 3cos(3x); d/dx[cos(ln(x))] = −sin(ln(x))/x. The chain rule quick reference table above shows all trig derivatives in one place.
The "limit chain rule" refers to the fact that the chain rule itself is derived from limits. The rigorous proof uses the limit definition of the derivative and the squeeze theorem. It states: if g is differentiable at x and f is differentiable at g(x), then f∘g is differentiable at x and (f∘g)′(x) = f′(g(x))·g′(x). This calculator computes the symbolic result that the limit produces.
Use * for multiplication, ^ for powers, and function names like sin, cos, exp, ln, sqrt. Examples: sin(x^2), e^(3*x+1), ln(x^2+1), sqrt(x^2+4), x*sin(x). Always include parentheses around function arguments. For a full syntax guide, see the calculator guide.
Click the θ button in the variable selector, then type θ directly in your expression (you can copy-paste it). Example: type sin(θ^2) with θ selected as the variable. The calculator will correctly compute d/dθ[sin(θ²)] = 2θ cos(θ²).
Extensively. Engineers use it to model how vibrations propagate through systems. Physicists use it in quantum mechanics and thermodynamics. Economists use it for marginal analysis when cost depends on quantity, which depends on time. In machine learning, the chain rule is the mathematical foundation of backpropagation — the algorithm that trains every modern neural network. Without the chain rule, AI as we know it would not exist.
La regla de la cadena (chain rule) es una fórmula para derivar funciones compuestas. Si h(x) = f(g(x)), entonces h′(x) = f′(g(x)) · g′(x). En palabras: se deriva la función exterior manteniendo la interior sin cambios, luego se multiplica por la derivada de la función interior. Esta calculadora aplica la regla de la cadena automáticamente con solución paso a paso.
Every time this calculator produces a derivative, it is computing the result that the limit definition of the chain rule would produce — but symbolically, without approximation. Understanding the limit foundation is essential for calculus courses and for anyone who wants to know why the chain rule is true, not just how to apply it.
Let h(x) = f(g(x)). Suppose g is differentiable at x = a, and f is differentiable at g(a). The derivative of h at x = a is defined as the following limit:
Chain Rule — Limit Form
This limit equals f′(g(a)) · g′(a) — the chain rule formula.
The key idea is to multiply and divide by [g(x) − g(a)] — but only when g(x) ≠ g(a):
As x → a: the first factor approaches f′(g(a)) (derivative of f at g(a)), and the second factor approaches g′(a) (derivative of g at a). The product of the two limits gives f′(g(a)) · g′(a).
Let h(x) = sin(x²). We verify h′(x) = 2x cos(x²) using the limit definition:
When students search for a limit chain rule calculator, they are typically looking for one of two things: (1) a tool that can differentiate composite functions — which is exactly what this calculator does, computing the symbolic result of the chain rule limit — or (2) a calculator that can evaluate limits of composite functions using the chain rule for limits (which states: if f is continuous at L and limx→a g(x) = L, then limx→a f(g(x)) = f(L)). This calculator addresses use case (1) fully. For limits of composite functions, see our Limit Calculator.
Verified by Mathematics Experts. This tool was built and is maintained by the DerivativeCalculus.com Editorial Team — educators and mathematicians dedicated to making calculus accessible to every student. All derivative results are produced by the math.js open-source Computer Algebra System (CAS), a battle-tested engine trusted by millions of developers and educators worldwide.
How we ensure accuracy: Every supported function type (trigonometric, inverse trigonometric, hyperbolic, exponential, logarithmic, polynomial, rational) has been verified against standard calculus textbooks including Stewart's Calculus, Apostol's Mathematical Analysis, and Spivak's Calculus. Our Editorial Policy requires that all mathematical claims be independently verifiable by standard CAS tools.
Privacy guarantee: Your browser computes every derivative locally. No function you enter ever leaves your device. We log page visits for analytics (Google Analytics) but never the content of your calculations.
Expand your calculus toolkit with these free tools and deep-dive guides from DerivativeCalculus.com. Each resource is designed to complement the chain rule — from foundational concepts to advanced applications.