Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
Analyse Num´erique
Proposition de corrig´e du TD 3
EXERCICE 1
Interpolation de Lagrange
Soit x0, x1, ..., xn, n + 1 points distincts.
a. Soit (Li)i=0,n n + 1 fonctions de Pn v´erifiant Li(xj) = δij. Montrer que
(Li)i=0,n est une base de Pn (ensemble des polynˆomes de degr´e inf´erieur ou
´egal `a n). Construire cette base.
(Li)i=0,n est une base de Pn
• On a (Li)i=0,n ∈ Pn.
• On a Card
(Li)i=0,n
• Soit (ai)i=0,n ∈ R tels que
h
i
= n + 1 = dimPn.
n
X
i=0
aiLi(x) = 0 .
i=0 aiLi(xj) = aj pour chacun des j ∈ {0, ..., n}, ou encore aj = 0 pour
Donc 0 = Pn
chaque j. D’o`u la famille (Li)i=0,n est libre.
Par suite la famille (Li)i=0,n est une base de Pn.
Construction de la base (Li)i=0,n
Soit i ∈ {0, ..., n}. Pour tout j ∈ {0, ..., n} j 6= i, Li(xj) = 0. Donc
De Li(xi) = 1, on d´eduit
Li(x) = ci Πn
j=0,j6=i(x − xj) .
ci =
1
j=0,j6=i(xi − xj)
Πn
.
D’o`u
Li(x) =
Πn
j=0,j6=i(x − xj)
Πn
j=0,j6=i(xi − xj)
= Πn
j=0,j6=i
(cid:16) x − xj
xi − xj
(cid:17)
.
b. Soit pn ∈ Pn v´erifiant : pn(xi) = f (xi) ∀i = 0, ..., n. D´ecomposer pn sur la
base des (Li)i=0,n. Un tel pn est-il unique ?
1
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
D´ecomposition de pn sur la base (Li)i=0,n
On a
n
X
pn(x) =
aiLi(x) avec aj ∈ R .
De pn(xj) = f (xj) ∀j = 0, ..., n, on obtient
i=0
pn(x) =
n
X
i=0
f (xi)Li(x) .
Unicit´e de pn
Soient pn, qn ∈ Pn tels que pn(xi) = f (xi) ∀i = 0, ..., n et qn(xi) = f (xi) ∀i = 0, ..., n.
Alors le polynˆome r = pn − qn ∈ Pn a (n + 1) racines (xi)i=0,n. Comme deg r ≤ n,
n´ecessairement r = 0.
c. ´Ecrire le polynˆome d’interpolation associ´e aux points donn´es dans le
tableau suivant :
−1
xi
f (xi) −3/2
−1/2
0
0
1/4
1/2
0
1
0
Tab. 1 – Tableau pour l’interpolation.
On a
p4(x) = f (x0)L0(x) + f (x1)L1(x) + f (x2)L2(x) + f (x3)L3(x) + f (x4)L4(x) ,
= −
3
2
L0(x) +
1
4
f (x2)L2(x) .
o`u
D’o`u
L0(x) =
(−1 +
1
2
(x +
1
2
)x(x −
1
2
)(x − 1)
)(−1 − 0)(−1 −
=
1
2
)(−1 − 1)
x2 +
1
4
x
,
x4 − x3 −
1
4
3
2
L2(x) =
(x + 1)(x +
(0 + 1)(0 +
1
2
1
2
)(x −
)(0 −
1
2
1
2
)(x − 1)
x4 −
=
)(0 − 1)
1
4
.
x2 +
5
4
1
4
p4(x) = −
3
2
x4 − x3 −
1
4
3
2
x2 +
1
4
x
x4 −
+
1
4
1
4
x2 +
Publicité
5
4
1
4
= x3 − x2 −
1
4
x +
1
4
.
2
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
d. ´Etablir la majoration d’interpolation de Lagrange i.e. si f ∈ Cn+1([a, b]),
alors il existe ξ ∈]a, b[ tel que
f (x) − pn(x) =
Πn
j=0(x − xj)
(n + 1)!
f (n+1)(ξ) .
• Si x = xj ∀j = 0, ..., n, alors f (x)p(x) = 0, et tout ξ ∈]a, b[ convient.
• Si x 6= xj ∀j = 0, ..., n, alors d´efinissons
φ(t) = f (t) − p(t) − k(x) Πn
j=0(t − xj), ∀t ∈ [a, b] ,
o`u k(x) est choisi de telle sorte que φ(x) = 0.
D’une part, on en d´eduit que
k(x) =
f (x) − p(x)
Πn
j=0(x − xj)
.
(1.1)
(1.2)
D’autre part, la fonction t 7→ φ(t) est de classe Cn+1([a, b]) admet (n+2) racines distinctes
x, x0, x1, ..., xn sur ]a, b[. D’apres le th´eoreme de Rolle :
t 7→ φ0(t) est de classe Cn([a, b]) admet (n + 1) racines distinctes sur ]a, b[, appartenant
chacune entre les intervalles ouverts d’extr´emit´es de x, x0, x1, ..., xn contenus dans ]a, b[.
Par application du th´eor`eme de Rolle,
t 7→ φ(2)(t) est de classe Cn−1([a, b]) admet n racines distinctes sur ]a, b[. Par application
du th´eor`eme de Rolle une nouvelle fois,
t 7→ φ(3)(t) est de classe Cn−2([a, b]) admet n − 1 racines distinctes sur ]a, b[.
Ainsi de suite, par application du th´eor`eme de Rolle, t 7→ φ(n+1)(t) est de classe C0([a, b])
admet une racine ξ ∈]a, b[, φ(n+1)(ξ) = 0.
Puisque pn ∈ Pn, on a p(n+1)
= 0 et
n
0 = φ(n+1)(ξ) = f (n+1)(ξ) − (n + 1)! k(x) .
(1.3)
Donc de (1.2) et (1.3) on tire,
k(x) =
f (x) − p(x)
Πn
j=0(x − xj)
=
f (n+1)(ξ)
(n + 1)!
.
D’o`u le r´esultat.
e. Soient f (x) = cos(x) et g(x) = e3x d´efinies sur [0, 1]. Estimer le nombre
minimum de points pour que l’erreur entre la fonction et son polynˆome d’in-
terpolation de Lagrange soit inf´erieure `a 0.1, 0.01 et 0.001.
3
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
Nombre de points mimimum pour satisfaire une tol´erance ε donn´ee
Premier cas : f (x) = cos(x) sur [0, 1].
π
On a cos(n+1)(x) = cos
2
x + (n + 1)
(cid:16)
(cid:12)
(cid:12)
(cid:12) ≤ 1 ∀x, y ∈ [0, 1], donc
(cid:17)
et
(cid:12)
(cid:12)
(cid:12)x − y
(cid:12)
(cid:12)
(cid:12)
(cid:12) ≤
(cid:12)f (x) − pn(x)
1
(n + 1)!
≤ ε
donne
D’o`u
• ε = 0.1 ⇒ ε−1 = 10 :
• ε = 0.01 ⇒ ε−1 = 100 :
•ε = 0.001 ⇒ ε−1 = 1000 :
(n + 1)! ≥ ε−1 .
3! = 6 ,
4! = 24 ⇒ n + 1 ≥ 4 ⇒ n ≥ 3 .
5! = 120 ⇒ n + 1 ≥ 5 ⇒ n ≥ 4 .
6! = 720 ,
7! = 5040 ⇒ n + 1 ≥ 7 ⇒ n ≥ 6 .
Deuxi`eme cas : g(x) = exp(3x) sur [0, 1].
(cid:12)
On a g(n+1)(x) = 3(n+1) exp(3x) et
(cid:12)
(cid:12)x − y
(cid:12)
(cid:12)
(cid:12)
(cid:12)
(cid:12) ≤
(cid:12)g(x) − pn(x)
(cid:12)
(cid:12)
(cid:12) ≤ 1 ∀x, y ∈ [0, 1], donc
3(n+1) exp(3)
(n + 1)!
≤ ε .
D’o`u
• ε = 0.1 :
• ε = 0.01 :
• ε = 0.001 :
’ 0.3268383 ,
’ 0.0891377 ⇒ n ≥ 10 .
’ 0.0222844 ,
’ 0.0051426 ⇒ n ≥ 12 .
’ 0.0011020 ,
’ 0.0002204 ⇒ n ≥ 14 .
3(9+1) exp(3)
(9 + 1)!
3(10+1) exp(3)
(10 + 1)!
3(11+1) exp(3)
(11 + 1)!
3(12+1) exp(3)
(12 + 1)!
3(13+1) exp(3)
(13 + 1)!
3(14+1) exp(3)
(14 + 1)!
4
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
EXERCICE 2
Interpolation de Hermite
Soit f ∈ C1([a, b]) et x1, x2 deux points distincts. Soit p un polynˆome de
degr´e ≤ 3 v´erifiant p(xi) = f (xi) et p0(xi) = f 0(xi) pour i = 1, 2.
a. Montrer qu’un tel polynˆome existe et est unique.
Existence
On pose p(x) = a3x3 + a2x2 + a1x + a0, donc p0(x) = 3a3x2 + 2a2x + a1.
Les conditions sur p et p0 s’´ecrivent :
a3x3
1 + a2x2
1 + a1x1 + a0 = f (x1) ,
a3x3
2 + a2x2
2 + a1x2 + a0 = f (x2) ,
3a3x2
1 + 2a2x1 + a1 + 0 = f 0(x1) ,
3a3x2
2 + 2a2x2 + a1 + 0 = f 0(x2) .
Publicité
1 x1
1 x2
0
0
1
1
x2
1
x2
2
x3
1
x3
2
2x1 3x2
1
2x2 3x2
2
a0
a1
a2
a1
=
=
=
=
f (x1)
f (x2)
f 0(x1)
f 0(x2)
,
AX = B
ou encore
ou bien encore
avec
A =
1 x1
1 x2
0
0
1
1
x2
1
x2
2
x3
1
x3
2
2x1 3x2
1
2x2 3x2
2
5
, X =
a0
a1
a2
a1
, C =
f (x1)
Publicité
f (x2)
f 0(x1)
f 0(x2)
.
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
On a det(A) = −
(cid:16)
(cid:17)4
x2 − x1
6= 0 puisque x1 6= x2, d’o`u l’existence de p.
Unicit´e de p
Soient p, q ∈ P3 tels que
Soit r = p − q. Alors
p(xi) = f (xi) , i = 1, 2 ,
p0(xi) = f 0(xi) , i = 1, 2 .
r(xi) = f (xi) , i = 1, 2 ,
r0(xi) = f 0(xi) , i = 1, 2 ,
⇒ r(x) = C(x) (x − x1)2(x − x2)2 .
Comme r ∈ P3, on a c(x) = 0, donc r = 0, puis p = q. D’o`u l’unicit´e.
b. ´Etablir la majoration d’interpolation suivante : si f ∈ C4([a, b]), alors il
existe ξ ∈]a, b[ tel que
f (x) − p(x) =
(x − x1)2(x − x2)2
4!
f (4)(ξ) .
• Si x = x1 ou x2, alors f (x) − p(x) = 0, et tout ξ ∈]a, b[ convient.
• Si x 6= x1 , x2, on pose
φ(t) = f (t) − p(t) − (t − x1)(t − x2) k(x), ∀t ∈ [a, b] ,
o`u k(x) est choisi de telle sorte que φ(x) = 0.
Donc
On a ´egalement :
k(x) =
f (x) − p(x)
(x − x1)(x − x2)
,
(2.1)
la fonction t 7→ φ(t) est de classe C4([a, b]) et admet 3 racines distinctes x, x1, x2 sur
[a, b]. D’apres le th´eoreme de Rolle :
t 7→ φ0(t) est de classe C3([a, b]) et s’annule en 2 points distincts c1 , c2 6= x, x1, x2,
c1 , c2 ∈] min(x, x1, x2), max(x, x1, x2)[.
De plus
h
φ0(t) = f 0(x) − p0(x) − k(x)
i
2(t − x1)(t − x2)2 + 2(t − x1)2(t − x2)
,
ce qui entraˆıne φ0(x1) = 0 , φ0(x2) = 0.
t 7→ φ0(t) s’annule en 4 points distincts c1 , c2 , x1, x2.
t 7→ φ00(t) est de classe C2([a, b]) et admet 3 racines distinctes d1 , d2 , d3 chacune appar-
tenant a l’intervalle ]zi, zk[ ou zi, zk ∈ {c1 , c2 , x1, x2}.
t 7→ φ(3)(t) est de classe C1([a, b]) et admet 2 racines distinctes e1 , e2 chacune appartenant
a l’intervalle ]yi, yk[ ou yi , yk ∈ {d1 , d2 , d3}.
t 7→ φ(4)(t) est de classe C0([a, b]) et admet 1 racine ξ ∈]e1 , e2[⊂]a, b[.
6
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
On a
0 = φ(4)(ξ) = f (4)(ξ) − p(4)(ξ) − (4!) k(x) .
(2.2)
Comme p ∈ P3, on a p(4) = 0. Des ´equations (2.1) et (2.2), on d´eduit
f (x) − p(x)
(x − x1)2(x − x2)2 = k(x) =
f (4)(ξ)
4!
, pour x 6= x1, x2.
(2.3)
D’o`u le r´esultat.
c. Trouver une base (A1, A2, B1, B2) de P3 telle que
p(x) = f (x1)A1(x) + f (x2)A2(x) + f 0(x1)B1(x) + f 0(x2)B2(x) .
et exprimer cette base en fonction des polynˆomes d’interpolation de Lagrange
L1 et L2.
La condition p(x1) = f (x1) s’´ecrit :
f (x1)A1(x1) + f (x2)A2(x1) + f 0(x1)B1(x1) + f 0(x2)B2(x1) = f (x1) ,
ou encore
h
f (x1)
A1(x1) − 1
i
+ f (x2)A2(x1) + f 0(x1)B1(x1) + f 0(x2)B2(x1) = 0 .
Ce qui s’´ecrit encore :
A1(x1) = 1 ,
A2(x1) = 0 ,
B1(x1) = 0 ,
B2(x1) = 0 .
De mˆeme de p(x2) = f (x2), on obtient
A1(x2) = 0 ,
A2(x2) = 1 ,
B1(x2) = 0 ,
B2(x2) = 0 .
De la mˆeme fa¸con, les conditions p0(x1) = f 0(x1) , p0(x2) = f 0(x2) s’´ecrivent :
A0
A0
B0
B0
1(x1) = 0 ,
2(x1) = 0 ,
1(x1) = 1 ,
2(x1) = 0 ,
A0
A0
B0
B0
1(x2) = 0 ,
2(x2) = 0 ,
1(x2) = 0 ,
2(x2) = 1 .
7
(2.4)
(2.5)
(2.6)
(2.7)
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
Les relations (2.4), (2.5), (2.6) et (2.7) peuvent se r´esumer en :
A1(x1) = 1 ,
A0
1(x1) = 0 ,
A1(x2) = 0 ,
A0
1(x2) = 0 ,
A2(x1) = 0 ,
A0
2(x1) = 0 ,
A2(x2) = 1 ,
A0
2(x2) = 0 ,
B1(x1) = 0 ,
B0
1(x1) = 1 ,
Publicité
B1(x2) = 0 ,
B0
1(x2) = 0 ,
B2(x1) = 0 ,
B0
2(x1) = 0 ,
B2(x2) = 0 ,
B0
2(x2) = 1 .
Comme A1 ∈ P3, les relations (2.8) s’expriment par :
A1(x) = (ax + b) (x − x2)2 ,
1 = (ax1 + b) (x1 − x2)2 ,
0 = a(x1 − x2)2 + 2(x1 − x2)(ax1 + b) ,
d’o`u on tire a = −
Et donc
2
(x1 − x2)3 et b =
A1(x) = −
Par sym´etrie on obtient
1
(x1 − x2)2 +
2(x − x1)(x − x2)2
(x1 − x2)3
2x1
(x1 − x2)3 =
(x − x2)2
(x1 − x2)2 .
+
3x1 − x2
(x1 − x2)3 .
A2(x) = −
2(x − x2)(x − x1)2
(x2 − x1)3
+
(x − x1)2
(x2 − x1)2 .
Pour calculer B1, de (2.10) on a
B1(x) = (ax + b) (x − x2)2 ,
0 = (ax1 + b) (x1 − x2)2 ,
1 = a(x1 − x2)2 + 2(x1 − x2)(ax1 + b) .
Donc a =
1
(x1 − x2)2 et b = −ax1 = −
x1
(x1 − x2)2 .
8
(2.8)
(2.9)
(2.10)
(2.11)
(2.12)
(2.13)
(2.14)
(2.15)
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
D’o`u
Par raison de sym´etrie on a
B1(x) =
(x − x1)(x − x2)2
(x1 − x2)2
B2(x) =
(x − x2)(x − x1)2
(x2 − x1)2
.
.
(2.16)
(2.17)
Expression de A1, A2, B1, B2 en fonction des polynˆomes de Lagrange
On a
d’o`u
L1(x) =
x − x2
x1 − x2
et L1(x) =
x − x1
x2 − x1
,
A1(x) = −2(x − x1)
(cid:18)
1
x1 − x2
(cid:19)
×
(cid:18) x − x2
x1 − x2
(cid:19)2
= (cid:2)1 − 2(x − x1)L0
1(x)(cid:3) (L1(x))2 ,
A2(x) = (cid:2)1 − 2(x − x2)L0
2(x)(cid:1)](L2(x))2 ,
(2.18)
B1(x) = (x2 − x1)
(cid:16) x − x1
x1 − x2
= (x2 − x1) (L1(x))2 ,
(cid:17)
×
(cid:17)2
(cid:18) x − x2
x1 − x2
B2(x) = (x1 − x2) (L2(x))2 .
d. D´ecrire les polynˆomes d’interpolation de Hermite dans le cadre g´en´eral.
Polynˆomes d’interpolation de Hermite dans le cadre g´en´eral
On se donne une fonction f et on cherche un polynˆome p ∈ P2n−1 tel que
Alors on a
p(xi) = f (xi) , i = 1, .., n ,
p0(xi) = f 0(xi) , i = 1, .., n
p(x) =
n
X
i=1
f (xi)Ai(x) + f 0(xi)Bi(x) ,
o`u la base (Ai , Bi) est donn´ee par
Ai(x) = (cid:2)1 − 2(x − xi)L0
Bi(x) = (x − xi) (Li(x))2 .
i(xi)(cid:3) (Li(x))2 ,
9
Universit´e de Nice Sophia-Antipolis
Licence L3 Math´ematiques
Ann´ee 2008/2009
En effet, la base (Ai , Bi) polynˆomes de P2n−1 est cherch´ee telle que
Ai(xj) = δij , A0
i(xj) = 0 ,
i, j = 1, .., n ,
Bi(xj) = 0 , B0
i(xj) = δij ,
i, j = 1, .., n .
(2.19)
Ce qui sugg`ere de prendre (Ai , Bi) de la forme
Ai(x) = (Li(x))2 (ai(x − xi) + ci) ,
Bi(x) = (Li(x))2 (bi(x − xi) + di) .
Pour chaque i ∈ {1, .., n} les conditions (2.19) en xi s’´ecrivent
1 = Ai(xi) = ci , 0 = A0
i(xi) = Li(xi) (2ciL0
i(xi) + aiLi(xi)) ,
0 = Bi(xi) = di , 1 = B0
i(xi) = Li(xi) (2diL0
i(xi) + biLi(xi)) .
Ce qui donne
ci = 1 , ai = −2L0
i(xi) ,
bi = 1 ,
di = 0 .
Si f est de classe C2n, alors il existe ξ ∈
i
min (x, (xi)i=1,..,n) , max (x, (xi)i=1,..,n)
h
tel que
f (x) − p(x) =
f (2n)(ξ)
(2n)!
(cid:16)
Πn
j=0
x − xj
(cid:17)2
.
10