Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Numerical Analysis

Prof. K. Jbilou
jbilou@univ-littoral.fr

M1, EILCO, France

Khalide Jbilou (LMPA, ULCO) 1 / 31


General Outline

1 Interpolation
2 Quadrature-Orthogonal Polynomials
3 Systems of differential equations
4 Fourier-Laplace transforms
5 Basic Linear algebra
6 Linear Systems I: Classical Iterative Methods
7 Linear Systems II: Direct Methods
8 Conjugate Gradients Methods

Khalide Jbilou (LMPA, ULCO) 2 / 31


Chapter I: Polynomial Interpolation

The problem: Existence-Uniqueness


Langrange basis
Neuville-Aitken scheme
Divided differences
The Newton basis

Khalide Jbilou (LMPA, ULCO) 3 / 31


The Interpolation Problem

It is often needed to estimate the value of a function f at certain point x


based on the known values of the function f at given points x0 , . . . , xn in
the interval [a, b].
This process is called interpolation. One way to carry out these operations
is to approximate the function f by an n-th degree polynomial Pn . Once
this polynomial is available, any operation applied to f , such as
differentiation, integration, and root finding, can be carried out
approximately based on Pn (x) ≈ f (x).
This is particularly useful if f is non-elementary and therefore difficult to
manipulate, or it is only available as a set of discrete samples without a
closed-form expression.

Khalide Jbilou (LMPA, ULCO) 4 / 31


Let x0 , . . . ,xn be fixed n + 1 points in [a, b], and let y0 , . . . , yn be real or
complex given values.
The problem is how to construct a polynomial Pn of degree at most n and
satisfying the following interpolation conditions

Pn (xi ) = yi , for i = 0, . . . , n. (1)


The polynomial Pn can be written in the canonical basis as follows
n
X
Pn (x) = ai x i (2)
i=0

where the coefficients ai are determined from the interpolation conditions


Interpolation conditions
n
X
Pn (xj ) = ai xji = yj , for j = 0, . . . , n. (3)
i=0

Khalide Jbilou (LMPA, ULCO) 5 / 31


Therefore, the coefficients ai ’s are solution of the following linear system
of equation

a0 + a1 x0 + . . . an x0n = y0


a0 + a1 x1 + . . . an x1n = y1


(4)

 .................. = ...
a0 + a1 xn + . . . an xnn = yn

The principal of the determinant corresponding to this linear system is


called ”Vandermonde” determinant and is given by

1 x0 . . . x0n
1 x1 . . . x1n
V (x0 , . . . , xn ) = .. .. . . . . (5)
. . . ..
1 xn . . . xnn

Khalide Jbilou (LMPA, ULCO) 6 / 31


The value of this determinant is given by
Y
V (x0 , . . . , xn ) = (xj − xi ).
0≤i<j≤n

Then, the coefficients a0 , a1 , . . . , an exist and are unique if and only if the
Vandermonde determinant is non zero which is equivalent to the main
condition:
xi 6= xj , i 6= j. (6)
We finally have the following main result
Theorem
A necessary and sufficient condition for the existence of a unique
interpolation polynomial Pn of degree at most n and satisfying the
interpolation (3) is that the n + 1 points x0 , . . . , xn are different.

From now on, we assume that the conditions of Theorem 1 are satisfied.

Khalide Jbilou (LMPA, ULCO) 7 / 31


The expression of Pn in the Lagrange Basis

Next, we will express the interpolation polynomial Pn in different bases


allowing a ”good” numerical computation of this polynomial. We first
start with the Lagrange basis.
We consider the Lagrange polynomial Li , i = 0, . . . , n of degree n defined
by
Li (xj ) = δi,j , for i, j = 0, . . . , n
where δi,j is the Kronecker symbol defined by δi,j = 1 for i = j and δi,j = 0
elsewhere.
The polynomials Li are called the Lagrange polynomials associated to the
points x0 , . . . , xn .

Khalide Jbilou (LMPA, ULCO) 8 / 31


As Li (xj ) = 0 for j 6= i, the Lagrange polynomial Li is divided by x − xj if
j 6= i. So we know n divisors of the polynomial Li de degree n. Therefore
n
Y
Li (x) = λi . (x − xj ).
j=0j6=i

