Lectures1-Chapter III
Lectures1-Chapter III
Lectures1-Chapter III
1
Chapter 2
Chapter 2 : Numerical
resolution of an algebraic
equation
2
Chapter 3
Chapter 3 : Interpolation
and Approximation
3.1 Introduction
One of the most useful and well-known classes of functions mapping the set of
real numbers into itself is the algebraic polynomials, the set of functions of the
form
P
n
Pn (x) = ak xk ;
k=0
3
Part I
Interpolation
4
3.2 Interpolation Problem
The basic interpolation problem can be posed in one of two ways:
1: Given a set of nodes fxi ; 0 i ng and corresponding data values
fyi ; 0 i ng, …nd the polynomial pn (x) of degree less than or equal to n,
such that
pn (xi ) = yi ; 0 i n:
2: Given a set of nodes fxi ; 0 i ng and a continuous function f (x), …nd
the polynomial pn (x) of degree less than or equal to n, such that
pn (xi ) = f (xi ); 0 i n:
Note that in the …rst case we are trying to …t a polynomial to the data, and in
the second we are trying to approximate a given function with the interpolating
polynomial.
pn (xi ) = yi ; 0 i n:
pn (xi ) = f (xi ); 0 i n:
1; if i = j;
Lni (xj ) = ij (x) = ; for all 0 j n;
0; if i 6= j;
5
Then, for all j : 0 j n we obtain
n
X
pn (xj ) = ij (x) yi = yi :
k=0
Thus, the interpolation conditions are satis…ed, and it remains only to prove
the uniqueness of the polynomial.
To this end, assume that there exists a second interpolation polynomial qn
of degree less than or equal to n.
Then
rn (xi ) = pn (xi ) qn (xi ) = 0; 8i : 0 i n:
Thus, rn (x) is a polynomial of degree less than or equal to n that has n + 1
roots, which implies that rn (x) = 0: Consequently,
pn (x) = qn (x) ;
Example 4 To illustrate this construction let f (x) = ex and consider the prob-
lem of constructing an approximation to this function on the interval [ 1; 1],
using the nodes :
1
x0 = 1; x1 = 2 ; x2 = 0; x3 = 21 ; x4 = 1:
Solution 5 Using
Q
4 x xk
L4i (x) = ;0 i 4
k=0;k6=i xi xk
to have
x x1 x x2 x x3 x x4
L40 (x) = =
x0 x1 x0 x2 x0 x3 x0 x4
2 1 1
= 3 x+ 2 (x) x 2 (x 1) ;
x x0 x x2 x x3 x x4
L41 (x) = =
x1 x0 x1 x2 x1 x3 x1 x4
8 1
= 3 (x + 1) (x) x 2 (x 1) ;
6
x x0 x x1 x x3 x x4
L42 (x) = =
x2 x0 x2 x1 x2 x3 x2 x4
1 1
= 4 (x + 1) x + 2 x 2 (x 1) ;
x x0 x x1 x x2 x x4
L43 (x) = =
x3 x0 x3 x1 x3 x2 x3 x4
8 1
= 3 (x + 1) x + 2 (x) (x 1) ;
x x0 x x1 x x2 x x3
L44 (x) = =
x4 x0 x4 x1 x4 x2 x4 x3
2 1 1
= 3 (x + 1) x + 2 (x) x 2 :
3 3
y y
2 2
1 1
-1.0 -0.5 0.0 0.5 1.0 -1.0 -0.5 0.0 0.5 1.0
x x
p4 (x) exp(x)
y 4
7
Example 6 Find the polynomial of degree 2 that interpolates at the data points
xi 0 1 4
yi 1 2 2
Use this polynomial to approximate f (2):
Solution 7 We have
2
X 2
Y x xk
p2 (x) = L2i (x)yi ; where L2i (x) = ; i = 0; 1; 2:
i=0
xi xk
k=0;k6=i
Thus, we get
1 2
p2 (x) = 4x + 54 x + 1:
So,
f (2) ' p2 (2) = 52 :
p0 (x) = a0 = f (x0 ) ;
pn+1 (x) = pn (x) + an+1 n (x);
where
Q
n
n (x) = (x xi ) ;
i=0
f (xn+1 ) pn (xn+1 )
an+1 = n (xn+1 )
;
8
Proof. Since we know that the interpolation polynomial is unique, all we have
to do is show that pn+1 , as given in this theorem, satis…es the interpolation
conditions.
For all k = 0; 1; :::; n we have
n (xk ) = 0;
so
pn+1 (xk ) = pn (xk ) + an+1 n (xk ) = pn (xk ):
| {z }
=0
Hence, pn+1 interpolates f at all nodes xi ; i = 0; 1; :::; n but the last point.
So, it remains to check the interpolation at point xn+1 ; thus we have
f [x0 ; x1 ; : : : ; xn ] :
So,
f (x1 ) f (x0 )
f [x0 ; x1 ] = :
x1 x0
9
For 2nd order, we get
Thus,
f [x1 ; : : : ; xn ] f [x0 ; : : : ; xn 1]
f [x0 ; x1 ; : : : ; xn ] = ; for all n 2:
(xn x0 )
Example 11 1) Use the Newton divided di¤ erences to …nd the polynomial of
degree 2 that interpolates f at the following data points
xi 0 1 4
f (xi ) 1 2 2
2) Deduce the polynomial of degree 3 by adding a new point x3 = 5; y4 = 3:
Solution 12 1)
0 1
2 1
f [x0 ; x1 ] = 1 0 =1
0 1 1
1 2 f [x0 ; x1 ; x2 ] = 4 0 = 4
2 2
f [x1 ; x2 ] = 4 1 =0
4 2
Thus,
1
p2 (x) = 1 + (x 0) (x 0)(x 1) =
4
1 2 5
= x + x+1
4 4
2) To deduce p3 , we consider the following divided di¤ erences
0 1
2 1
f [x0 ; x1 ] = 1 0 =1
0 1 1
1 2 f [x0 ; x1 ; x2 ] = 4 0 = 4
1 1
2 2 4+4 1
f [x1 ; x2 ] = 4 1 =0 f [x0 ; x1 ; x2 ; x3 ] = 5 0 = 10
1 0 1
4 2 f [x1 ; x2 ; x3 ] = 5 1=4
3 2
f [x2 ; x3 ] = 5 4= 1
5 3
10
So,
11