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.

Central finite difference

This table contains the coefficients of the central differences, for several orders of accuracy and with uniform grid spacing:
DerivativeAccuracy−5−4−3−2−1012345
12−1/201/2
141/12−2/302/3−1/12
16−1/603/20−3/403/4−3/201/60
181/280−4/1051/5−4/504/5−1/54/105−1/280-
221−21
24−1/124/3−5/24/3−1/12
261/90−3/203/2−49/183/2−3/201/90
28−1/5608/315−1/58/5−205/728/5−1/58/315−1/560-
32−1/210−11/2
341/8−113/80−13/81−1/8
36−7/2403/10−169/12061/300−61/30169/120−3/107/240
421−46−41
44−1/62−13/228/3−13/22−1/6
467/240−2/5169/60−122/1591/8−122/15169/60−2/57/240
52−1/22−5/205/2−21/2
541/6−3/213/3−29/6029/6−13/33/2−1/6
56−13/28819/36−87/3213/2−323/480323/48−13/287/32−19/3613/288
621−615−2015−61
64−1/43−1329−75/229−133−1/4
6613/240−19/2487/16−39/2323/8−1023/20323/8−39/287/16−19/2413/240

For example, the third derivative with a second-order accuracy is
where represents a uniform grid spacing between each finite difference interval, and.
For the -th derivative with accuracy, there are central coefficients. 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 -th row.
An open source implementation for calculating finite difference coefficients of arbitrary derivates and accuracy order in one dimension is available.

Forward finite difference

This table contains the coefficients of the forward differences, for several orders of accuracy and with uniform grid spacing:
DerivativeAccuracy012345678
11−11
12−3/22−1/2
13−11/63−3/21/3
14−25/124−34/3−1/4
15−137/605−510/3−5/41/5
16−49/206−15/220/3−15/46/5−1/6
211−21
222−54−1
2335/12−26/319/2−14/311/12
2415/4−77/6107/6−1361/12−5/6
25203/45−87/5117/4−254/933/2−27/5137/180
26469/90−223/10879/20−949/1841−201/101019/180−7/10
31−13−31
32−5/29−127−3/2
33−17/471/4−59/249/2−41/47/4
34−49/829−461/862−307/813−15/8
35−967/120638/15−3929/40389/3−2545/24268/5−1849/12029/15
36−801/80349/6−18353/1202391/10−1457/64891/30−561/8527/30−469/240
411−46−41
423−1426−2411−2
4335/6−31137/2−242/3107/2−1917/6
4428/3−111/2142−1219/6176−185/282/3−7/2
451069/80−1316/1515289/60−2144/510993/24−4772/152803/20−536/15967/240

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

Backward finite difference

In general, to get the coefficients of the backward approximations, give all odd derivatives listed in the table the opposite sign, whereas for even derivatives the signs stay the same.
The following table illustrates this:
DerivativeAccuracy−8−7−6−5−4−3−2−10
11 −11
12 1/2−23/2
13 −1/33/2−311/6
21 1−21
22 −14−52
31 −13−31
32 3/2−712−95/2
41 1−46−41
42 −211−2426−143

Arbitrary stencil points

For a given arbitrary stencil points of length with the order of derivatives, the finite difference coefficients can be obtained by solving the linear equations
where the are the Kronecker delta.
Example, for, order of differentiation :
The order of accuracy of the approximation takes the usual form.