1
The condition Li (xi ) = 1 gives us the constant λi = Qn .
j=0j6=i (xi − xj )
Finally, the Lagrange polynomial Li is given by
Qn n
j=0,j6=i (x − xj ) x − xj
Y
Li (x) = Qn = for i = 0, . . . , n. (7)
j=0j6=i (xi − xj ) xi − xj
j=0,j6=i

Khalide Jbilou (LMPA, ULCO) 9 / 31


It is easy to show that {L0 , . . . , Ln } is a basis of the vector space Pn of the
polynomial of degree at most n. This basis is called the Lagrange basis of
Pn . Then every polynomial Q in Pn , can be written as

n
X
∀x ∈ IR, Q(x) = Q(xi )Li (x). (8)
i=0

In particular, the interpolation polynomial satisfying the conditions (3),


can be expressed as
n
X
∀x ∈ [a, b], Pn (x) = yi Li (x). (9)
i=0

Khalide Jbilou (LMPA, ULCO) 10 / 31


The expression of the Error-Interpolation

Assume now that the yi ’s are the values of an unknown function f at the
points xi . We also assume that the function f is of class C n+1 ([a, b]). Let
x be a fixed point in [a, b] (x 6= xi ) and introduce the function F by
n
Y
F (t) = f (t) − Pn (t) − K (x) (t − xi ), t ∈ [a, b]
i=0

where K (x) is a constant depending on x and such that F (x) = 0.


The F is C n+1 ([a, b]) and takes the value zero for the n + 2 points
x0 , . . . , xn , x.
Therefore, using the classical Rolle’s theorem, the derivative F 0 of F has at
least n + 1 zeros.

Khalide Jbilou (LMPA, ULCO) 11 / 31


