Derivative Calculator
Enter any function of x to get its symbolic derivative — not just polynomials. The calculator applies the chain rule, the product rule, the quotient rule and the standard derivatives of sin, cos, tan, exp, ln and roots, then simplifies the result.
An expression, not a number
Differentiation is rule-following. Each construction in an expression — a product, a quotient, a composition, a power — has a rule attached, and the derivative of anything built from them follows by applying those rules from the outside in. The difficulty is never conceptual; it is that a long expression needs many rules applied in order without a slip.
This calculator does that symbolically. It parses your function into a tree, differentiates it structurally, simplifies the result, and shows all three stages: what was differentiated, what the rules produced, and what it reduced to.
The output is f′(x) as a formula, valid for every x, rather than a slope at one point. That is what an algebra course asks for, and what you need when the derivative is an intermediate step: setting it to zero for turning points, substituting several values, or differentiating again.
Because the answer is symbolic, it is exact. No sampling is involved, so there is no error term to reason about and no ≈ in the output.
How to use this calculator
- Type the function in terms of x Use ^ for powers, * for multiplication, / for division, and named functions with brackets: sin(x), exp(x), ln(x). Multiplication must be explicit: 2*x, not 2x.
- Check the parsed function line The first output line echoes f(x) as the parser understood it, already lightly simplified. Comparing it with what you typed catches a missing bracket before it changes the answer.
- Read the rules line The middle step shows the derivative immediately after the rules are applied, before simplification. This form matches hand-working most closely, so it is where comparison with your own steps is most useful.
- Read the simplified derivative The final line is the same expression after algebraic reduction. It may look quite different from the middle line, and from your own answer, while remaining equivalent.
The formula, and where it comes from
d/dx[f(g(x))] = f′(g(x))·g′(x) d/dx[u·v] = u′v + uv′ d/dx[u/v] = (u′v − uv′)/v²
The chain rule is the one that does the most work. Any composition — sin(x²), exp(−x²), sqrt(1 + x²) — is differentiated by taking the derivative of the outer function at the inner one, then multiplying by the inner derivative. Every standard derivative is applied this way, so sin(u) produces cos(u)·u′ rather than just cos(u).
The product rule is implemented for any number of factors at once rather than being applied two at a time. A product of three factors gives three terms, in each of which exactly one factor has been differentiated — the natural generalisation of u′v + uv′.
Powers are handled in three distinct cases, chosen by where the variable appears. With the variable in the base only, the power rule applies: f^c becomes c·f^(c−1)·f′. With it in the exponent only, a^f becomes a^f·ln(a)·f′. When it appears in both, as in x^x, neither rule applies and the expression is first rewritten as exp(g·ln f), which the chain and product rules can then handle.
Standard derivatives are built in for sin, cos, tan, exp, ln, log, sqrt, cbrt, asin, acos and atan. The one deliberate exception is abs, rejected with an explicit message: it has a corner at zero and no derivative there.
What each input means
- f(x) Function — form field “Function f(x)”
- The expression to differentiate, in terms of x. It is parsed into a tree, so brackets determine the structure and therefore which rule applies where.
- x Variable
- Always x, and always the variable differentiated with respect to. Other letters are not treated as symbolic constants.
- f′(x) Derivative
- The result, as an exact expression valid wherever the function and its derivative are defined.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
A product that also needs the chain rule
Differentiate x·sin(x). Two factors, each with its own derivative, and no composition — the cleanest possible test of the product rule.
Inputs Function f(x) = x * sin(x)
- Function f(x) = sin(x)·x
- Apply differentiation rules cos(x)·1·x + sin(x)·1
- Simplify cos(x)·x + sin(x)
Result f'(x) = cos(x)·x + sin(x)
The rules line shows two terms, one with the x differentiated and one with the sin(x) differentiated, exactly as u′v + uv′ predicts. Reading it before the simplified line makes the rule application visible rather than implied.
The simplification then folds 1·sin(x) into sin(x). That kind of tidying is why the last line is shorter than the middle one, and why a correct hand-worked answer can look different from the final output while being the same expression.
A base and an exponent that both depend on x
Differentiate x^x. Neither the power rule nor the exponential rule applies, because the variable appears in both positions.
Inputs Function f(x) = x^x
- Function f(x) = x^x
- Apply differentiation rules exp(x·ln(x))·(1·ln(x) + x·1/x·1)
- Simplify exp(ln(x)·x)·(ln(x) + 1)
Result f'(x) = exp(ln(x)·x)·(ln(x) + 1)
Internally the expression is rewritten as exp(x·ln x) before anything is differentiated. That rewrite is what makes the problem tractable: the chain rule handles the exponential and the product rule handles the exponent.
The answer therefore contains a ln(x) term, which is the fingerprint of this rewrite. An answer of x·x^(x−1), obtained by applying the power rule as if the exponent were constant, is the classic wrong result here.
Reading the result
Why the answer may not match your form
Simplification is algebraic, not cosmetic, and does not aim for the form a textbook would print. An identity, a factorisation you would have taken, or a different grouping can make two correct answers look unrelated. Substituting one or two numeric values into both confirms they agree.
Where the derivative is valid
The expression returned holds wherever both the function and its derivative are defined. For ln(x) that is x > 0; for tan(x) it excludes odd multiples of π/2. The tool does not state the domain, so that restriction must be carried over from the original function.
When you would use this
Checking hand-worked differentiation
The intermediate rules line makes this useful rather than merely confirmatory. Where your answer differs, comparing against the pre-simplification form usually identifies which rule was misapplied.
Finding turning points and analysing behaviour
Critical points come from solving f′(x) = 0, which needs the derivative as an expression first. Differentiating the result again gives the second derivative, and with it the concavity.
Assumptions and limitations
What this calculator assumes
- The function is written in x alone, with explicit multiplication operators and bracketed function calls.
- Differentiation is with respect to x, and the result is exact rather than approximate.
- Every function used comes from the supported table; an unrecognised name is an error, not an unknown symbol.
Where it stops being the right tool
- First derivative only in one pass. A second derivative means feeding the output back in as a new input.
- One variable: partial derivatives, implicit differentiation and parametric derivatives are out of scope.
- The absolute value function is rejected outright, since it is not differentiable at zero.
Common mistakes
Dropping the inner derivative in a composition
Why it happens. Applying the outer rule feels like finishing the job, and the result looks plausible. sin(x²) becoming cos(x²) with no factor of 2x is the standard example.
How to avoid it. Compare against the rules line, where the inner derivative appears as a separate factor. If your answer differs from the tool's by exactly that factor, this is why.
Using the power rule when the variable is in the exponent
Why it happens. x^x looks like a power, so the power rule presents itself first. It only applies when the exponent is constant, which here it is not.
How to avoid it. Check where x appears. If it is in the exponent at all, the expression needs the exponential form — the tool's rewrite to exp(g·ln f) shows the route.
Reading a differently simplified answer as wrong
Why it happens. The final line is reduced by algebraic rules rather than towards a conventional textbook form, so a correct answer can look nothing like the printed one.
How to avoid it. Test equivalence numerically: substitute two or three values of x into both expressions. Agreement at several points is strong evidence.
Learn why this works
Frequently asked questions
Which functions are supported?
Any combination of +, −, *, / and ^ with sqrt, cbrt, sin, cos, tan, exp, ln, log, asin, acos and atan, applied to expressions in x. The absolute value is the one deliberate exclusion, because it has no derivative at zero.
Does it apply the chain rule automatically?
Yes. Every standard derivative is applied in its chain-rule form, so a composite such as sin(x²) or exp(−x²) picks up the derivative of its inner function as a factor without anything extra being requested.
How does it handle something like x^x?
When the variable appears in both the base and the exponent, no single power rule applies. The expression is rewritten as exp(x·ln x) first, and the chain and product rules then differentiate that form — which is why a logarithm appears in the answer.
Is the result exact?
Yes. The differentiation is symbolic throughout: the expression is manipulated structurally, not sampled. Where a numeric estimate is wanted at a particular point instead, the derivative-at-a-point calculator is the right tool.