Numerical differentiation: Difference formulas for the first derivative
General difference formulas
The difference formulas presented earlier have been introduced via Taylor's theorem. In some applications it is necessary to use difference formulas with a higher accuracy (think of rounding errors) or with grid points that are not equidistantly distributed. Here we will present a method to derive new difference formulas. The 3-point and 5-point central difference formulas are special cases of derivatives computed through a Savitsky-Golay filter.
The general approach for different grid points , which differ from each other by a multiple of the step size , is to find coefficients such that the expression
The description above is rather cryptic, but examples make this systematic approach clear.
The 3-point central difference formula We consider 3 grid points , and . We define the formula
One-sided 3-point difference formulas The left-sided 3-point difference formula:
We take 3 grid points , and . We define the formula
Similarly, you can also find the right-sided 3-point difference formula:
The 5-point central difference formula
We consider 5 grid points , , , and . We define the formula