Applying again this last theorem to F 0 , shows that F 00 has at least n zeros
and finally the function F (n+1) has at least one zero
ξx ∈] min(x0 , . . . , xn , x), max(x0 , . . . , xn , x)[. Since

F (n+1) (t) = f (n+1) (t) − K (x) (n + 1)!, ∀t ∈ [a, b],

f (n+1) (ξx )
the condition F (n+1) (ξx ) = 0 implies K (x) = (n+1)! .

The relation F (x) = 0 gives the following expression of the interpolation


error
n
f (n+1) (ξx ) Y
E (x) = f (x) − Pn (x) = (x − xi ).
(n + 1)!
i=0

Notice that if x = xi we get E (xi ) = 0.

Khalide Jbilou (LMPA, ULCO) 12 / 31


We can state the main theorem
Theorem
Let f : [a, b] 7→ IR be a function defined on [a, b] and let x0 , . . . , xn , n + 1
be n + 1 distinct points in [a, b] . Then there exists a unique polynomial
Pn of degree at most n satisfying the interpolation conditions

Pn (xi ) = f (xi ), pour i = 0, . . . , n.

This polynomial Pn is given by the Lagrange formulae as


n
X
Pn (x) = f (xi )Li (x) ∀x ∈ IR.
i=0

If f is in C n+1 ([a, b]), then for all x ∈ [a, b], there exists an
ξx ∈] min(x0 , . . . , xn , x), max(x0 , . . . , xn , x)[ such that the error E (x) is
given by
n
f (n+1) (ξx ) Y
E (x) = f (x) − Pn (x) = (x − xi ).
(n + 1)!
i=0
Khalide Jbilou (LMPA, ULCO) 13 / 31
The Neville-Aitken algorithm

The polynomial Pn can be computed for an x ∈ [a, b] by using the


Neville-Aitken’s algorithm described as follows.
Let f be a function and let Pn the interpolation polynomial of f at the
given points x0 , . . . , xn .
(m)
We denote by Pk the interpolation polynomial of degree ≤ k, of the
function f at the (k + 1) points points: xm , xm+1 , . . . , xm+k with
0 ≤ k ≤ n et 0 ≤ m ≤ n − k. This polynomial exists and is unique and for
m = 0, . . . , n, we have
(m)
P0 (x) = f (xm ). (10)
(m)
In fact, P0 is of degree 0 interpolating f at xm and for k = 1, . . . , n;
m = 0, . . . , n − k, and

(0)
Pn (x) = Pn (x). (11)

Khalide Jbilou (LMPA, ULCO) 14 / 31


(m)
The polynomial Pk can be computed recursively by the following
Neuville-Aitken relation
(m+1) (m)
(m) (x − xm )Pk−1 (x) − (x − xm+k )Pk−1 (x)
Pk (x) = , (12)
xm+k − xm

Therefore, the polynomial Pn is obtained as


(0)
Pn (x) = Pn (x).

Khalide Jbilou (LMPA, ULCO) 15 / 31


The Neuville-Aitken scheme for computing Pn (x) is as follows
(0)
P0 (x)
(0)
P1 (x)
(1) (0)
P0 (x) P2 (x)
(1) (0)
P1 (x) P3 (x)
(2) .. (1) ..
P0 (x) . P2 (x) .
.. .. .. (1) ..
. . . P3 (x) .
.. .. .. .. (0)
. . . . Pn (x) = Pn (x)
.. .. .. .. .
. . . . ..
.. .. .. .
P0
(n−3)
(x) . . . ..
(n−2) .. (n−3)
P1 (x) . P3 (x)
(n−1) (n−2)
P0 (x) P2 (x)
(n−1)
P1 (x)
(n)
P0 (x)
Khalide Jbilou (LMPA, ULCO) 16 / 31
Divided differences
(m)
Let ak be the coefficient corresponding to the highest degree of the le
(m)
polynomial Pk given earlier.
It is clear that for m = 0, . . . , n, we have
(m)
a0 = f (xm ). (13)

By identification in the relatio(12), for k = 1, . . . , n and m = 0, . . . , n − k,


we get
(m+1) (m)
(m) a − ak−1
ak = k−1 . (14)
xm+k − xm
(m)
Notation: The coefficients ak are denoted by [xm , xm+1 , . . . , xm+k ]f .
They are called divided differences of order k of the function f at the
points xm , xm+1 , . . . , xm+k .
We notice that [xm , xm+1 , . . . , xm+k ] is conserved for any permutation of
the interpolation points xm , xm+1 , . . . , xm+k ].
Khalide Jbilou (LMPA, ULCO) 17 / 31
The divided differences could be computed by the formulas (13) and (14).
The scheme is similar to the Neuville-Aitken scheme and is described as
follows
f (x0 )
[x0 , x1 ]f
f (x1 ) [x0 , x1 , x2 ]f
[x1 , x2 ]f
.. ..
f (x2 ) . [x1 , x2 , x3 ]f .
.. .. .. ..
. . . .
.. .. ..
. . . [x0 , x1 , . . . , xn ]f
.. .. .. ..
. . . .
.. .
[xn−2 , xn−1 ]f . ..
f (xn−1 ) [xn−2 , xn−1 , xn ]f
[xn−1 , xn ]f
f (xn )

Khalide Jbilou (LMPA, ULCO) 18 / 31


The Newton basis

Let {ν0 , ν1 , . . . , νn } be the family of the following polynomials

i−1
Y
ν0 (x) = 1 et νi (x) = (x − xj ), pour 1 ≤ i ≤ n.
j=0

It is not difficult to show that it is a basis of the vector space Pn . This


basis is called the Newton basis associated to the points x0 , . . . , xn .
(0) (0)
Let Qk (x) = Pk (x) − Pk−1 (x) be the polynomial of degree less or equal
to k. The coefficient corresponding to the highest degree is
(0)
ak = [x0 , x1 , . . . , xk ]f .
This polynomial Q vanishes at x0 , . . . , xk−1 , and then can be written as

k−1
(0) (0)
Y
Q(x) = Pk (x) − Pk−1 (x) = [x0 , x1 , . . . , xk ]f (x − xi ).
i=0

Khalide Jbilou (LMPA, ULCO) 19 / 31


Then summing this last equation from k = 1 to k = n, we get
n k−1
(0) (0)
X Y
Pn (x) = P0 (x) + [x0 , x1 , . . . , xk ]f (x − xi ).
k=1 i=0

