Newton–Cotes weights
edit · history · discussion · files · long url · analysis
Numbers
$n$
$j$
normalisation 
$w_{n,j}$ or $C_{n,j}$
1
0
$w_{n,j}$:
1/2
comment: Trapezoidal rule: $\tfrac{1}{2}(1,1)$.
1
0
$C_{n,j}$:
1/2
1
1
$w_{n,j}$:
1/2
1
1
$C_{n,j}$:
1/2
2
0
$w_{n,j}$:
1/3
comment: Simpson's rule: $\tfrac{1}{3}(1,4,1)$.
2
0
$C_{n,j}$:
1/6
2
1
$w_{n,j}$:
4/3
2
1
$C_{n,j}$:
2/3
2
2
$w_{n,j}$:
1/3
2
2
$C_{n,j}$:
1/6
3
0
$w_{n,j}$:
3/8
comment: Simpson's 3/8 rule: $\tfrac{3}{8}(1,3,3,1)$.
3
0
$C_{n,j}$:
1/8
3
1
$w_{n,j}$:
9/8
3
1
$C_{n,j}$:
3/8
3
2
$w_{n,j}$:
9/8
3
2
$C_{n,j}$:
3/8
3
3
$w_{n,j}$:
3/8
3
3
$C_{n,j}$:
1/8
4
0
$w_{n,j}$:
14/45
comment: Boole's rule: $\tfrac{2}{45}(7,32,12,32,7)$.
4
0
$C_{n,j}$:
7/90
4
1
$w_{n,j}$:
64/45
4
1
$C_{n,j}$:
16/45
4
2
$w_{n,j}$:
8/15
4
2
$C_{n,j}$:
2/15
4
3
$w_{n,j}$:
64/45
4
3
$C_{n,j}$:
16/45
4
4
$w_{n,j}$:
14/45
4
4
$C_{n,j}$:
7/90
5
0
$w_{n,j}$:
95/288
comment: The closed Newton-Cotes rule with $n=5$: $\tfrac{5}{288}(19,75,50,50,75,19)$.
5
0
$C_{n,j}$:
19/288
5
1
$w_{n,j}$:
125/96
5
1
$C_{n,j}$:
25/96
5
2
$w_{n,j}$:
125/144
5
2
$C_{n,j}$:
25/144
5
3
$w_{n,j}$:
125/144
5
3
$C_{n,j}$:
25/144
5
4
$w_{n,j}$:
125/96
5
4
$C_{n,j}$:
25/96
5
5
$w_{n,j}$:
95/288
5
5
$C_{n,j}$:
19/288
6
0
$w_{n,j}$:
41/140
comment: The closed Newton-Cotes rule with $n=6$: $\tfrac{1}{140}(41,216,27,272,27,216,41)$.
6
0
$C_{n,j}$:
41/840
6
1
$w_{n,j}$:
54/35
6
1
$C_{n,j}$:
9/35
6
2
$w_{n,j}$:
27/140
6
2
$C_{n,j}$:
9/280
6
3
$w_{n,j}$:
68/35
6
3
$C_{n,j}$:
34/105
6
4
$w_{n,j}$:
27/140
6
4
$C_{n,j}$:
9/280
6
5
$w_{n,j}$:
54/35
6
5
$C_{n,j}$:
9/35
6
6
$w_{n,j}$:
41/140
6
6
$C_{n,j}$:
41/840
7
0
$w_{n,j}$:
5257/17280
comment: The closed Newton-Cotes rule with $n=7$: $\tfrac{7}{17280}(751,3577,1323,2989,2989,1323,3577,751)$.
7
0
$C_{n,j}$:
751/17280
7
1
$w_{n,j}$:
25039/17280
7
1
$C_{n,j}$:
3577/17280
7
2
$w_{n,j}$:
343/640
7
2
$C_{n,j}$:
49/640
7
3
$w_{n,j}$:
20923/17280
7
3
$C_{n,j}$:
2989/17280
7
4
$w_{n,j}$:
20923/17280
7
4
$C_{n,j}$:
2989/17280
7
5
$w_{n,j}$:
343/640
7
5
$C_{n,j}$:
49/640
7
6
$w_{n,j}$:
25039/17280
7
6
$C_{n,j}$:
3577/17280
7
7
$w_{n,j}$:
5257/17280
7
7
$C_{n,j}$:
751/17280
8
0
$w_{n,j}$:
3956/14175
comment: The closed Newton-Cotes rule with $n=8$: $\tfrac{4}{14175}(989,5888,-928,10496,-4540,10496,-928,5888,989)$.
8
0
$C_{n,j}$:
989/28350
8
1
$w_{n,j}$:
23552/14175
8
1
$C_{n,j}$:
2944/14175
8
2
$w_{n,j}$:
-3712/14175
8
2
$C_{n,j}$:
-464/14175
8
3
$w_{n,j}$:
41984/14175
8
3
$C_{n,j}$:
5248/14175
8
4
$w_{n,j}$:
-3632/2835
8
4
$C_{n,j}$:
-454/2835
8
5
$w_{n,j}$:
41984/14175
8
5
$C_{n,j}$:
5248/14175
8
6
$w_{n,j}$:
-3712/14175
8
6
$C_{n,j}$:
-464/14175
8
7
$w_{n,j}$:
23552/14175
8
7
$C_{n,j}$:
2944/14175
8
8
$w_{n,j}$:
3956/14175
8
8
$C_{n,j}$:
989/28350
9
0
$w_{n,j}$:
25713/89600
comment: The closed Newton-Cotes rule with $n=9$: $\tfrac{9}{89600}(2857,15741,1080,19344,5778,5778,19344,1080,15741,2857)$.
9
0
$C_{n,j}$:
2857/89600
9
1
$w_{n,j}$:
141669/89600
9
1
$C_{n,j}$:
15741/89600
9
2
$w_{n,j}$:
243/2240
9
2
$C_{n,j}$:
27/2240
9
3
$w_{n,j}$:
10881/5600
9
3
$C_{n,j}$:
1209/5600
9
4
$w_{n,j}$:
26001/44800
9
4
$C_{n,j}$:
2889/44800
9
5
$w_{n,j}$:
26001/44800
9
5
$C_{n,j}$:
2889/44800
9
6
$w_{n,j}$:
10881/5600
9
6
$C_{n,j}$:
1209/5600
9
7
$w_{n,j}$:
243/2240
9
7
$C_{n,j}$:
27/2240
9
8
$w_{n,j}$:
141669/89600
9
8
$C_{n,j}$:
15741/89600
9
9
$w_{n,j}$:
25713/89600
9
9
$C_{n,j}$:
2857/89600
10
0
$w_{n,j}$:
80335/299376
comment: The closed Newton-Cotes rule with $n=10$: $\tfrac{5}{299376}(16067,106300,-48525,272400,-260550,427368,-260550,272400,-48525,106300,16067)$.
10
0
$C_{n,j}$:
16067/598752
10
1
$w_{n,j}$:
132875/74844
10
1
$C_{n,j}$:
26575/149688
10
2
$w_{n,j}$:
-80875/99792
10
2
$C_{n,j}$:
-16175/199584
10
3
$w_{n,j}$:
28375/6237
10
3
$C_{n,j}$:
5675/12474
10
4
$w_{n,j}$:
-24125/5544
10
4
$C_{n,j}$:
-4825/11088
10
5
$w_{n,j}$:
89035/12474
10
5
$C_{n,j}$:
17807/24948
10
6
$w_{n,j}$:
-24125/5544
10
6
$C_{n,j}$:
-4825/11088
10
7
$w_{n,j}$:
28375/6237
10
7
$C_{n,j}$:
5675/12474
10
8
$w_{n,j}$:
-80875/99792
10
8
$C_{n,j}$:
-16175/199584
10
9
$w_{n,j}$:
132875/74844
10
9
$C_{n,j}$:
26575/149688
10
10
$w_{n,j}$:
80335/299376
10
10
$C_{n,j}$:
16067/598752
11
0
$w_{n,j}$:
4777223/17418240
comment: The closed Newton-Cotes rule with $n=11$: $\tfrac{11}{87091200}(2171465,13486539,-3237113,25226685,-9595542,15493566,15493566,-9595542,25226685,-3237113,13486539,2171465)$.
11
0
$C_{n,j}$:
434293/17418240
11
1
$w_{n,j}$:
49450643/29030400
11
1
$C_{n,j}$:
4495513/29030400
11
2
$w_{n,j}$:
-35608243/87091200
11
2
$C_{n,j}$:
-3237113/87091200
11
3
$w_{n,j}$:
6166523/1935360
11
3
$C_{n,j}$:
560593/1935360
11
4
$w_{n,j}$:
-17591827/14515200
11
4
$C_{n,j}$:
-1599257/14515200
11
5
$w_{n,j}$:
28404871/14515200
11
5
$C_{n,j}$:
2582261/14515200
11
6
$w_{n,j}$:
28404871/14515200
11
6
$C_{n,j}$:
2582261/14515200
11
7
$w_{n,j}$:
-17591827/14515200
11
7
$C_{n,j}$:
-1599257/14515200
11
8
$w_{n,j}$:
6166523/1935360
11
8
$C_{n,j}$:
560593/1935360
11
9
$w_{n,j}$:
-35608243/87091200
11
9
$C_{n,j}$:
-3237113/87091200
11
10
$w_{n,j}$:
49450643/29030400
11
10
$C_{n,j}$:
4495513/29030400
11
11
$w_{n,j}$:
4777223/17418240
11
11
$C_{n,j}$:
434293/17418240
12
0
$w_{n,j}$:
1364651/5255250
comment: The closed Newton-Cotes rule with $n=12$: $\tfrac{1}{5255250}(1364651,9903168,-7587864,35725120,-51491295,87516288,-87797136,87516288,-51491295,35725120,-7587864,9903168,1364651)$.
12
0
$C_{n,j}$:
1364651/63063000
12
1
$w_{n,j}$:
150048/79625
12
1
$C_{n,j}$:
12504/79625
12
2
$w_{n,j}$:
-1264644/875875
12
2
$C_{n,j}$:
-105387/875875
12
3
$w_{n,j}$:
3572512/525525
12
3
$C_{n,j}$:
893128/1576575
12
4
$w_{n,j}$:
-3432753/350350
12
4
$C_{n,j}$:
-1144251/1401400
12
5
$w_{n,j}$:
14586048/875875
12
5
$C_{n,j}$:
1215504/875875
12
6
$w_{n,j}$:
-2090408/125125
12
6
$C_{n,j}$:
-522602/375375
12
7
$w_{n,j}$:
14586048/875875
12
7
$C_{n,j}$:
1215504/875875
12
8
$w_{n,j}$:
-3432753/350350
12
8
$C_{n,j}$:
-1144251/1401400
12
9
$w_{n,j}$:
3572512/525525
12
9
$C_{n,j}$:
893128/1576575
12
10
$w_{n,j}$:
-1264644/875875
12
10
$C_{n,j}$:
-105387/875875
12
11
$w_{n,j}$:
150048/79625
12
11
$C_{n,j}$:
12504/79625
12
12
$w_{n,j}$:
1364651/5255250
12
12
$C_{n,j}$:
1364651/63063000
Definition
For $n\geq 1$, closed Newton–Cotes weights $w_{n,j}$ are the rational coefficients in $\int_0^n f(x)\,\mathrm{d}x\approx\sum_{j=0}^n w_{n,j}f(j)$, exact for polynomials of degree at most $n$ [1]. The table gives the same weights in two invertible normalisations: $w_{n,j}$ and $C_{n,j}=w_{n,j}/n$.
Parameters
$n$
—   number of subintervals ($n\geq 1$)
$j$
—   node index, counted from the left endpoint ($0\leq j\leq n$)
normalisation
—   normalisation (either step or unit-interval)
Formulas
(1)
$w_{n,j}=\int_0^n \ell_{n,j}(x)\,\mathrm{d}x$, where $\ell_{n,j}(x)=\prod_{0\leq k\leq n,\ k\neq j}\frac{x-k}{j-k}$.
(2)
$C_{n,j}=w_{n,j}/n$, so the two normalisations determine one another.
(3)
$\sum_{j=0}^n w_{n,j}j^m=\int_0^n x^m\,\mathrm{d}x=\frac{n^{m+1}}{m+1}$ for $0\leq m\leq n$; when $n$ is even, the same identity also holds for $m=n+1$.
(4)
$w_{n,j}=w_{n,n-j}$, $C_{n,j}=C_{n,n-j}$, $\sum_{j=0}^n w_{n,j}=n$ and $\sum_{j=0}^n C_{n,j}=1$.
Comments
(5)
The step rows use spacing $h=1$. On an interval with nodes $a,a+h,\ldots,a+nh$, the quadrature rule is $\int_a^{a+nh}f(x)\,\mathrm{d}x\approx h\sum_{j=0}^n w_{n,j}f(a+jh)$. The unit-interval rows divide the same weights by $n$, giving $\int_0^1 f(x)\,\mathrm{d}x\approx\sum_{j=0}^n C_{n,j}f(j/n)$.
(6)
The node index $j$ is counted from the left endpoint, so the entries are in the same order as $f(0),f(1),\ldots,f(n)$ in the step form. Every symmetric duplicate is stored: $w_{n,j}=w_{n,n-j}$, and a reader may hold either end of the rule.
(7)
The entries are reduced fractions. The common-denominator form printed in tables of quadrature rules, such as $\tfrac{2}{45}(7,32,12,32,7)$ for Boole's rule, is given as an entry comment on the first row of each rule.
(8)
The closed equally spaced rules stop being positive: the first negative weights in this range occur for $n=8$, where $w_{8,2}=w_{8,6}=-3712/14175$. The rules with $n=10,11,12$ also have negative weights.
(9)
The weights are the integrals of the Lagrange basis polynomials for equally spaced nodes. Gauss–Legendre, Gauss–Lobatto and Gauss–Kronrod quadrature choose different, non-equally spaced nodes for the same integration problem.
Programs
(P1)
Sage
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing

