Engineering Mathematics
Prof. K. Jbilou
[email protected]
ING1, EILCO, Dunkerque, France
K. Jbilou (LMPA, ULCO) 1 / 27
Chapter II: Quadrature
The problem
Particular cases
Composite formulas
Orthogonal Polynomials
The Gauss Quadrature
K. Jbilou (LMPA, ULCO) 2 / 27
The Problem
Find an approximation to the integral
Z b
I (f ) = f (x)dx. (1)
a
Z b
or in general I (f ) = f (x)w (x)dx where w is some positive function
a
called weight function.
We assume that f has no known primitive or f is known only at some fixed
points in [a, b]. So the idea is to replace f by its polynomial interpolation
Pn at some distinct points x0 , . . . , xn and to approximate I (f ) by I (Pn ).
Let us express Pn in the Lagrange basis:
n
X
Pn (x) = f (xi )Li (x). (2)
i=0
K. Jbilou (LMPA, ULCO) 3 / 27
Some Particular Cases
The case n = 0 and x0 = a
Let us set n = 0 and take x0 = a,. Then in this case P0 is a constant
polynomial given by
Z b
P0 (x) = f (a), and then I (P0 ) = f (a)dx = f (a)(b − a).
a
The error is given by
Z b
E (f ) = [f , a, x](x − a) dx and by using the mean value theorem, we ge
a
Z b
= [f , a, ξ] (x − a)dx, avec a < ξ < b (if f is derivable in ]a, b[)
a
K. Jbilou (LMPA, ULCO) 4 / 27
which gives the following expression of the error:
(b − a)2
E (f ) = f 0 (η)
avec a < η < ξ ≤ b.
2
Then we get the following integration formulae called ”Left-Rectangle”
(assuming that f is derivable):
b
(b − a)2
Z
I (f ) = f (x) dx = f (a)(b − a) + f 0 (η) , a < η < b.
a 2
We obtain the approximation (Left-Rectangle formulae):
Z b
f (x)dx ≈ f (a)(b − a).
a
K. Jbilou (LMPA, ULCO) 5 / 27
a+b
The case n = 0 and x0 = .
2
In that case, we get the middle-rectangle formulae . So
a+b a+b
P0 (x) = f , and I(P0 ) = f (b − a).
2 2
The error is given by
Z b
E (f ) = [f , x0 , x](x − x0 ) dx .
a
As the sign of (x − x0 ) is changing in [a, b], the mean-value theorem
couldn’t be applied.
K. Jbilou (LMPA, ULCO) 6 / 27
We use the following decomposition
Z b
E (f ) = ([f , x0 , x0 ] + [f , x0 , x0 , x](x − x0 )) (x − x0 ) dx
a
Z b Z b
0
= f (x0 ) (x − x0 ) dx + [f , x0 , x0 , x](x − x0 )2 dx
a a
(b − a)3
= f 0 (x0 ) × 0 + [f , x0 , x0 , ξ] , a < ξ < b, by the mean theore
12
(b − a)3
= f 00 (η) , a < η < ξ < b, using Cauchy theorem.
24
Then, if f is twice derivable, we get the formulae (Middle formulae)
b
(b − a)3
Z
a+b 00
I (f ) = f (x) dx = f (b − a) + f (η) , a ≤ η ≤ b.
a 2 24
K. Jbilou (LMPA, ULCO) 7 / 27
The case n = 1, x0 = a and x1 = b: Trapeze formulae
We have
(f(a) + f(b))
P1 (x) = f(a) + [f, a, b](x − a), and I(P1 ) = (b − a) .
2
The error is given by (assuming that f is twice derivable):
Z b
E (f ) = [f , a, b, x](x − a)(x − b) dx and by the mean theorem, we get
a
Z b
1 00 −1 00
= f (η) (x − a)(x − b) dx = f (η)(b − a)3 with a < η < b
2 a 12
We get the Trapeze formulae:
Z b
1 1
I (f ) = f (x) dx = (b − a) (f (a) + f (b))− f 00 (η)(b−a)3 , a < η < b.
a 2 12
K. Jbilou (LMPA, ULCO) 8 / 27
a+b
The casen = 2, x0 = a and x1 = , x2 = b,: The
2
Simpson formulae
In this case the interpolation polynomial is given by
P2 (x) = f(a) + [f, a, b](x − a) + [f, a, b, (a + b)/2](x − a)(x − b).
Then
b−a a+b
I (P0 ) = f (a) + 4f + f (b)
6 2
and
Z b
a+b a+b
E (f ) = [f , a, , b, x](x − a) x − (x − b) dx .
a 2 2
a+b
As the sign of (x − a) x − (x − b) is changing in [a, b], the mean
2
value theorem couldn’t be applied.
K. Jbilou (LMPA, ULCO) 9 / 27
In that case, we use the following decomposition
Z b
a+b a+b a+b
E (f ) = [f , a,, b, ](x − a)(x − )(x − b) dx
a 2 2 2
Z b
a+b a+b a+b a+b
+ [f , a, , b, , x](x − )(x − a)(x − )(x − b)
a 2 2 2 2
a+b 2
Z b
f (4) (η)
= (x − a) x − (x − b) dx
4! a 2
(if f has a forth derivative order, and using the mean value theore
1
= − (b − a)5 f (4) (η), avec a < η < b.
2880
K. Jbilou (LMPA, ULCO) 10 / 27
Finally, the Simpson formulae is given as
b−a a+b 1
I (f ) = f (a) + 4f + f (b) − .(b − a)5 f (4) (η), a < η <
6 2 2880
The integral is approximated by
b
b−a
Z
a+b
I (f ) = f (x) dx ≈ f (a) + 4f + f (b)
a 6 2
K. Jbilou (LMPA, ULCO) 11 / 27
The composite formulas
We decompose the interval [a, b] into N small intervals (where N is fixed)
using a subdivision (αi ). Then
Z b N Z
X αi
f (x)dx = f (x)dx
a i=1 αi−1
with a = α0 < α1 < α2 < · · · < αN−1 < αN = b and then we apply one
of the formulas seen before to each interval [αi−1 , αi ] for i = 1, . . . , N.
For simplification, we choose equidistant points αi in [a, b] which means
that αi − αi−1 = h = cst., and this gives
αi= a + i h, 0 ≤ i ≤ N with
b−a
h =
N
K. Jbilou (LMPA, ULCO) 12 / 27
The composite rectangle method
N Z αi N N
X X h2 X 0
f (x)dx = h f (αi−1 ) + f (ηi ), avec αi−1 < ηi < αi , 1 ≤
αi−1 2
i=1 i=1 i=1
N
X h2
= h f (αi−1 ) + Nf 0 (ζ), avec a ≤ ζ ≤ b.
2
i=1
Z b
h
f (x)dx = h [f (a) + f (a + h) + · · · + f (a + (N − 1)h)] + (b − a)f 0 (ζ),
a 2
If f is of class C 1 ([a, b]) then we obtain a convergent formulae (the error is
a O(h)):
N−1
"Z #
b X
lim f (x)dx − h f (a + i h) = 0.
n→∞ a i=0
K. Jbilou (LMPA, ULCO) 13 / 27
The middle composite method
In the same manner and assuming that f is of class C 2 ([a, b]), we get the
composite-middle formulae
Z b
h 3h 1
f (x)dx = h f (a + ) + f (a + ) + · · · + f (a + (N − )h)
a 2 2 2
h 2
+ (b − a)f 00 (ζ), a ≤ ζ ≤ b.
24
Here the error is in O(h2 ) which is better than the preceding formulae.
N−1
"Z #
b X h
lim f (x)dx − h f (a + (2i + 1) ) = 0.
n→∞ a 2
i=0
K. Jbilou (LMPA, ULCO) 14 / 27
The composite Simpson method
Interpolating f by a polynomial of degree 2 in [αi−1 , αi ], at the points
αi + αi−1
αi−1 , , αi we get the Simpson formulae
2
Z αi
h5 (4)
h αi + αi−1
f (x)dx = f (αi−1 ) + 4f + f (αi ) − f (ηi ),
αi−1 6 2 2880
αi−1 < ηi < αi
Summing all these integrals gives the composite Simpson formulae as
follows
Z b
h h h
f (x)dx = [f (a)+ 4f (a + ) + 2f (a + h) + 4f (a + 3 ) + · · ·
a 6 2 2
1 (b − a) 4
+ 2f (a + (N − 1)h) + 4f (a + (N − )h) + f (b)] − h
2 2880
If f ∈ C 4 ([a, b]) then the error is an O(h4 ).
K. Jbilou (LMPA, ULCO) 15 / 27
Classical Orthogonal Polynomials
This section is devoted to classical orthogonal polynomials that will be
used in the Gauss quadrature to be seen later. Definition: Let I be an
interval of R and let w be a positive weight function defined on I . We
consider the vector space E of continued functions from I into R such that
Z
|f (x)|2 w (x) dx < ∞
I
We define in E the following scalar product
Z
hf , g i = f (x) g (x) w (x) dx.
I
The corresponding norm is
Z
2
kPk = hP, Pi = P 2 (x) w (x) dx.
I
K. Jbilou (LMPA, ULCO) 16 / 27
The vector space (E, h, i) is a prehilbertian space. We assume that all the
moments of the weight function are not infinite:
Z
∀n ∈ N, |x|n w (x) dx < ∞,
I
Let P and Q two polynomials of E. They are said to be orthogonal with
respect to w if
Z
hP, Qi = P(x) Q(x) w (x) dx. = 0.
I
K. Jbilou (LMPA, ULCO) 17 / 27
Existence of orthogonal polynomials
Theorem
There exist a sequence of polynomials (Pn )n of degree n exactly
(degree(Pn = n) such that
hPn , Pm i = δn,m = (0 if n 6= m and 1 if n = m).
In that case we say that (Pn )n is a family of orthogonal polynomials with
respect to the weight function w .
K. Jbilou (LMPA, ULCO) 18 / 27
Three term recurrence
Theorem
The sequence of the orthogonal polynomials (Pn )n with respect to w
satisfies the three-term recurrence formulae
Pn+1 (x) = (x + Bn+1 )Pn (x) − Cn+1 Pn−1 (x), n ≥ 0
P0 (x) = 1
P−1 (x) = 0,
où (Bn )n et (Cn )n sont deux suites scalaires.
Remark: The sequence of orthogonal polynomials could be computed using
the Gram-Schmid orthogonalisation process.
K. Jbilou (LMPA, ULCO) 19 / 27
Some classical orthogonal polynomials
The Legendre polynomials
We takeI = [−1, +1] and w (x) = 1. Then the three-term recurrence
relation is given by
(n + 1) Pn+1 (x) = (2n + 1) x Pn (x) − n Pn−1 (x), n ≥ 1
P0 (x) = 1
P1 (x) = x
Z 1
Pn (x)Pm (x) dx = 0, n 6= m
−1
The norm of Pn is Z 1
2
Pn2 (x) dx =
−1 2n + 1
K. Jbilou (LMPA, ULCO) 20 / 27
The Chebychev polynomials of the first kind
1
We set I = [−1, +1] and w (x) = √ . (All the moments are well
1 − x2
defined and are finite). The three-term recurrence relation is given by
Tn+1 (x) = 2 x Tn (x) − Tn−1 (x), n ≥ 1
T0 (x) = 1
T1 (x) = x
Z 1
dx
Tn (x)Tm (x) √ = 0, n 6= m
−1 1 − x2
The norm of Tn
Z 1
dx
Tn2 (x) √ = π/2 if n 6= 0, π if n = 0.
−1 1 − x2
K. Jbilou (LMPA, ULCO) 21 / 27
The Laguerre polynomials
We set I = [0, +∞[ and w (x) = e −x (all the moments are defined.) In that
case, the three-term recurrence formulae is given by
(n + 1) Ln+1 (x) = (2n + 1 − x) Ln (x) − n Ln−1 (x), n ≥ 1
L0 (x) = 1
L1 (x) = 1 − x
Z +∞
Ln (x)Lm (x) e −x dx = 0, n 6= m.
0
The norm of Ln is Z +∞
L2n (x) e −x dx = 1
0
K. Jbilou (LMPA, ULCO) 22 / 27
The Hermite polynomials
2
We take I =] − ∞, +∞[ and w (x) = e −x . The three-term recurrence
formulae is as follows
Hn+1 (x) = 2x Hn (x) − 2n Hn−1 (x), n ≥ 1
H0 (x) = 1
H1 (x) = 2x
Z +∞
2
Hn (x)Hm (x) e −x dx = 0, n 6= m
−∞
The norm of Hn is
Z +∞ √
2
Hn2 (x) e −x dx = 2n n! π
−∞
K. Jbilou (LMPA, ULCO) 23 / 27
K. Jbilou (LMPA, ULCO) 24 / 27
K. Jbilou (LMPA, ULCO) 25 / 27
K. Jbilou (LMPA, ULCO) 26 / 27
K. Jbilou (LMPA, ULCO) 27 / 27