(0) (0)
But since Pn (x) = Pn (x) et P0 (x) = f (x0 ) = [x0 ], we deduce the
formulae
n
X k−1
Y
Pn (x) = f (x0 ) + [x0 , x1 , . . . , xk ]f (x − xi )
k=1 i=0

called the Newton interpolation formulae and can be also written as


n
X
Pn (x) = [x0 , x1 , . . . , xk ]f νk (x).
k=0

Khalide Jbilou (LMPA, ULCO) 20 / 31


Now, we give another expression for the error interpolation. Let x ∈ [a, b]
with x 6= xi for i = 0, . . . , n and set xn+1 = x.
Then there exists a unique polynomial R of degree ≤ n + 1 interpolating
the function f at the n + 2 distinct points x0 , . . . , xn , xn+1 .
This polynomial is given by the Newton formulae as follows
n+1
X k−1
Y
R(t) = f (x0 ) + [x0 , x1 , . . . , xk ]f (t − xi ),
k=1 i=0

also written as

n
Y
R(t) = Pn (t) + [x0 , x1 , . . . , xn , x] (t − xi ). (15)
i=0

Khalide Jbilou (LMPA, ULCO) 21 / 31


Now as R(x) = f (x), and by taking t = x in (15) we get the new
expression of the error at the point x ∈ [a, b] as

The Newton Error Formulae


n
Y
E(x) = f(x) − Pn (x) = [x0 , . . . , xn , x]f (x − xi ).
i=0

Khalide Jbilou (LMPA, ULCO) 22 / 31


EXERCICES

Exercice 1 Show that the Vandermonde determinant satisfies :


1 x0 . . . x0n
1 x1 . . . x1n Y
V (x0 , . . . , xn ) = .. .. . . . = (xj − xi ). (16)
. . . .. 0≤i<j≤n
1 xn . . . xnn

Exercice 2 Give the expressions of the polynomial P(x) = 1 − x − x 2 in


the Lagrange and in the Newton bases at the points: x0 = −1, x1 = 2,
x2 = 3. Z x
2 2
Exercice 3 Let f (x) = √ e −t dt. Given the values
π 0
f (1) = 0.84270066, f (2) = 0.99532240, f (3) = 0.99997794 and f (4) = 1.
give an approximation of f (1, 5), using the interpolation polynomial of
degree ≤ 3.

Khalide Jbilou (LMPA, ULCO) 23 / 31


Exercice 4 Let x0 , x1 , . . . , xn , (n + 1) distinct points in IR and let Li be the
Lagrange polynomial associated to the points xi , i = 0 . . . , n.
1 Show that for any integer k with 0 ≤ k ≤ n, we have
n
X
xik Li (x) = x k , ∀x ∈ IR.
i=0

2 Show that every polynomial P of degree ≤ n can be written as


n
X αi
P(xi )
x − xi 1
i=0
P(x) = n avec x 6= xi et αi = n
X αi Y
(xi − xj )
x − xi
i=0 j=0j6=i

Khalide Jbilou (LMPA, ULCO) 24 / 31


Exercice 5
1 Exprimer le polynôme de degré ≤ 4 vérifiant :

P(−1) = 1, P(0) = 3, P(2) = 5, P(3) = 1 et P(5) = 7

en utilisant
1 la base de Lagrange,
2 la base de Newton.
2 On considère les fonctions f (x) = e 3x et g (x) = cos x définies sur le
segment [0, 1].
1 Formuler pour chacune des fonctions l’erreur d’interpolation
polynomiale associée puis une majoration de cette erreur.
2 Quel est alors, pour chacune des fonctions, le nombre de points
minimum du support d’interpolation permettant à l’erreur
d’interpolation polynomiale d’être inférieure à 10−2 puis 10−3 ?

Khalide Jbilou (LMPA, ULCO) 25 / 31