R = PolynomialRing(QQ, 'x')
x = R.gen()
def newton_cotes_weights(n):
    weights = []
    for j in range(n + 1):
        ell = R(1)
        for k in range(n + 1):
            if k != j:
                ell *= (x - k) * (QQ(1) / QQ(j - k))
        anti = ell.integral()
        weights.append(anti(n) - anti(0))
    return weights

newton_cotes_weights(4)     # [14/45, 64/45, 8/15, 64/45, 14/45]
Links
Similar tables
Lagrange basis polynomials for equally spaced nodes —   the weights are the integrals of these basis polynomials
Nodes and weights of Gauss–Legendre quadrature —   the interpolatory rule with $n$ free nodes, exact to the highest possible degree
Nodes and weights of Gauss–Lobatto quadrature —   the interpolatory rule with both endpoints fixed, agreeing here only for the trapezoidal and Simpson rules
Nodes and weights of Gauss–Kronrod quadrature —   the extension of Gauss–Legendre rules used for adaptive quadrature
Data properties
Entries are of type: rational number
Table is complete: no (it holds every closed rule with $1\leq n\leq 12$, in both the step and unit-interval normalisations)
How they were obtained:

The generator builds the Lagrange moment equations over $\mathbb{Q}$ and solves them exactly.

more

Each completed rule is checked against the moments through degree $n$, and through degree $n+1$ when $n$ is even, against the symmetry and the two normalisations, against the quoted rows on Wikipedia and MathWorld for the named small rules, and against OEIS A093735 and A093736 where those b-files give the same rows.