Central finite difference coefficients
edit · history · discussion · files · long url · analysis
Numbers
$m$
$r$
$j$ 
$a_{m,r,j}$
1
1
-1:
-1/2
comment: Accuracy order 2: $\tfrac{1}{2}(-1,0,1)$.
1
1
1:
1/2
1
2
-2:
1/12
comment: Accuracy order 4: $\tfrac{1}{12}(1,-8,0,8,-1)$.
1
2
-1:
-2/3
1
2
1:
2/3
1
2
2:
-1/12
1
3
-3:
-1/60
comment: Accuracy order 6: $\tfrac{1}{60}(-1,9,-45,0,45,-9,1)$.
1
3
-2:
3/20
1
3
-1:
-3/4
1
3
1:
3/4
1
3
2:
-3/20
1
3
3:
1/60
1
4
-4:
1/280
comment: Accuracy order 8: $\tfrac{1}{840}(3,-32,168,-672,0,672,-168,32,-3)$.
1
4
-3:
-4/105
1
4
-2:
1/5
1
4
-1:
-4/5
1
4
1:
4/5
1
4
2:
-1/5
1
4
3:
4/105
1
4
4:
-1/280
1
5
-5:
-1/1260
comment: Accuracy order 10: $\tfrac{1}{2520}(-2,25,-150,600,-2100,0,2100,-600,150,-25,2)$.
1
5
-4:
5/504
1
5
-3:
-5/84
1
5
-2:
5/21
1
5
-1:
-5/6
1
5
1:
5/6
1
5
2:
-5/21
1
5
3:
5/84
1
5
4:
-5/504
1
5
5:
1/1260
2
1
-1:
1
comment: Accuracy order 2: $(1,-2,1)$.
2
1
0:
-2
2
1
1:
1
2
2
-2:
-1/12
comment: Accuracy order 4: $\tfrac{1}{12}(-1,16,-30,16,-1)$.
2
2
-1:
4/3
2
2
0:
-5/2
2
2
1:
4/3
2
2
2:
-1/12
2
3
-3:
1/90
comment: Accuracy order 6: $\tfrac{1}{180}(2,-27,270,-490,270,-27,2)$.
2
3
-2:
-3/20
2
3
-1:
3/2
2
3
0:
-49/18
2
3
1:
3/2
2
3
2:
-3/20
2
3
3:
1/90
2
4
-4:
-1/560
comment: Accuracy order 8: $\tfrac{1}{5040}(-9,128,-1008,8064,-14350,8064,-1008,128,-9)$.
2
4
-3:
8/315
2
4
-2:
-1/5
2
4
-1:
8/5
2
4
0:
-205/72
2
4
1:
8/5
2
4
2:
-1/5
2
4
3:
8/315
2
4
4:
-1/560
2
5
-5:
1/3150
comment: Accuracy order 10: $\tfrac{1}{25200}(8,-125,1000,-6000,42000,-73766,42000,-6000,1000,-125,8)$.
2
5
-4:
-5/1008
2
5
-3:
5/126
2
5
-2:
-5/21
2
5
-1:
5/3
2
5
0:
-5269/1800
2
5
1:
5/3
2
5
2:
-5/21
2
5
3:
5/126
2
5
4:
-5/1008
2
5
5:
1/3150
3
2
-2:
-1/2
comment: Accuracy order 2: $\tfrac{1}{2}(-1,2,0,-2,1)$.
3
2
-1:
1
3
2
1:
-1
3
2
2:
1/2
3
3
-3:
1/8
comment: Accuracy order 4: $\tfrac{1}{8}(1,-8,13,0,-13,8,-1)$.
3
3
-2:
-1
3
3
-1:
13/8
3
3
1:
-13/8
3
3
2:
1
3
3
3:
-1/8
3
4
-4:
-7/240
comment: Accuracy order 6: $\tfrac{1}{240}(-7,72,-338,488,0,-488,338,-72,7)$.
3
4
-3:
3/10
3
4
-2:
-169/120
3
4
-1:
61/30
3
4
1:
-61/30
3
4
2:
169/120
3
4
3:
-3/10
3
4
4:
7/240
3
5
-5:
41/6048
comment: Accuracy order 8: $\tfrac{1}{30240}(205,-2522,14607,-52428,70098,0,-70098,52428,-14607,2522,-205)$.
3
5
-4:
-1261/15120
3
5
-3:
541/1120
3
5
-2:
-4369/2520
3
5
-1:
1669/720
3
5
1:
-1669/720
3
5
2:
4369/2520
3
5
3:
-541/1120
3
5
4:
1261/15120
3
5
5:
-41/6048
4
2
-2:
1
comment: Accuracy order 2: $(1,-4,6,-4,1)$.
4
2
-1:
-4
4
2
0:
6
4
2
1:
-4
4
2
2:
1
4
3
-3:
-1/6
comment: Accuracy order 4: $\tfrac{1}{6}(-1,12,-39,56,-39,12,-1)$.
4
3
-2:
2
4
3
-1:
-13/2
4
3
0:
28/3
4
3
1:
-13/2
4
3
2:
2
4
3
3:
-1/6
4
4
-4:
7/240
comment: Accuracy order 6: $\tfrac{1}{240}(7,-96,676,-1952,2730,-1952,676,-96,7)$.
4
4
-3:
-2/5
4
4
-2:
169/60
4
4
-1:
-122/15
4
4
0:
91/8
4
4
1:
-122/15
4
4
2:
169/60
4
4
3:
-2/5
4
4
4:
7/240
4
5
-5:
-41/7560
comment: Accuracy order 8: $\tfrac{1}{15120}(-82,1261,-9738,52428,-140196,192654,-140196,52428,-9738,1261,-82)$.
4
5
-4:
1261/15120
4
5
-3:
-541/840
4
5
-2:
4369/1260
4
5
-1:
-1669/180
4
5
0:
1529/120
4
5
1:
-1669/180
4
5
2:
4369/1260
4
5
3:
-541/840
4
5
4:
1261/15120
4
5
5:
-41/7560
5
3
-3:
-1/2
comment: Accuracy order 2: $\tfrac{1}{2}(-1,4,-5,0,5,-4,1)$.
5
3
-2:
2
5
3
-1:
-5/2
5
3
1:
5/2
5
3
2:
-2
5
3
3:
1/2
5
4
-4:
1/6
comment: Accuracy order 4: $\tfrac{1}{6}(1,-9,26,-29,0,29,-26,9,-1)$.
5
4
-3:
-3/2
5
4
-2:
13/3
5
4
-1:
-29/6
5
4
1:
29/6
5
4
2:
-13/3
5
4
3:
3/2
5
4
4:
-1/6
5
5
-5:
-13/288
comment: Accuracy order 6: $\tfrac{1}{288}(-13,152,-783,1872,-1938,0,1938,-1872,783,-152,13)$.
5
5
-4:
19/36
5
5
-3:
-87/32
5
5
-2:
13/2
5
5
-1:
-323/48
5
5
1:
323/48
5
5
2:
-13/2
5
5
3:
87/32
5
5
4:
-19/36
5
5
5:
13/288
6
3
-3:
1
comment: Accuracy order 2: $(1,-6,15,-20,15,-6,1)$.
6
3
-2:
-6
6
3
-1:
15
6
3
0:
-20
6
3
1:
15
6
3
2:
-6
6
3
3:
1
6
4
-4:
-1/4
comment: Accuracy order 4: $\tfrac{1}{4}(-1,12,-52,116,-150,116,-52,12,-1)$.
6
4
-3:
3
6
4
-2:
-13
6
4
-1:
29
6
4
0:
-75/2
6
4
1:
29
6
4
2:
-13
6
4
3:
3
6
4
4:
-1/4
6
5
-5:
13/240
comment: Accuracy order 6: $\tfrac{1}{240}(13,-190,1305,-4680,9690,-12276,9690,-4680,1305,-190,13)$.
6
5
-4:
-19/24
6
5
-3:
87/16
6
5
-2:
-39/2
6
5
-1:
323/8
6
5
0:
-1023/20
6
5
1:
323/8
6
5
2:
-39/2
6
5
3:
87/16
6
5
4:
-19/24
6
5
5:
13/240
Definition
For integers $m\geq1$ and $r\geq\lceil m/2\rceil$, the central finite difference coefficient $a_{m,r,j}$ is the rational coefficient of $f(x+jh)$ in the interpolatory formula $h^m f^{(m)}(x)\approx\sum_{j=-r}^{r}a_{m,r,j}f(x+jh)$ on the equally spaced offsets $-r,-r+1,\ldots,r$ [2] [1].
Parameters
$m$
—   derivative order ($m\geq1$)
$r$
—   stencil radius ($r\geq\lceil m/2\rceil$)
$j$
—   offset from the centre ($-r\leq j\leq r$)
Formulas
(1)
$\sum_{j=-r}^{r} a_{m,r,j}j^q=m!$ if $q=m$, and $\sum_{j=-r}^{r} a_{m,r,j}j^q=0$ for $0\leq q\leq2r$ with $q\neq m$.
(2)
The approximation $f^{(m)}(x)\approx h^{-m}\sum_{j=-r}^{r}a_{m,r,j}f(x+jh)$ has accuracy order $2r+1-m$ for odd $m$ and $2r+2-m$ for even $m$: its error is $O(h^{2r+1-m})$ or $O(h^{2r+2-m})$.
(3)
$a_{m,r,-j}=(-1)^m a_{m,r,j}$.
(4)
$a_{m,r,j}=\ell_{2r,\,r+j}^{(m)}(r)$, where $\ell_{d,i}(x)=\prod_{\substack{0\leq k\leq d\\ k\neq i}}\frac{x-k}{i-k}$ is the Lagrange basis polynomial for the nodes $0,1,\ldots,d$.
Comments
(5)
The coefficients do not depend on $h$, because $h^m$ is on the derivative side.
(6)
Offsets are listed from $-r$ to $r$, the same order as the function values in the formula. Symmetric duplicates are stored: $a_{m,r,-j}=(-1)^m a_{m,r,j}$, and a reader may hold either sign.
(7)
Rows with coefficient $0$ are omitted. Thus $a_{m,r,0}$ is absent for odd $m$.
(8)
These coefficients differentiate the interpolating polynomial on equally spaced nodes. Newton-Cotes weights integrate the same kind of interpolant, and the Lagrange basis polynomials for equally spaced nodes are the basis behind both constructions.
Programs
(P1)
Sage
import numberdb.sage as numberdb
from sage.arith.misc import factorial
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector
from sage.rings.rational_field import QQ

