Forward, backward and central formulas for the first derivative, their three- and five-point versions, the order of the error and a surprising numerical comparison.
The three basic formulas
With equally spaced nodes of step h, the first derivative is approximated looking forward (forward), backward (backward) or both sides (central). The central one is more accurate because it cancels the even term of the Taylor expansion.
f′(xi)≈hfi+1−fi+O(h)
Forward, order 1.
f′(xi)≈hfi−fi−1+O(h)
Backward, order 1.
f′(xi)≈2hfi+1−fi−1+O(h2)
Central, order 2.
Higher-order formulas
Using more nodes raises the order. The three-point ones reach O(h2) with information on only one side; the five-point central one reaches O(h4).