Explore modules

Numerical Differentiation

Compare forward and central differences with the analytic derivative.

Free theory article

Compare forward and central differences with the analytic derivative.

Concept & interpretation

Numerical differentiation estimates the derivative of a mathematical function using values from the function itself. When an analytical derivative is unavailable or difficult to compute, we use finite differences.

Experiment: Compare Methods

Open the Numerical Differentiation module.

  1. Set Function to Cubic, Evaluation x to 1 and Step h to 0.5. Read derivative 3, forward 4.75 and central 3.25, with signed errors 1.75 and 0.25.
  2. Inspect the amber chord from x to x + h and the indigo chord between x − h and x + h. The tangent and forward chord pass through (x, f(x)); the central chord need not.
  3. Set Evaluation x to −1 and Step h to 0.25. Read forward 2.3125, central 3.0625 and derivative 3; the forward signed error is negative.
  4. Set Step h to 0. Its positive-step error replaces both finite estimates; the input is not clamped.
  5. Set Evaluation x to 0 and Step h to 1. Both finite estimates are 1 while the analytic derivative is 0.
  6. Set Evaluation x to 2, keeping Step h = 1. The stencil reaches x = 3; read forward 19, central 13 and derivative 12 without clipping that sampled input to 2.
  7. Choose Function = Sine, Evaluation x = 0 and Step h = 0.5. Both estimates are approximately 0.95885107721, below derivative 1. Angles are radians.
  8. Return to Cubic, Evaluation x = 1 and Step h = 0.001. Inspect the small signed errors. Pan and choose Reset view; inputs and results remain unchanged.
Read the full free theory article