Académique Documents
Professionnel Documents
Culture Documents
Intégration numérique
2.1 Introduction
L’objectif de l’integration numérique est de calculer une approximation de
Z b
l’intégrale I = f (x)dx d’une fonction f continue sur un intervalle [a, b].
a
En effet, l’expression analytique
Z 1 de f peut ne pas être connue dans certains
2
cas, par exemple, pensez à e x dx. On supposera dans ce chapitre que f est
0
connue en n + 1 points x0 , x1 , . . . , xn de [a, b].
Z b ✓X
n ◆ n
X
˜ )=
I(f ) ⇡ I(f Pn (x)dx = I yi Li (x) = yi I Li (x)
a i=0 i=0
n
X Z b n
X Z b
= yi Li (x)dx = ↵ i yi , où ↵i = Li (x)dx.
i=0 a i=0 a
Dr. M DIABY
Si f est suffisamment dérivable, on a
Z b
1
E(f ) = I(f Pn ) = f (n+1) (⌘x )L(x)dx
(n + 1)! a
C’est la méthode des rectangles à gauche. Mais ce n’est pas la seule, il y’a
aussi les rectangles à droite et point milieu.
— formule du rectangle à droite x0 = b
Formule des rectangles à droite
Z b
f (x)dx ⇡ f (b)(b a).
a
Dr. M DIABY
Erreur de quadrature des rectangles à droite, à gauche
h2 0 h2
|E(f )| = | f (⌘)| sup |f 0 | | |.
2 [a,b] 2
h3 00 h3
|E(f )| = | f (⌘)| sup |f 00 | | |.
3 [a,b] 3
Dr. M DIABY
Z b Z b Z b Z b
˜ )= x b x a
I(f f (x)dx = P1 (x)dx = f (a) dx + f (b) dx
a a a b a a b a
Z b Z b
f (a) f (b)
= (x b)dx +
(x a)dx
b a a b a a
b b
f (a) 1 2 f (b) 1 2
= x bx + x ax
b a 2 a b a 2
a
f (a) 1 2 f (b) 1 2
= (b a2 ) b(b a) + (b a2 ) a(b a)
b a 2 b a 2
f (a) 1 f (b) 1
= (b a) (b + a) b + (b a) (b + a) a
b a 2 b a 2
1 1
= (b a)f (a) + (b a)f (b).
2 2
Par suite
Formule des trapèzes
Z b
1 ⇥ ⇤
f (x)dx = (b a) f (a) + f (b) .
a 2
f 00 (⌘x )
, e(x) = (x a)(x b)
2
Z b
f 00 (⌘x )
et donc l’erreur de quadrature E donne : E = (x a)(x b) .
a 2
Faisons un changement de variable, en posant s = x a
:
( ( b a
x = (b a)s + a x= a)s=0
Alors et
dx = (b a)ds x = b ) s = 1.
On a
Z b Z 1
(x a)(x b)dx = s(b a)(b a)(s 1)(b a)ds
a 0
Z 1 1
s3 s2 1
= s(s 1)(b a)3 ds = (b a)3 = (b a)3 .
0 3 2 0 6
Par suite
Z b Z b
f 00 (⌘x ) (2.1) f 00 (c)
E= (x a)(x b) dx = (x a)(x b)dx (2.1)
a 2 2 a
Dr. M DIABY
où dans (2.1) on utilise le théorème de la moyenne car (x a)(x b) garde un
signe constant.
f 00 (c) 1 1 00
E= .( )(b a)3 = f (c)h3 ,
2 6 12
où h = b a.
Erreur de quadrature de la méthode des trapèzes
h3 00 h3
|E(f )| = | f (⌘)| sup |f 0 | | |.
12 [a,b] 12
f (b).
X 2
Ce polynôme P2 (x) = f (xi )Li (x)dx donne
i=0
Z b Z b 2
X
P2 (x)dx = f (xi )Li (x)dx
a a i=0
Z b Z b Z b
= f (x0 )L0 (x)dx + f (x1 )L1 (x)dx + f (x2 )L2 (x)dx
a a a
Z b Z b Z b
=f (x0 ) L0 (x)dx + f (x1 ) L1 (x)dx + f (x2 ) L2 (x)dx
a a a
Z b Z b Z b
On calcule w0 = L0 (x)dx, w1 = L1 (x)dx, et w2 = L2 (x)dx.
a a a
Puisque xi = x0 + ih (x1 = x0 + h et = x0 + 2h), on a x x2 x1 = x x0 h
et x x2 = x x0 2h. Alors
Z b
1
w0 = 2 (x x0 h)(x x0 2h)dx.
2h a
Si on fait un changement de variable, on trouve y = x x0 h et alors
8
>
<x = a ) y = h
x=b)y=h
>
:
dx = dy.
Par suite
Z h h
1 1 1 3 1 2 1
w0 = y(y h)dy = y y h = h.
2h2 h 2h2 3 2 h 3
Dr. M DIABY
En se basant sur les memes techniques pour les calculs, on trouve
Z b Z b
(x x0 )(x x2 )
w1 = L1 (x)dx = dx
a a (x1 x0 )(x1 x2 )
Z b Z h
1 1
= (x x0 h + h)(x x0 h h)dx = (y + h)(y h)dy
h2 a h2 h
Z h h
1 1 1 3 1 h3 h3
= (y 2 h2 )dy = y yh 2
= h3 ( + h3 )
h2 h h2 3 h h2 3 3
2 4
= h + 2h = h.
3 3
De la même manière, on obtient w2 .
Z b Z b Z b
(x x0 )(x x1 ) 1
w2 = L2 (x)dx = dx = 2 (x x0 )(x x1 )dx
a a (x2 x0 )(x2 x1 ) 2h a
Z b Z h
1 1
= (x x0 h + h)(x x0 h h)dx = (y + h)ydy
2h2 a 2h2 h
h
1 1 3 y2 1
= 2 y h = h.
2h 3 2 h 3
Formule de Simpson
Z b
(b a) a+b
f (x)dx = f (a) + 4f ( ) + f (b) .
a 6 2
Dr. M DIABY
Erreur de quadrature de la méthode de Simpson
h5 (4) h5
|E(f )| = | f (⌘)| sup |f (4) | | |.
90 [a,b] 90
Z xn Z x1 Z x2 Z xn
f (x)dx = f (x)dx + f (x)dx + . . . + f (x)dx
x0 x0 x1 xn 1
Alors
n
X
n min f 0 (x) f 0 (⌘i ) n max f 0 (x)
x2[a,b] x2[a,b]
i=1
Pn
f 0 (⌘i )
et il existe ⌘ 2]a, b[ tel que i=1
= f 0 (⌘) (d’après TVI).
n
Dr. M DIABY
n
X n
X n
h2 h2 X 0 h2 b a 0
Comme E = Ei , on a E = f 0 (⌘i ) = f (⌘i ) = f (⌘).
i=1 i=1
2 2 i=1 2 h
Par suite
Méthode du rectangle composite
n
X b a
I(f ) = h f (xi 1) + E, E= f 0 (⌘)h, ⌘ 2]x0 , xn [.
i=1
2
n
X xi 1+ xi b a
I(f ) = h f( ) + E, E= f 00 (⌘)h2 , ⌘ 2]x0 , xn [.
i=1
2 24
Z xn Z x1 Z x2 Z xn
f (x)dx = f (x)dx + f (x)dx + . . . + f (x)dx
x0 x0 x1 xn 1
✓ ◆ ✓ ◆ ✓ ◆
f (x0 + f (x1 ) f (x1 + f (x2 ) f (xn 1 + f (xn )
⇡h +h + ... + h
2 2 2
✓ ◆
f (x0 + f (xn )
⇡h + f (x1 ) + f (x2 ) + . . . + f (xn 1 )
2
b a f (a) + f (b)
=⇡ + f (x1 ) + f (x2 ) + . . . + f (xn 1 ) .
n 2
En somme, on a
Méthode composite du trapèze
n
X1
h b a
I(f ) = f (a)+f (b)+f (x1 )+2 f (xi ) +E, E = f 00 (⌘)h2 , ⌘ 2]x0 , xn [.
2 i=1
12
Dr. M DIABY
Z xn X1 Z x2i+2
n n
X1
h ⇤
f (x)dx = f (x)dx ⇡ f (x2i ) + 4f (x2i+1 ) + f (x2i+2 )
x0 i=0 x2i i=0
3
h ⇤ h ⇤
⇡ f (x0 ) + 4f (x1 ) + f (x2 ) + f (x2 ) + 4f (x3 ) + f (x4 ) + . . .
3 3
h ⇤ h ⇤
+ f (x2n 4 ) + 4f (x2n 3 ) + f (x2n 2 ) + f (x2n 2 ) + 4f (x2n 1 ) + f (x2n )
3 3
h
⇡ f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + . . . + 4f (x2n 3 )
3
Remarque. Tous les termes de rang impair sont multiplies par 4 tandis que
ceux de rang pair sont multipliés par 2, sauf le premier f (x0 ) et le dernier
f (x2n ).
Donc on peut écrire comme suit : h = b2na et donc n = b2ha ; et l’erreur
totale est
✓ ◆ ✓ ◆
f (4) (⌘) 5 b a f (4) (⌘) 5 b a (4)
n h = h = f (⌘)h4
90 2h 90 180
D’où
Méthode composite de Simpson
n
X
2 1
X
n
2
h
I(f ) = f (a) + 2 f (x2i ) + 4 f (x2i 1) + f (b) + E,
3 i=1 i=1
b a (4)
E= f (⌘)h4 , n pair, ⌘ 2]x0 , xn [.
180
Dr. M DIABY
base canonique (1, x, x2 , . . . , xp )) et inexacte pour un polynôme de degré
p + 1 (par exemple, le polynome de xp+1 ).
(b a)t + a + b
Exemple. Soit x = 2 [a, b].t 2 [ 1, 1].
Z b Z 1 2✓ ◆ Z 1
(b a)t + a + b b a b a
On a f (x)dx = f dt = g(t)dt
a✓ 1 ◆ 2 2 2 1
(b a)t + a + b
où g(t) = f
2
Dr. M DIABY