🧮 Derivative 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. Powered by a real Computer Algebra System — not a lookup table.
✓ Verified accurate · ✓ No login required · ✓ Your data never leaves your browser · ✓ Works offline
* 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. This is why the chain rule is sometimes called the "composition derivative theorem."
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.
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)⁵.
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). Wolfram Alpha uses Mathematica, which has deeper simplification; for the vast majority of calculus problems students and engineers encounter, this calculator gives the same correct answer.
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.
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.
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.
Expand your calculus toolkit with these free tools: