Numerical Methods & Scientific Computing

Finite Difference Derivative Calculator

Approximate f′(x) and f″(x) from function samples around an evaluation point. The calculator reports one-sided differences, a centered estimate and a Richardson-extrapolated first derivative.

How this tool works

Central first difference is [f(x+h)−f(x−h)]/(2h); central second difference is [f(x+h)−2f(x)+f(x−h)]/h². Richardson combines central differences at h and h/2 to cancel the leading O(h²) error term.

Example

For f(x)=sin(x) at x=1, compare the numerical first derivative with cos(1) while reducing h until truncation and floating-point error begin to balance.

Common questions

Why not make h extremely small?

Very small h reduces truncation error but eventually amplifies floating-point cancellation. The best h balances both effects.

Why is central difference usually better than forward difference?

For smooth functions, the standard central first derivative is second-order accurate, while the basic forward and backward differences are first order.