Maths & numbers

Derivative calculator with steps and graph

Differentiate a function symbolically up to the fourth derivative, see each rule applied, and graph f, f′ and the tangent line.

Derivative calculator with steps and graph
Esc to restore

Your inputs

Use x, numbers, pi, e, + − * / ^ (or **), brackets and sin cos tan asin acos atan sinh cosh tanh exp ln log sqrt abs. 2x and 3(x+1) multiply. Up to 500 characters.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

Parses the expression into a tree with a recursive-descent parser (no eval), then applies the differentiation rules node by node: constant, sum, constant multiple, product (u·v)′ = u′v + uv′, quotient (u/v)′ = (u′v − uv′)/v², power (uⁿ)′ = n·uⁿ⁻¹·u′ for any constant n, the chain rule, (aᵘ)′ = aᵘ·ln a·u′, (ln u)′ = u′/u, log base 10, sin, cos, tan (sec² written as 1/cos²), asin, acos, atan, sinh, cosh, tanh, sqrt, abs (sign(u)·u′, undefined where u = 0) and general powers uᵛ by logarithmic differentiation, valid where u > 0. Each derivative is shown simplified and, for the first, exactly as the rules produce it. The simplifier only folds exact constants, removes 0 and 1, collects like terms and like powers (x²·x⁻¹ = x) and never expands or factorises, so equivalent answers can look different from a textbook. Values at the point are exact fractions when every step stays rational there, otherwise double precision; a value is reported only where f and all lower derivatives are defined. Implicit multiplication binds like *, so 1/2x means (1/2)·x. It does not do implicit, partial or numerical differentiation, integrals or limits.

How this is checked

5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    Function f(x) x^3*sin(x)Point for values and the tangent line (x =) 1
    Expected, and what Toolmoz gave
    First derivative expected 3*x^2*sin(x) + x^3*cos(x), Toolmoz 3*x^2*sin(x) + x^3*cos(x)Value of the first derivative expected 3.064715260291829, Toolmoz 3.064715260291829
    Where the expected answer comes from
    Product rule by hand: (x³ sin x)′ = 3x² sin x + x³ cos x; at x = 1 that is 3 sin 1 + cos 1 = 3.064715260291829 (Python math)
    Allowed difference
    ±1e-12 relative
  2. Case 2

    Inputs
    Function f(x) ln(x^2+1)Point for values and the tangent line (x =) 1
    Expected, and what Toolmoz gave
    First derivative expected 2*x/(x^2 + 1), Toolmoz 2*x/(x^2 + 1)Value of the first derivative expected 1, Toolmoz 1
    Where the expected answer comes from
    Chain rule by hand: (ln(x² + 1))′ = 2x/(x² + 1), which is 2/2 = 1 exactly at x = 1
    Allowed difference
    exact
  3. Case 3

    Inputs
    Function f(x) x^xPoint for values and the tangent line (x =) 2
    Expected, and what Toolmoz gave
    First derivative expected x^x*(ln(x) + 1), Toolmoz x^x*(ln(x) + 1)Value of the first derivative expected 6.772588722239782, Toolmoz 6.772588722239782
    Where the expected answer comes from
    Logarithmic differentiation by hand: ln y = x ln x, so y′ = xˣ(ln x + 1); at x = 2 that is 4(ln 2 + 1) = 6.772588722239782 (Python math)
    Allowed difference
    ±1e-12 relative
  4. Case 4

    Inputs
    Function f(x) atan(x)Highest derivative 2Point for values and the tangent line (x =) 1
    Expected, and what Toolmoz gave
    First derivative expected 1/(1 + x^2), Toolmoz 1/(1 + x^2)Second derivative expected -2*x/(1 + x^2)^2, Toolmoz -2*x/(1 + x^2)^2Value of the second derivative expected -0.5, Toolmoz -0.5
    Where the expected answer comes from
    Standard derivatives: (arctan x)′ = 1/(1 + x²) and its derivative −2x/(1 + x²)², which is −2/4 = −1/2 exactly at x = 1
    Allowed difference
    exact
  5. Case 5

    Inputs
    Function f(x) sqrt(1-x^2)Point for values and the tangent line (x =) 0.6
    Expected, and what Toolmoz gave
    First derivative expected -x/sqrt(1 - x^2), Toolmoz -x/sqrt(1 - x^2)Value of the first derivative expected -0.75, Toolmoz -0.75Tangent line expected y = -0.75*x + 1.25, Toolmoz y = -0.75*x + 1.25
    Where the expected answer comes from
    Chain rule by hand: (√(1 − x²))′ = −x/√(1 − x²); at x = 0.6, √0.64 = 0.8 so the slope is −0.6/0.8 = −0.75 and the tangent is y = 0.8 − 0.75(x − 0.6) = −0.75x + 1.25
    Allowed difference
    exact

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Function f(x)
x^3*sin(x)
Highest derivative
1
Point for values and the tangent line (x =)
1
Graph from x =
-3
Graph to x =
3

Example result

Read as
f(x) = x^3*sin(x)
First derivative
3*x^2*sin(x) + x^3*cos(x)
First derivative before simplification
3*x^(3 - 1)*1*sin(x) + x^3*(cos(x)*1)
Value of f
0.841470984808
Value of the first derivative
3.06471526029
Tangent line
y = 3.06471526029*x - 2.22324427548

Rules used: constant, sum, constant multiple, product, quotient, power (x^n with any constant n), chain rule, exponentials a^u and e^u, ln, log (base 10), trigonometric, inverse trigonometric and hyperbolic functions, sqrt, abs (derivative sign(u), undefined where u = 0) and general powers u^v by logarithmic differentiation (valid where u > 0). The simplified form folds exact constants, drops 0 and 1, collects like terms and like powers, and never expands brackets; the unsimplified form is exactly what the rules produce. Values are exact fractions when every step stays rational at that point, otherwise double precision. A value is reported only where f and all lower derivatives are defined, so where a formula breaks down (sign(0), division by zero) the derivative may still exist as a limit.