Derivative Calculator
Compute f(a), f′(a), f″(a) and the tangent line at any point — with a graph of the function and its tangent.
Function and point
Syntax: + - * / ^ (power), functions sin cos tan exp log ln sqrt abs, constants pi e. Example: x^3 - 2*x.
How it works
Derivatives are computed numerically with Richardson extrapolation: the central difference (f(x+h) − f(x−h)) / 2h is evaluated at four shrinking step sizes (h = 10⁻³ down to 10⁻³/8) and combined to cancel the leading error terms, giving about 8 correct digits for smooth functions. f″(a) is found by applying the same procedure to the numerical derivative function itself, and the tangent line comes from y = f′(a)·(x − a) + f(a).
Frequently asked questions
How accurate is the numerical derivative?
For smooth functions you can expect roughly 8 correct decimal digits — far more than a homework problem needs. Accuracy degrades near kinks, cusps or discontinuities, where the true derivative may not even exist.
What happens if f is not differentiable at a?
Examples like abs(x) at x = 0 have no single tangent slope. The tool will either report that the derivative is not finite or return the average of the one-sided slopes — always sanity-check the graph before trusting the number.
Why does f″(a) take slightly longer?
Computing f″(a) means running the whole Richardson procedure on the derivative function, which itself evaluates f many times. It is still only a few hundred function calls — effectively instant.
Is anything I type sent to a server?
No. Parsing, differentiation and rendering all happen locally in your browser with plain JavaScript — nothing you type ever leaves your device.