Finite difference coefficient

In mathematics, to approximate a derivative to an arbitrary order of accuracy, it is possible to use the finite difference.

A finite difference can be central, forward or backward.

This table contains the coefficients of the central differences, for several orders of accuracy and with uniform grid spacing:[1] For example, the third derivative with a second-order accuracy is where

represents a uniform grid spacing between each finite difference interval, and

These are given by the solution of the linear equation system where the only non-zero value on the right hand side is in the

An open source implementation for calculating finite difference coefficients of arbitrary derivates and accuracy order in one dimension is available.

[2] Given that the left-hand side matrix

is a transposed Vandermonde matrix, a rearrangement reveals that the coefficients are basically computed by fitting and deriving a

-th order polynomial to a window of

-th order derivative of a fully determined Savitzky–Golay filter with polynomial degree

For this, open source implementations are also available.

[3] There are two possible definitions which differ in the ordering of the coefficients: a filter for filtering via discrete convolution or via a matrix-vector-product.

The coefficients given in the table above correspond to the latter definition.

The theory of Lagrange polynomials provides explicit formulas for the finite difference coefficients.

are generalized harmonic numbers.

This table contains the coefficients of the forward differences, for several orders of accuracy and with uniform grid spacing:[1] For example, the first derivative with a third-order accuracy and the second derivative with a second-order accuracy are while the corresponding backward approximations are given by To get the coefficients of the backward approximations from those of the forward ones, give all odd derivatives listed in the table in the previous section the opposite sign, whereas for even derivatives the signs stay the same.

arbitrary stencil points

up to one less than the number of stencil points, the finite difference coefficients can be obtained by solving the linear equations [6] where

is the Kronecker delta, equal to one if

: The order of accuracy of the approximation takes the usual form

(or better in the case of central finite difference).

[citation needed]