Numerical Derivative Calculator
Compute approximate derivatives at a point using forward, backward, and central finite difference formulas with adjustable step size h.
Function Input
Supports: +, -, *, /, ^, sin, cos, tan, log, exp, sqrt, abs, PI, E
Formulas
Fwd: [f(x+h) − f(x)] / h
Bwd: [f(x) − f(x−h)] / h
Ctr: [f(x+h) − f(x−h)] / (2h)
Enter a function and click Calculate
Function Evaluations
f(x−h)
—
f(x)
—
f(x+h)
—
Derivative Approximations at x = —
Forward Difference
[f(x+h) − f(x)] / h
Order: O(h)
—
Backward Difference
[f(x) − f(x−h)] / h
Order: O(h)
—
Central Difference ★
[f(x+h) − f(x−h)] / (2h)
Order: O(h²) — most accurate
—
Agreement Between Methods
|Fwd − Ctr|
—
|Bwd − Ctr|
—
|Fwd − Bwd|
—
Central Difference vs Step Size h
| h | Central f′(x) |
|---|
Summary
Compute approximate derivatives at a point using forward, backward, and central finite difference formulas with adjustable step size h.
How it works
- The tool parses the function expression entered by the user into a safe JavaScript evaluator.
- It computes f(x), f(x+h), and f(x−h) using the given point and step size.
- Forward difference: [f(x+h) − f(x)] / h approximates f'(x) with O(h) error.
- Backward difference: [f(x) − f(x−h)] / h also has O(h) error.
- Central difference: [f(x+h) − f(x−h)] / (2h) is more accurate with O(h²) error.
- Results are displayed with up to 10 significant digits for comparison.
Use cases
- Verify analytical derivatives by comparing with numerical estimates.
- Approximate derivatives of functions that are difficult to differentiate by hand.
- Study the effect of step size on finite difference accuracy.
- Learn and teach numerical differentiation methods in calculus courses.
- Quick sanity-check during scientific computing or engineering work.
- Explore error behavior (truncation vs. round-off) as h varies.
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu