Math

Derivative Calculator

The derivative, computed honestly: central difference at a point with the O(h²) error law named, the second derivative by its three-point stencil, the tangent line, and the h-ladder that shows convergence happening.

Derivative Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

The function and the point
f′(x)
—
f″(x)—
Tangent line—
The h-ladder—
The method—

What this result does not account for

  • Numeric to ~6-10 true digits — not exact algebra
  • One point per run; no derivative PLOT or symbolic form
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Sana Khalid IEEE-754 Double Precision

In short: f(x) = x³ at x = 2: the central difference (f(2+h) − f(2−h))/(2h) with h = 1e-5 gives 12.000000 — and the exact law 3x² agrees: 12. The second derivative (f(x+h) − 2f(x) + f(x−h))/h² reads 12.000012, honest about its larger error. The tangent line is y = 8 + 12(x − 2), which is y = 12x − 16. No symbolic algebra on this page — the numbers are measured, and the h-ladder shows the measurement converging.

Formula

f′(x) ≈ (f(x+h) − f(x−h)) / 2h · error O(h²)

f″(x) ≈ (f(x+h) − 2f(x) + f(x−h)) / h²

the slope of the through-the-point line, measured from both sides so the errors cancel to first order.

Worked Example

  1. Parse. the expression rides the site grammar — numbers, x, + − × ÷ ^, parentheses, juxtaposition, the function set — with trig in RADIANS.
  2. Measure. evaluate at x−h and x+h (h = 1e-5) and divide the rise by 2h; the two-sided trick cancels the first-order error, leaving O(h²).
  3. Show the ladder. the same measurement at h = 1e-2 down to 1e-6 — watch the estimates settle toward the slope. The second derivative runs its own stencil.

The ladder is the honesty card: for x³ at 2 the estimates run 12.010001 (h = 1e-2), 12.000001 (h = 1e-4), 12.000000 (h = 1e-6) — error shrinking like h², exactly as the law promises. If the estimates never settle, the function is telling you something (a kink, a pole) and the page prints what it saw.

Strengths & Limits Of This Model

Where this engine is strong

  • The h-ladder shows convergence honestly instead of asserting accuracy
  • Refuses poles and kinks by refusing to print a number the measurement did not support

Where it stops

  • No symbolic derivative
  • No higher derivatives past the second

Risk & accuracy notice. A numeric derivative is a measurement with an error bar, not an algebraic identity: near kinks or very large curvature the six printed digits can flatter the truth, and quoting them as exact where a symbolic derivative exists is misuse. The ladder card exists so the reader can see how settled the number actually is.

Practical Use Cases

Slopes of curves

instantaneous rate where algebra has no formula

Checking symbolic work

differentiate by hand, confirm numerically

Optimization prep

where f′ crosses zero, maxima live

Methodology & Editorial Standards

Expression parsed with the site grammar (radians, live variable x). First derivative by central difference with h = 1e-5; second derivative by the three-point stencil with h = 1e-3; the h-ladder prints the central estimate at h = 1e-2, 1e-3, 1e-4, 1e-5. Non-finite evaluations at the measurement points are refused with the failing side named. No symbolic differentiation is attempted.

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Sana Khalid Principal Front-End Engineer · ApexConverter

Numerical methods and floating-point precision engineering. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Derivative Calculator — 9 Expert FAQs

9 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why numeric instead of symbolic?

Scope, stated plainly: this page measures instead of transforming. A symbolic engine rewrites x³ into 3x² by algebra rules; this page evaluates your expression at two nearby points and divides — which works for ANY expression the grammar accepts, including ones with no tidy symbolic derivative. The cost is honest: answers carry ~6 to 10 true digits, not infinity.

Why does the central difference beat a plain slope?

Because its errors cancel to first order. The forward difference (f(x+h) − f(x))/h carries an error of order h; taking measurements SYMMETRICALLY at x−h and x+h makes the two first-order error terms equal and opposite, leaving order h² — the ladder card shows the squared shrinkage live. Same three function calls, dramatically better answer.

Why not make h even smaller?

There is a floor, and it is arithmetic’s fault, not the method’s: doubles carry about 16 digits, so once h is tiny enough, f(x+h) and f(x−h) differ by fewer digits than the subtraction can hold, and rounding noise drowns the signal. h = 1e-5 sits near the sweet spot where truncation error (h² ≈ 1e-10) and round-off balance.

How does the second derivative work?

Three points, one stencil: (f(x+h) − 2f(x) + f(x−h))/h². It is the discrete version of curvature — how the SLOPE itself changes across the interval. Its error is also O(h²) but with a bigger constant, and the division by h² amplifies rounding, which is why the card prints fewer trustworthy digits than the first derivative does. Honest, per card.

What is the tangent line telling me?

The best LINEAR stand-in for your function at the point: y = f(x₀) + f′(x₀)(x − x₀). On the default that is y = 12x − 16 — and near x = 2 the cubic hugs that line tight. This is the whole idea of differential calculus in one card: smooth things look locally like lines.

Why radians for trig?

Because the derivative of sin x is cos x ONLY in radians — in degrees a factors-of-π correction contaminates every slope. The site’s solver and this page share the radians convention, stated on the card, so sin at 0 gives slope 1 exactly.

What does the page do at points where f is undefined?

It refuses with the reason. If f(x−h) or f(x+h) is not finite — sqrt of a negative just left of the point, a division by zero at a pole — the measurement cannot be taken, and printing a number anyway would be fabrication. The refusal names which side failed.

Which expressions can I type?

The site’s full grammar: numbers, x, + − × ÷ ^, parentheses, juxtaposition (2x, 3(x+1)), factorial, and sqrt abs ln log exp sin cos tan — the same one the Scientific Calculator and Equation Solver speak. Powers are right-associative, division by zero refuses with a message, and the variable is x.

Where is the derivative zero, and why does it matter?

Where the tangent goes horizontal — peaks, valleys, and pauses. Drive x^3 - 3*x and hunt: f′ = 0 near x = ±1. This page measures the slope at any point you name, so a small search over x finds them numerically even when the algebra never could — that is the practical heart of optimization.

Related Math Engines