Exercice 6 Soit f une fonction définie sur l’intervalle [a, b]. Considérons
une subdivision (xi )ni=0 formée de n + 1 points distincts de [a, b]. Montrer
que les polynômes (Li )ni=0 formant la base de Lagrange associée vérifient
les relations suivantes ou k ∈ {0, . . . , n} :
Xn
1 xik Li (x) = x k
i=0
n
X xik
2 Q = δkn
i=0 j6=i (xi − xj )
n
X
3 (xi − x)k Li (x) = δ0k
i=0
n
X f (x i )
4 f [x0 , x1 , . . . , xn ] = Q
i=0 j6=i (xi − xj )

Khalide Jbilou (LMPA, ULCO) 26 / 31


Exercice 7 Soit Tn la suite de fonctions données pour x ∈ R par :

T0 (x) = 1

T1 (x) = x

Tn+1 (x) = 2xTn (x) − Tn−1 (x), pour n ≥ 1

1 Montrer que pour tout n ∈ N, Tn est un polynôme (polynôme de


Tchebychev). Déterminer son degré et son coefficient dominant.
2 Montrer que pour tout x ∈ [−1, 1] et n ∈ N, on a
Tn (x) = cos(n arccos x).
3 Montrer que le polynôme Tn possède n racines réelles notés (tk )n−1
k=0
et n + 1 points extremums notés (tk0 )nk=0 sur l’intervalle [−1, 1]. Les
racines de Tn sont appelées points de Tchebychev d’ordre n sur
[−1, 1].

Khalide Jbilou (LMPA, ULCO) 27 / 31


1 Effectuer un changement de variable pour ramener [−1, 1] à un
intervalle [a, b] quelconque. Écrire les points de Tchebychev sur
l’intervalle [a, b].
2 Soit f ∈ C n+1 ([a, b]) et Pn le polynôme interpolant f aux points de
Tchebychev d’ordre n + 1 de l’intervalle [a, b]. Montrer la majoration

Mn (b − a)n+1
|f (x) − Pn (x)| ≤ , où Mn = sup |f (n+1) (x)| .
(n + 1)! 22n+1 x∈[a,b]

3 Montrer que la majoration ci-dessus est optimale parmi tous les choix
possibles de points d’interpolation.

Khalide Jbilou (LMPA, ULCO) 28 / 31


Exercice 8 Soit n ∈ N∗ et f une fonction de classe C 1 sur [0, 1], et soit Hn
son polynôme d’interpolation de Hermite aux points (xi )ni=0 ⊂ [0, 1], c’est
à dire le polynôme vérifiant Hn ∈ P(2n + 1) et pour tout i ∈ {0, . . . , n} :
Hn (xi ) = f (xi ) et Hn0 (xi ) = f 0 (xi ) .

1 Montrer qu’un tel polynôme existe et est unique.


2 Quelles conditions suffisantes sur les polynômes Hi et Ki permettent
l’égalité :
Xn n
X
Hn (x) = f (xi )Hi (x) + f 0 (xi )Ki (x) .
i=0 i=0
3 Écrire ces polynômes Hi et Ki à l’aide des polynômes Li de la base de
Lagrange.
4 On suppose que f est une fonction de classe C 2(n+1) et on se propose
d’estimer l’erreur en (x) = f (x) − Hn (x). Pour tout x différent de xi
pour tout i ∈ {0, . . . , n} on pose
n
Y (t − xi )2
F (t) = f (t) − Hn (t) − en (x)
Khalide Jbilou (LMPA, ULCO) (x − xi )2 29 / 31
Soit f ∈ C 4 ([0, 1]) et soit H1 son polynôme d’interpolation d’Hermite aux
points 0 et 1. Pour tout [a, b] ∈ R, a < b on fixe

b−a
h= , xj = a + jh , 0≤j ≤n.
n
Soit g la fonction polynomiale telle que g |[xj ,xj+1 ] soit l’interpolant cubique
de Hermite de f |[xj ,xj+1 ] .
1 Écrire g |[xj ,xj+1 ] en fonction de H1 .
2 Quelle est la classe de g ?
3 Évaluer maxx∈[a,b] |f (x) − g (x)| en fonction de h et de
maxx∈[a,b] |f (4) (x)|.

Khalide Jbilou (LMPA, ULCO) 30 / 31

You might also like