def central_difference_coefficients(m, r):
    offsets = list(range(-r, r + 1))
    rows = [[QQ(j) ** q for j in offsets] for q in range(2 * r + 1)]
    rhs = [QQ(factorial(m)) if q == m else QQ(0) for q in range(2 * r + 1)]
    return dict(zip(offsets, matrix(QQ, rows).solve_right(vector(QQ, rhs))))

print(central_difference_coefficients(2, 2))
References
[1]
B. Fornberg, Generation of finite difference formulas on arbitrarily spaced grids, Mathematics of Computation 51 (1988), 699-706. (doi)
Links
Similar tables
Lagrange basis polynomials for equally spaced nodes —   $a_{m,r,j}$ is the $m$-th derivative of $\ell_{2r,\,r+j}$ at the middle node $x=r$
Newton-Cotes weights —   integrals of equally spaced Lagrange basis polynomials rather than derivatives at the centre
Data properties
Entries are of type: rational number
Table is complete: no (it holds every nonzero coefficient with $1\leq m\leq6$ and $\lceil m/2\rceil\leq r\leq5$)
How they were obtained:

The generator builds the moment equations over $\mathbb{Q}$ on the offsets $-r,-r+1,\ldots,r$ and solves them exactly. Each completed stencil is checked against the defining moments, the parity symmetry, the first nonzero error term and the quoted central-difference rows on Wikipedia.