Chapter 2
Numerical integration
I. Motivation
Example : f (x) = cos(πx) √
x
2+ 1
Can we compute J = Z 2
0
f(x)dx?
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
Example : f (x) = cos(πx) √
x
2+ 1
Can we compute J = Z 2
0
f(x)dx?
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
Rectangular rule
(leftpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points
10 subintervals
Rectangular rule (leftpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points 10 subintervals
Rectangular rule (leftpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
21 points 20 subintervals
Rectangular rule
(rightpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points
10 subintervals
Rectangular rule (rightpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points 10 subintervals
Rectangular rule (rightpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
21 points 20 subintervals
Rectangular rule
(midpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points
10 subintervals
Rectangular rule (midpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points 10 subintervals
Rectangular rule (midpoints)
Approximation by a piecewise constant function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
21 points 20 subintervals
Trapezoidal rule
Approximation by a piecewise affine function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points
10 subintervals
Trapezoidal rule
Approximation by a piecewise affine function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
11 points 10 subintervals
Trapezoidal rule
Approximation by a piecewise affine function
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
21 points 20 subintervals
Comparison of the different rules (20 subintervals)
Leftpoint rule Rightpoint rule
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
I=0.019664765868385 I=0.143271563618364 Midpoint rule Trapezoidal rule
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
I=0.080343177070866 I=0.081468164743374
Comparison of the different rules (100 subintervals)
Leftpoint rule Rightpoint rule
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
I=0.068388241234746 I=0.093109600784742 Midpoint rule Trapezoidal rule
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
0 0.5 1 1.5 2
−1.5
−1
−0.5 0 0.5 1 1.5 2 2.5
I=0.080704188569061 I=0.080748921009744
II. Quadrature rules
1 Principle
Definition of a quadrature rule
Letf : [a, b]→R(a < b) be a continuous function
a
b x f(x)
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Aquadrature ruleis an approximation of the integral J(f) stated as a linear combination of function values at specified points in [a, b].
Definition of a quadrature rule
Letf : [a, b]→R(a < b) be a continuous function
a
b x f(x)
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Aquadrature ruleis an approximation of the integral J(f) stated as a linear combination of function values at specified points in [a, b].
Definition of a quadrature rule
Letf : [a, b]→R(a < b) be a continuous function
a
b x f(x)
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Aquadrature ruleis an approximation of the integral J(f) stated as a linear combination of function values at specified points in [a, b].
Reduction to elementary quadrature rules
x0
xn x f(x)
xk
xk+1
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Partition : a=x0< x1 < . . . < xk< xk+1< . . . < xN =b, withhk=xk+1−xk(0≤i≤N−1) andh= maxhk.
Z b
a
f(x)dx=
N−1
X
k=0
Z xk+1
xk
f(x)dx
Þwe want a quadrature rule on small elementary intervals
Reduction to elementary quadrature rules
x0
xn x f(x)
xk
xk+1
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Partition : a=x0< x1 < . . . < xk< xk+1< . . . < xN =b, withhk=xk+1−xk(0≤i≤N−1) andh= maxhk.
Z b
a
f(x)dx=
N−1
X
k=0
Z xk+1
xk
f(x)dx
Þwe want a quadrature rule on small elementary intervals
Reduction to elementary quadrature rules
x0
xn x f(x)
xk
xk+1
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Partition : a=x0< x1 < . . . < xk< xk+1< . . . < xN =b, withhk=xk+1−xk(0≤i≤N−1) andh= maxhk.
Z b a
f(x)dx=
N−1
X
k=0
Z xk+1
xk
f(x)dx
Þwe want a quadrature rule on small elementary intervals
Reduction to elementary quadrature rules
x0
xn x f(x)
xk
xk+1
Can we compute an approximate value of J(f) =
Z b a
f(x)dx?
Partition : a=x0< x1 < . . . < xk< xk+1< . . . < xN =b, withhk=xk+1−xk(0≤i≤N−1) andh= maxhk.
Z b a
f(x)dx=
N−1
X
k=0
Z xk+1
xk
f(x)dx
Þwe want a quadrature rule on small elementary intervals
II. Quadrature rules
1 Principle
2 Examples
Leftpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk)
Leftpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk)
Leftpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk)
Rightpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk+1)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk+1)
Rightpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk+1)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk+1)
Rightpoint rule
xk xk+1
Z xk+1
xk
f(x)dx≈(xk+1−xk)f(xk+1)
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)f(xk+1)
Midpoint rule
xk xk+1 xk+xk+1
2
Z xk+1
xk
f(x)dx≈ (xk+1−xk)f
xk+xk+1
2
Z b
a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)fxk+xk+1 2
Midpoint rule
xk xk+1 xk+xk+1
2
Z xk+1
xk
f(x)dx≈ (xk+1−xk)f
xk+xk+1
2
Z b
a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)fxk+xk+1 2
Midpoint rule
xk xk+1 xk+xk+1
2
Z xk+1
xk
f(x)dx≈ (xk+1−xk)f
xk+xk+1
2
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)fxk+xk+1 2
Trapezoidal rule
xk xk+1
Z xk+1
xk
f(x)dx≈ (xk+1−xk)
f(xk) +f(xk+1) 2
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)
f(xk) +f(xk+1) 2
Trapezoidal rule
xk xk+1
Z xk+1
xk
f(x)dx≈ (xk+1−xk)
f(xk) +f(xk+1) 2
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)
f(xk) +f(xk+1) 2
Trapezoidal rule
xk xk+1
Z xk+1
xk
f(x)dx≈ (xk+1−xk)
f(xk) +f(xk+1) 2
Z b a
f(x)dx≈
N−1
X
k=0
(xk+1−xk)
f(xk) +f(xk+1) 2
II. Quadrature rules
1 Principle
2 Examples
3 Generalization
Change of variables
From[xk, xk+1] to [−1,1]
x= xk+xk+1
2 +xk+1−xk
2 s
dx= xk+1−xk
2 ds
Z xk+1
xk
f(x)dx= xk+1−xk
2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
= xk+1−xk
2
Z 1
−1
ϕk(s)ds.
Þquadrature rule for Z 1
−1
ϕ(s)ds?
Change of variables
From[xk, xk+1] to [−1,1]
x= xk+xk+1
2 +xk+1−xk
2 s
dx= xk+1−xk
2 ds
Z xk+1
xk
f(x)dx= xk+1−xk
2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
= xk+1−xk 2
Z 1
−1
ϕk(s)ds.
Þquadrature rule for Z 1
−1
ϕ(s)ds?
Change of variables
From[xk, xk+1] to [−1,1]
x= xk+xk+1
2 +xk+1−xk
2 s
dx= xk+1−xk
2 ds
Z xk+1
xk
f(x)dx= xk+1−xk
2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
= xk+1−xk 2
Z 1
−1
ϕk(s)ds.
Þquadrature rule for Z 1
−1
ϕ(s)ds?
Elementary quadrature rule (on [−1, 1])
Z 1
−1
ϕ(s)ds
| {z }
≈
l
X
j=0
ωjϕ(τj)
| {z } J(ϕ) JQR(ϕ) with
l∈N
τj ∈[−1,1]for 0≤j≤l,
l
X
j=0
ωj = 2.
Examples
Midpoint rule :l= 0,τ0= 0,ω0 = 2,
Trapezoidal rule :l= 1,τ0=−1, τ1= 1,ω0 =ω1 = 1.
Elementary quadrature rule (on [x
k, x
k+1])
Z xk+1
xk
f(x)dx= xk+1−xk 2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
≈ xk+1−xk
2
l
X
j=0
ωjf(xk+xk+1
2 +xk+1−xk
2 τj) Þ let setλj = ωj
2 ,τkj = xk+xk+1
2 + xk+1−xk
2 τj
General form Z xk+1
xk
f(x)dx≈(xk+1−xk)
l
X
j=0
λjf(τkj)
with l∈N,
τkj ∈[xk, xk+1]for 0≤j≤l,
l
X
j=0
λj = 1.
Elementary quadrature rule (on [x
k, x
k+1])
Z xk+1
xk
f(x)dx= xk+1−xk 2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
≈ xk+1−xk
2
l
X
j=0
ωjf(xk+xk+1
2 +xk+1−xk
2 τj)
Þ let setλj = ωj
2 ,τkj = xk+xk+1
2 + xk+1−xk
2 τj
General form Z xk+1
xk
f(x)dx≈(xk+1−xk)
l
X
j=0
λjf(τkj)
with l∈N,
τkj ∈[xk, xk+1]for 0≤j≤l,
l
X
j=0
λj = 1.
Elementary quadrature rule (on [x
k, x
k+1])
Z xk+1
xk
f(x)dx= xk+1−xk 2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
≈ xk+1−xk
2
l
X
j=0
ωjf(xk+xk+1
2 +xk+1−xk
2 τj) Þ let setλj = ωj
2 ,τkj = xk+xk+1
2 +xk+1−xk 2 τj
General form Z xk+1
xk
f(x)dx≈(xk+1−xk)
l
X
j=0
λjf(τkj)
with l∈N,
τkj ∈[xk, xk+1]for 0≤j≤l,
l
X
j=0
λj = 1.
Elementary quadrature rule (on [x
k, x
k+1])
Z xk+1
xk
f(x)dx= xk+1−xk 2
Z 1
−1
f
xk+xk+1
2 +xk+1−xk
2 s
ds
≈ xk+1−xk
2
l
X
j=0
ωjf(xk+xk+1
2 +xk+1−xk
2 τj) Þ let setλj = ωj
2 ,τkj = xk+xk+1
2 +xk+1−xk 2 τj
General form Z xk+1
xk
f(x)dx≈(xk+1−xk)
l
X
j=0
λjf(τkj)
with l∈N,
τkj ∈[xk, xk+1]for 0≤j≤l,
l
X
j=0
λj = 1.
Conclusion : general form of a quadrature rule
Z b a
f(x)dx
| {z }
≈
N−1
X
k=0
(xk+1−xk)
l
X
j=0
λjf(τkj)
| {z }
J(f) JhQR(f) with
l∈N,
τkj ∈[xk, xk+1]for 0≤j≤l,0≤i≤N−1
l
X
j=0
λj = 1.
III. Order and error estimate
1 Order of a quadrature rule
Definition of the order
Definition
A quadrature rule is of orderp if
it integrates exactly every polynomial function with a degree less than p,
it doesn’t integrate exactly at least one polynomial function with a degree p+ 1.
How to determinate the degree of a quadrature rule ? We verify that the elementary ruleJQR(ϕ) =
l
X
j=0
ωjϕ(τj) is exact(it means that JQR(ϕ) =J(ϕ)) for the functionsϕ: x7→1,x7→x, . . . , x7→xp
inexact for x7→xp+1.
Examples
Leftpoint rule
áorder 0
JQR(ϕ) = 2ϕ(−1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) =−2 6=J(x7→x)(= 0)
Rightpoint rule
á order 0
JQR(ϕ) = 2ϕ(1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 2 6=J(x7→x)(= 0)
Examples
Leftpoint rule áorder 0
JQR(ϕ) = 2ϕ(−1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) =−2 6=J(x7→x)(= 0)
Rightpoint rule
á order 0
JQR(ϕ) = 2ϕ(1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 2 6=J(x7→x)(= 0)
Examples
Leftpoint rule áorder 0
JQR(ϕ) = 2ϕ(−1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) =−2 6=J(x7→x)(= 0) Rightpoint rule
á order 0
JQR(ϕ) = 2ϕ(1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 2 6=J(x7→x)(= 0)
Examples
Leftpoint rule áorder 0
JQR(ϕ) = 2ϕ(−1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) =−2 6=J(x7→x)(= 0) Rightpoint rule á order 0
JQR(ϕ) = 2ϕ(1)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 2 6=J(x7→x)(= 0)
Examples
Midpoint rule
á order 1
JQR(ϕ) = 2ϕ(0)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x)
JQR(x7→x2) = 0 6=J(x7→x2)(= 2 3) Trapezoidal rule
á order 1
JQR(ϕ) = ϕ(−1) +ϕ(1) JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 2 6=J(x7→x2)
Examples
Midpoint rule
á order 1
JQR(ϕ) = 2ϕ(0)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 0 6=J(x7→x2)(= 2
3)
Trapezoidal rule
á order 1
JQR(ϕ) = ϕ(−1) +ϕ(1) JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 2 6=J(x7→x2)
Examples
Midpoint rule á order 1
JQR(ϕ) = 2ϕ(0)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 0 6=J(x7→x2)(= 2
3)
Trapezoidal rule
á order 1
JQR(ϕ) = ϕ(−1) +ϕ(1) JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 2 6=J(x7→x2)
Examples
Midpoint rule á order 1
JQR(ϕ) = 2ϕ(0)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 0 6=J(x7→x2)(= 2
3) Trapezoidal rule
á order 1
JQR(ϕ) = ϕ(−1) +ϕ(1) JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 2 6=J(x7→x2)
Examples
Midpoint rule á order 1
JQR(ϕ) = 2ϕ(0)
JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 0 6=J(x7→x2)(= 2
3) Trapezoidal rule á order 1
JQR(ϕ) = ϕ(−1) +ϕ(1) JQR(x7→1) = 2 =J(x7→1) JQR(x7→x) = 0 =J(x7→x) JQR(x7→x2) = 2 6=J(x7→x2)
III. Order and error estimate
1 Order of a quadrature rule
2 Error estimate
How to estimate the efficiency of a quadrature rule ?
Z b a
f(x)dx
| {z }
≈
N−1
X
k=0
(xk+1−xk)
l
X
j=0
λjf(τkj)
| {z }
J(f) JhQR(f)
We want that, for every functionf,
JhQR(f)→J(f)as h tends to 0 (N tends to+∞),
the error Ef(h) =|JhQR(f)−J(f)|tends to 0 “as rapidly as possible”.
Particularly, ifEf(h) =Cfhα, the quadrature rule is even more efficient thatα is bigger.
Comparison of classical methods
Test case
f(x) =xsinx, a= 0, b= π 2, I=
Z π/2 0
f(x)dx= 1.
Convergence result
Ef(h) =Cfhα. Leftpoint rule : α= 1, Midpoint rule :α= 2, Trapezoidal rule :α= 2.
Comparison of classical methods
Test case
f(x) =xsinx, a= 0, b= π 2, I=
Z π/2 0
f(x)dx= 1.
Convergence result
Ef(h) =Cfhα. Leftpoint rule : α= 1, Midpoint rule :α= 2, Trapezoidal rule :α= 2.
General result
Theorem Let
JQR(f) be an elementary quadrature rule of orderp JhQR(f) the corresponding approximation ofJ(f) =
Z b a
f(x)dx Then, iff ∈ Cp+1([a, b]), there exists a constantCf such that
|JhQR(f)−J(f)|
| {z }
≤ Cfhp+1. Ef(h)
ÞA quadrature rule of orderp converges like hp+1.
IV. How to obtain quadrature rules ?
1 Link between numerical integration and interpolation
Value of the weights in an elementary quadrature rule
Problem
The points (τj)0≤j≤l are given.
We want to calculate the weights(ωj)0≤j≤l such that JQR(ϕ) =
l
X
j=0
ωjϕ(τj) has the maximal order.
Practical calculation
Writing JQR(x7→xk) =J(x7→xk)for all 0≤k≤l leads to a linear system of (l+ 1)equations on (ωj)0≤j≤l.
This system has a unique solution if τi 6=τj for all i6=j (the matrix is a Vandermonde matrix).
The obtained quadrature rule will have an order greater thanl.
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk) = J(Lk)
Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l. Then, for all P ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=
l
X
j=0
P(τj) Z 1
−1
Lj(s)ds
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
l
X
j=0
ωjLk(τj) = Z 1
−1
Lk(s)ds
Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l. Then, for all P ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=
l
X
j=0
P(τj) Z 1
−1
Lj(s)ds
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
ωk =
Z 1
−1
Lk(s)ds
Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l. Then, for all P ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=
l
X
j=0
P(τj) Z 1
−1
Lj(s)ds
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
ωk =
Z 1
−1
Lk(s)ds Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l.
Then, for allP ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=
l
X
j=0
P(τj) Z 1
−1
Lj(s)ds
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
ωk =
Z 1
−1
Lk(s)ds Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l.
Then, for allP ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=
l
X
j=0
P(τj)ωj
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
ωk =
Z 1
−1
Lk(s)ds Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l.
Then, for allP ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=JQR(P)
áorder≥l
Link with the Lagrangian basis associated to the (τ
j)
0≤j≤lJQR(ϕ) =
l
X
j=0
ωjϕ(τj) Assume that the (ωj)0≤j≤l have been calculated so that the quadrature rule has an order greater thanl.
Then, for all0≤k≤l,Lk∈Rl[X]and JQR(Lk)
| {z }
= J(Lk)
| {z }
ωk =
Z 1
−1
Lk(s)ds Reciprocally, let assume ωk=R1
−1Lk(s)ds for all 0≤k≤l.
Then, for allP ∈Rl[X],P =
l
X
j=0
P(τj)Lj and J(P) =
Z 1
−1
P(s)ds=JQR(P) áorder≥l
Theorem Let
(τj)0≤j≤l,(l+ 1)distinct points in[−1,1],
(Lk)0≤k≤l, the Lagrangian basis ofRl[X]associated to the points(τj)0≤j≤l.
Then, the quadrature rule JQR(ϕ) =
l
X
j=0
ωjϕ(τj) has an order at less equal tolif and only if
ωk= Z 1
−1
Lk(s)ds ∀0≤i≤l.
In this case, for all ϕ∈ C[−1,1], we have JQR(ϕ) = Z 1
−1
Pϕ(s)ds, where Pϕ is the Lagrangian interpolating polynomial of ϕ in the points(τj)0≤j≤l.
IV. How to obtain quadrature rules ?
1 Link between numerical integration and interpolation
2 Newton-Cotes quadrature
Definition
The Newton-Cotes formulas are the quadrature rules
JQR(ϕ) =
l
X
j=0
ωjϕ(τj)
of maximal order obtained for points equally spaced on[−1,1].
It means :
τj =−1 +2j
l for 0≤j≤l, ωj =
Z 1
−1
Lj(s)ds.
Examples of Newton-Cotes formulas
l= 1 : trapezoidal rule
JQR(ϕ) =ϕ(1) +ϕ(−1).
l= 2 : Simpson rule JQR(ϕ) = 1
3ϕ(−1) + 4
3ϕ(0) + 1 3ϕ(1).
l= 4 : Boole-Villarceau rule JQR(ϕ) = 7
45ϕ(−1)+32 45ϕ(−1
2)+ 4
15ϕ(0)+32 45ϕ(1
2)+ 7 45ϕ(1).
Order of these quadrature rules l, if lis odd,
l+ 1, ifl is even.
IV. How to obtain quadrature rules ?
1 Link between numerical integration and interpolation
2 Newton-Cotes quadrature
3 Gaussian quadrature
Principle
Knowing (τj)0≤j≤l, we take ωj = Z 1
−1
Lj(s)ds in order to have the maximal order associated to the given points.
The objective of Gaussian method consists now in choosing the points (τj)0≤j≤l leading to a quadrature rule of maximal order.
Example 2 points τ0,τ1 (l= 1), we assume τ0 =−τ1=−τ. JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1 = 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ+ω1τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω1τ2 = 2 3
=⇒ω0 =ω1= 1, τ =
√3 3 .
á order 3
Principle
Knowing (τj)0≤j≤l, we take ωj = Z 1
−1
Lj(s)ds in order to have the maximal order associated to the given points.
The objective of Gaussian method consists now in choosing the points (τj)0≤j≤l leading to a quadrature rule of maximal order.
Example 2 points τ0,τ1 (l= 1), we assume τ0 =−τ1=−τ. JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1 = 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ+ω1τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω1τ2 = 2 3
=⇒ω0 =ω1= 1, τ =
√3 3 .
á order 3
Principle
Knowing (τj)0≤j≤l, we take ωj = Z 1
−1
Lj(s)ds in order to have the maximal order associated to the given points.
The objective of Gaussian method consists now in choosing the points (τj)0≤j≤l leading to a quadrature rule of maximal order.
Example 2 points τ0,τ1 (l= 1), we assume τ0 =−τ1=−τ. JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1 = 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ+ω1τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω1τ2 = 2 3
=⇒ω0 =ω1= 1, τ =
√3 3 .
á order 3
Principle
Knowing (τj)0≤j≤l, we take ωj = Z 1
−1
Lj(s)ds in order to have the maximal order associated to the given points.
The objective of Gaussian method consists now in choosing the points (τj)0≤j≤l leading to a quadrature rule of maximal order.
Example 2 points τ0,τ1 (l= 1), we assume τ0 =−τ1=−τ. JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1 = 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ+ω1τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω1τ2 = 2 3
=⇒ω0 =ω1 = 1, τ =
√3 3 .
á order 3
Principle
Knowing (τj)0≤j≤l, we take ωj = Z 1
−1
Lj(s)ds in order to have the maximal order associated to the given points.
The objective of Gaussian method consists now in choosing the points (τj)0≤j≤l leading to a quadrature rule of maximal order.
Example 2 points τ0,τ1 (l= 1), we assume τ0 =−τ1=−τ. JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1 = 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ+ω1τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω1τ2 = 2 3
=⇒ω0 =ω1 = 1, τ =
√3 3 .
á order 3
A second example, with 3 points
We assume that the points are−τ,0 andτ.
JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(0) +ω2ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1+ω2= 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ +ω2τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω2τ2 = 2 3 JQR(x7→x3) =J(x7→x3) =⇒ −ω0τ3+ω2τ3= 0 JQR(x7→x4) =J(x7→x4) =⇒ ω0τ4+ω2τ4 = 2 5
=⇒τ = r3
5, ω0 =ω2 = 5
9, ω1= 8 9.
á order 5
A second example, with 3 points
We assume that the points are−τ,0 andτ.
JQR(ϕ) =ω0ϕ(−τ) +ω1ϕ(0) +ω2ϕ(τ).
JQR(x7→1) =J(x7→1) =⇒ ω0+ω1+ω2= 2 JQR(x7→x) =J(x7→x) =⇒ −ω0τ +ω2τ = 0 JQR(x7→x2) =J(x7→x2) =⇒ ω0τ2+ω2τ2 = 2 3 JQR(x7→x3) =J(x7→x3) =⇒ −ω0τ3+ω2τ3= 0 JQR(x7→x4) =J(x7→x4) =⇒ ω0τ4+ω2τ4 = 2 5
=⇒τ = r3
5, ω0 =ω2 = 5
9, ω1= 8 9.
á order 5