0% found this document useful (0 votes)
3 views

CHAPTER3-Polynomial Inetrpolation

Uploaded by

fzahrakihel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CHAPTER3-Polynomial Inetrpolation

Uploaded by

fzahrakihel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

3 Polynomial Interpolation

Consider, for example, an experiment where the distance traveled by an object is


recorded as a function of time. The results are given in the following table:

Time t (sec) 0 1 2 3 4
Distance X (m) 0 5 15 0 3
We want to calculate the position of the object at t = 3.25 seconds or the speed of
the object at a given time. To do this, we need an analytical form of X as a function
of t, denoted X(t). This form must at least
R 4 coincide with the points provided in the
dX
table. We can then calculate X(3.25), 0 X(t) dt, or the velocity v(t) = dt (t).
In this chapter, we will consider the approximation of X(t) by a polynomial
form, specifically:

X(t) = a0 + a1 t + a2 t2 + · · · + an tn
where ai (for i = 0, n) are coefficients to be determined. The polynomials we will
study differ only in the method used to determine the coefficients ai (for i = 0, n),
because for a given table of values, the interpolation polynomial is unique.

Interpolating Polynomial
Polynomial Interpolation
Interpolation Points
3

1
f(x)

0
(1, 0) (2, 0)
−1 (−2, 0)

−2
−1 0 1 2 3
x

Figure 3.1: Graph of a polynomial interpolation based on given points.

37
Numerical Analysis

3.1 Polynomial Interpolation Problem


Let f be a function known only at (n + 1) distinct points

M0 (x0 , f (x0 )), M1 (x1 , f (x1 )), . . . , Mn (xn , f (xn )),

where the abscissas (xi )ni=0 are distinct, i.e., xi 6= xj for all i 6= j. The polynomial
interpolation problem consists of finding a polynomial P ∈ Pn [X] whose graph
passes through these (n + 1) points. In other words, we seek P ∈ Pn [X] such that:

P (xi ) = f (xi ), for all i = 0, 1, . . . , n.

3.1.1 Cases Based on the Number of Points


• If there are only two points M0 (x0 , f0 ) and M1 (x1 , f1 ), where f0 , f1 ∈ R, the
interpolating polynomial is of degree at most 1. Thus, we are looking for a
line of the form:
P (x) = ax + b, where a, b ∈ R.

• If there are three points M0 (x0 , f0 ), M1 (x1 , f1 ), M2 (x2 , f2 ), the interpolating


polynomial will be of degree at most 2, i.e., of the form:

P (x) = ax2 + bx + c, where a, b, c ∈ R.

• In general, if there are (n + 1) points, then the polynomial P interpolating


these (n + 1) points will be of degree at most n, satisfying:

P (xi ) = f (xi ), for i = 0, 1, . . . , n.

If the function f is not explicitly known, we denote fi = f (xi ). The polynomial


P ∈ Pn [X] can be written as:

P (x) = C0 + C1 x + · · · + Cn xn , for all x ∈ R,

where C0 , C1 , . . . , Cn ∈ R.

Remark

1. To determine the interpolating polynomial P , it is necessary and suffi-


cient to compute its coefficients Ci , i = 0, 1, . . . , n.

2. One can interpolate (or approximate using a polynomial) a known func-


tion f (explicitly given), such as sin, arctan, ln, exp, etc., to estimate
(or compute) the approximate value of the function at a given point
x ∈ Df , where x 6= xi for all i = 0, . . . , n. To determine the coefficients
Ci , a table of the following form is needed:

xi x0 ... xn
f (xi ) f (x0 ) . . . f (xn )

38
Numerical Analysis

Theorem:Existence and Uniqueness of the Interpolant

Let f be a function known at (n + 1) distinct points (xi , f (xi ))ni=0 , where the
(xi )ni=0 are distinct. Then, there exists a unique polynomial Pn ∈ Pn [X] such
that:
Pn (xi ) = f (xi ), for all i = 0, . . . , n.
(Alternatively, Pn (xi ) = yi if the function f is not explicitly known.)

Proof. In general, we want to find a polynomial of degree ≤ n that interpolates the


nodes (xi , yi )ni=0 . Since Pn [X] is a vector space with the canonical basis {1, X, X 2 , . . . , X n },
we can write: n
X
Pn (X) = ak X k , where a0 , a1 , . . . , an ∈ R.
k=0
We have the system of equations:


 Pn (x0 ) = y0

Pn (x1 ) = y1

..


 .

P (x ) = y
n n n

which translates to:




 a0 + a1 x0 + a2 x20 + · · · + an xn0 = y0

a0 + a1 x1 + a2 x2 + · · · + an xn = y1

1 1
..


 .

a + a x + a x 2 + · · · + a x n = y
0 1 n 2 n n n n

This can be written in matrix form as:


    
1 x0 x20 · · · xn0 a0 y0
1 x1 x21 · · · xn1   a1   y1 
..   ..  =  .. 
    
 .. .. .. . .
. . . . .  .   . 
1 xn xn · · · xnn
2
an yn

Therefore, the coefficients (ai ) of the interpolating polynomial can be obtained by


solving the linear system:
V a = y,
where Vi,j = xji for i, j ∈ {0, 1, . . . , n}, a = (a0 , a1 , . . . , an )T , and y = (y0 , y1 , . . . , yn )T ∈
Rn+1 .
The matrix V is known as the Vandermonde matrix, and its determinant is given
by: Y
det(V ) = (xj − xi ).
0≤i<j≤n

Since xi 6= xj for all i 6= j, it follows that det(V ) 6= 0. Consequently, the system


V a = y has a unique solution given by a∗ = V −1 y, where a∗ ∈ Rn+1 .

39
Numerical Analysis

This proves the existence and uniqueness of the interpolation polynomial Pn ,


where: n
X
Pn (X) = a∗k X k , for all X ∈ R.
k=0

Example
Let
f (0.2) = 0.5 (denote this as y0 )
and
f (0.6) = 1.5 (denote this as y1 ).
Our objective is to find the linear interpolation polynomial

P (x) = a0 + a1 x

using the Vandermonde matrix.

The Vandermonde matrix for the points x0 = 0.2 and x1 = 0.6 is:
   
1 x0 1 0.2
=
1 x1 1 0.6
Set Up the System of Equations
We can express the system of equations as:
      
1 0.2 a0 y 0.5
= 0 =
1 0.6 a1 y1 1.5
Solve the system
To solve the system, we need to find the inverse of the Vandermonde matrix and
multiply it by the vector of outputs.
   −1  
a0 1 0.2 0.5
=
a1 1 0.6 1.5

The inverse of the Vandermonde matrix:

 −1      
1 0.2 1 0.6 −0.2 1 0.6 −0.2 1.5 −0.5
= = =
1 0.6 0.6 − 0.2 −1 1 0.4 −1 1 −2.5 2.5

Now, multiplying by the vector


 
0.5
:
1.5
        
a0 1.5 −0.5 0.5 1.5 · 0.5 − 0.5 · 1.5 0
= = =
a1 −2.5 2.5 1.5 −2.5 · 0.5 + 2.5 · 1.5 2.5

40
Numerical Analysis

Write the Polynomial


Thus, we have:

a0 = 0 and a1 = 2.5.
The linear interpolation polynomial is:

P (x) = 0 + 2.5x = 2.5x.


The linear interpolation polynomial

P (x) = 2.5x

passes through the points (0.2, 0.5) and (0.6, 1.5). This polynomial can now be used
to estimate the value of the function at any x within the interval [0.2, 0.6].

3.2 Lagrange Interpolation


The Lagrange approach to constructing the interpolation polynomial is straight-
forward, systematic, and does not involve solving a linear system. We are given
n + 1 points (x0 , y0 ), . . . , (xn , yn ), with each xi distinct. The Lagrange interpolation
polynomial takes the form of a linear combination:
n
X
L(x) = y0 `0 (x) + y1 `1 (x) + . . . + yn `n (x) = yi `i (x)
i=0

where `i (x) are the Lagrange basis polynomials defined as:

n
Y x − xj (x − x0 ) (x − xi−1 ) (x − xi+1 ) (x − xn )
`i (x) = = ··· ···
x − xj
j=0 i
(xi − x0 ) (xi − xi−1 ) (xi − xi+1 ) (xi − xn )
j6=i

for i = 0, . . . , n. Note that under the initial assumption that no two xj are
identical, when i 6= j, xi − xj 6= 0, so this expression is always well-defined. For any
j 6= i, `i (x) includes the term (x − xj ) in the numerator, thus the entire product will
be zero at x = xj , meaning:
(
1 if i = j
`i (xj ) = δij =
0 if i 6= j
Consequently, yj `j (xj ) = yj , which shows that at each point xj ,

L(xj ) = ni=0 yi `i (xj ) = y1 `1 (xj ) + y2 `2 (xj ) + . . . + yj `j (xj ) + . . . + yn `n (xj )


P
= 0 + . . . + 0 + yj + 0 + . . . + 0
= yj

This demonstrates that L exactly interpolates the points (x0 , y0 ), . . . , (xn , yn ). It


is essential to note that the interpolation problem has a unique explicit solution L.

41
Numerical Analysis

Moreover, the polynomials `0 , . . . , `n are linearly independent. This means that


if
n
X
αi `i (xj ) = 0
i=0

for all x ∈ R, then it must follow that

α1 = α2 = . . . = αn = 0.

Since,
n
X
αi `i (xj ) = αj ,
i=0

we conclude that all αj must be zero. Therefore, the set {`0 , . . . , `n } forms a
basis for Pn , the vector space of polynomial functions over R with real coefficients,
of degree less than or equal to n.
From the above, we derive the following theorem.
Theorem
Given n + 1 points (x0 , y0 ), . . . , (xn , yn ). If the xi are distinct, then there
exists a unique polynomial pn of degree at most n such that pn (xi ) = yi for
i = 0, . . . , n, which can be expressed in the Lagrange form as
n
X
pn (x) = yi `i (x) (3.1)
i=0

where
n
Y x − xj
`i (x) = .
j=0
x i − x j
j6=i

Example

We want to find the polynomial p(x) that passes through the points : (1, 2),
(2, 3) and (3, 5).

We have:

x0 = 1, y0 = 2
x1 = 2, y1 = 3
x2 = 3, y2 = 5

The Lagrange basis polynomials `i (x) are defined as follows:

(x − x1 )(x − x2 ) (x − 2)(x − 3) (x − 2)(x − 3) (x − 2)(x − 3)


`0 (x) = = = =
(x0 − x1 )(x0 − x2 ) (1 − 2)(1 − 3) (−1)(−2) 2

42
Numerical Analysis

(x − x0 )(x − x2 ) (x − 1)(x − 3) (x − 1)(x − 3)


`1 (x) = = = = −(x − 1)(x − 3)
(x1 − x0 )(x1 − x2 ) (2 − 1)(2 − 3) (1)(−1)

(x − x0 )(x − x1 ) (x − 1)(x − 2) (x − 1)(x − 2) (x − 1)(x − 2)


`2 (x) = = = =
(x2 − x0 )(x2 − x1 ) (3 − 1)(3 − 2) (2)(1) 2
Now we can write the polynomial p(x) as:

p(x) = y0 `0 (x) + y1 `1 (x) + y2 `2 (x)


Substituting the values and combining the terms
(x−2)(x−3) (x−1)(x−2)
p(x) = 2 · 2
+ 3 · [−(x − 1)(x − 3)] + 5 · 2

= (x − 2)(x − 3) − 3(x − 1)(x − 3) + 52 (x − 1)(x − 2)

= x2 − 2x + 2

• If any of the yi values is zero, we do not need to calculate the corre-


sponding `i for that value (since the product yi `i (x) will be zero for all
x ∈ R).

• If we add another interpolation point xn+1 to the points x0 , x1 , . . . , xn ,


we must again determine `0 (x), `1 (x), . . . , `n (x) and add `n+1 (x). We
say that the Lagrange method does not adapt well to changes in points.

3.3 Newton Interpolation


Newton interpolation is a method used to estimate the values of a function based on
its known values at certain points. It constructs an interpolating polynomial using
a set of given data points. This method is particularly useful because it allows for
easy addition of new data points without recalculating the entire polynomial.
Let f : R → R be a continuous function, and consider n + 1 distinct points
x0 , x1 , . . . , xn . By defining yi = f (xi ) for i = 0, . . . , n, Newton’s interpolation is
given by
n
X
Pn (x) = a0 N0 (x) + a1 N1 (x) + . . . + an Nn (x) = ai Ni (x)
i=0

where the Newton basis polynomials are defined by:


N0 (x) = 1,
N1 (x) = x − x0 ,
N2 (x) = (x − x0 )(x − x1 ),
..
.
Qi−1
Ni (x) = (x − x0 )(x − x1 ) · · · (x − xi−1 ) = j=0 (x − xj ) for i = 0, . . . , n.

43
Numerical Analysis

It is clear that the family {Ni }ni=0 forms a basis for the space of polynomials of
degree less than or equal to n, since it is linearly independent.
To show linear independence, consider the equation:
n
X
αi Ni (x) = 0
i=0

for all x. We will evaluate this equation at the points xj for j = 0, . . . , n:


(
0 if i < j
Nj (xj ) =
(xj − x0 )(xj − x1 ) · · · (xj − xj−1 ) else
Substituting x = xj into the equation gives:

α0 N0 (xj ) + α1 N1 (xj ) + . . . + αn Nn (xj ) = 0.


Since Nj (xj ) is non-zero for j and zero for all i < j, we have:

αj Nj (xj ) = 0.
Since Nj (xj ) is non-zero, it follows that αj = 0. This reasoning holds for all j,
leading to the conclusion that all coefficients αi must be zero.
The problem of calculating the interpolation polynomial Pn , reduces to deter-
mining the coefficients ai such that:
n
X
Pn = ai Ni (x)
i=0

To determine the coefficients ai for i = 0, . . . , n, we must ensure that:

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


Evaluating the interpolation polynomial in the Newton basis at x0 gives:
n
X
Pn (x0 ) = ai Ni (x0 ) = a0 = f (x0 ).
i=0

Therefore, the first coefficient is:

a0 = f (x0 ).
Next, we need to satisfy the condition Pn (x1 ) = f (x1 ), which can be expressed
as:

a0 + a1 (x1 − x0 ) = f (x1 ).
This allows us to isolate a1 :

f (x1 ) − f (x0 )
a1 = .
x 1 − x0
For the third coefficient a2 , we use:

44
Numerical Analysis

Pn (x2 ) = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 ) = f (x2 ).


Isolating a2 yields:

f (x2 ) − a0 − a1 (x2 − x0 )
a2 = .
(x2 − x0 )(x2 − x1 )
This can be simplified to:

 
1 f (x2 ) − f (x1 ) f (x1 ) − f (x0 ) f (x1 ) − f (x0 ) x2 − x0
a2 = + − · .
x2 − x0 x2 − x1 x2 − x1 x1 − x0 x2 − x1

Before proceeding to calculate the remaining coefficients, we will introduce the


concept of divided differences.

Definition. We define the successive divided differences of the function f at the


points xi for i = 0, . . . , n using the following recurrence relations:

• **Order 0**: f [xi ] = f (xi ).


f (xi+1 )−f (xi )
• **Order 1**: f [xi ; xi+1 ] = xi+1 −xi
.

f [xi+1 ;xi+2 ]−f [xi ;xi+1 ]


• **Order 2**: f [xi ; xi+1 ; xi+2 ] = xi+2 −xi
.

f [xi+1 ;...;xi+k ]−f [xi ;...;xi+k−1 ]


• **Order k**: f [xi ; xi+1 ; . . . ; xi+k ] = xi+k −xi
.

Using this notation, we have:

a0 = f [x0 ];

f (x1 ) − f (x0 )
a1 = = f [x0 , x1 ];
x1 − x0

f (x2 ) − f (x1 ) f (x1 ) − f (x0 ) 1 f [x1 , x2 ] − f [x0 , x1 ]


a2 = − · = = f [x0 , x1 , x2 ].
x2 − x1 x1 − x0 x2 − x 0 x2 − x0

an = f [x0 , x1 , . . . , xn ]
The interpolation polynomials P1 , P2 in Newton’s form are given by:

P1 (x) = f [x0 ] + f [x0 , x1 ](x − x0 );

P2 (x) = f [x0 ] + f [x0 , x1 ](x − x0 ) + f [x0 , x1 , x2 ](x − x0 )(x − x1 ).

45
Numerical Analysis

Lemma
If Pn (x) is a polynomial of degree n, its divided difference of order (n + 1) is
identically zero, that is,

f [x0 , x1 , . . . , xn , x] = 0
for any set of (n + 1) distinct numbers x0 , x1 , . . . , xn .

Proof. Let Pn (x) be a polynomial of degree n. The divided difference is given by:

Pn (x) − Pn (x0 )
f [x0 , x] = ,
x − x0
which results in a polynomial of degree n − 1.
Next, we have:

f [x1 , x] − f [x0 , x1 ]
f [x0 , x1 , x] = ,
x − x0
yielding a polynomial of degree n − 2.
By induction, we can establish that:

f [x0 , x1 , . . . , xn−1 , x] = constant,


which is a polynomial of degree 0. Therefore, it follows that

f [x0 , x1 , . . . , xn , x] = 0.

Theorem
The interpolation polynomial in Newton’s form passing through the points
(xi , f (xi )) for i = 0, . . . , n can be written as:

Pn (x) = f [x0 ] + f [x0 , x1 ](x − x0 ) + f [x0 , x1 , x2 ](x − x0 )(x − x1 )


+ · · · + f [x0 , x1 , . . . ; xn ](x − x0 )(x − x1 ) · · · (x − xn−1 ).

Alternatively, it can be expressed as:


n
X i−1
Y
Pn (x) = f [x0 , x1 , . . . , xi ] (x − xj ). (3.2)
i=0 j=0

Proof. From the divided difference formulas to the polynomial Pn (x), we have:

Pn (x) − Pn (x0 )
f [x, x0 ] = =⇒ Pn (x) = Pn (x0 ) + f [x, x0 ](x − x0 ).
x − x0
Next, for three points, we can express:

46
Numerical Analysis

f [x, x0 ] − f [x0 , x1 ]
f [x, x0 , x1 ] = =⇒ f [x, x0 ] = f [x0 , x1 ] + f [x, x0 , x1 ](x − x1 ).
x − x1

From these, we can derive:

Pn (x) = Pn (x0 ) + f [x0 , x1 ](x − x0 ) + f [x, x0 , x1 ](x − x0 )(x − x1 )


+ · · · + f [x0 , . . . , xn ](x − x0 )(x − x1 ) · · · (x − xn−1 )
+f [x, x0 , . . . , xn ](x − x0 )(x − x1 ) · · · (x − xn ).

According to the previous Lemma, we have f [x, x0 , . . . , xn ] = 0. Therefore, we


conclude that:

Pn (x) = f [x0 ] + f [x0 , x1 ](x − x0 ) + f [x0 , x1 , x2 ](x − x0 )(x − x1 )


+ · · · + f [x0 , x1 , . . . ; xn ](x − x0 )(x − x1 ) · · · (x − xn−1 ).

xi f (xi ) f [xi , xi+1 ] f [xi , xi+1 , xi+2 ] f [xi , xi+1 , xi+2 , xi+3 ] ... f [x0 , x1 , . . . , xn ]
x0 f (x0 )
x1 f (x1 ) f [x0 , x1 ]
x2 f (x2 ) f [x1 , x2 ] f [x0 , x1 , x2 ]
x3 f (x3 ) f [x2 , x3 ] f [x1 , x2 , x3 ] f [x0 , x1 , x2 , x3 ]
.. .. .. .. .. .. ..
. . . . . . .
xn f (xn ) f [xn−1 , xn ] f [xn−2 , xn−1 , xn ] f [xn−3 , xn−2 , xn−1 , xn ] ... f [x0 , x1 , . . . , xn ]

Table 3.1: Divided Differences Table

It is important to note that when we compute the n + 1 coefficients ai for


i = 0, . . . , n, and subsequently add an interpolation point, we only need to
calculate the coefficient an+1 . This is because the new basis can be derived
from the existing basis by incorporating the polynomial Nn+1 .
n+1
X
Pn+1 (x) = ai Ni (x) = Pn (x) + an+1 Nn+1 (x)
i=0

Example

Find the Newton polynomial that passes through the following points: (0, 1),
(1, 4), (2, 8) and (3, 14)

To find the Newton polynomial P (x) that passes through the given points, we
will construct the divided difference table using the updated values:

47
Numerical Analysis

x0 = 0, f (x0 ) = 1,
x1 = 1, f (x1 ) = 4,
x2 = 2, f (x2 ) = 8,
x3 = 3, f (x3 ) = 14.
The divided difference table is as follows:

xi f (xi ) f [xi , xi+1 ] f [xi , xi+1 , xi+2 ] f [xi , xi+1 , xi+2 , xi+3 ]
x0 = 0 1
4−1
x1 = 1 4 f [x0 , x1 ] = 1−0
=3
8−4 4−3 1
x2 = 2 8 f [x1 , x2 ] = 2−1
=4 f [x0 , x1 , x2 ] = 2−0
= 2
14−8 6−4 1− 21 1
x3 = 3 14 f [x2 , x3 ] = 3−2
=6 f [x1 , x2 , x3 ] = 3−1
=1 f [x0 , x1 , x2 , x3 ] = 3−0
= 6

The divided differences are computed as follows:


1. The first row consists of the function values.
2. The first divided difference is calculated as:
f (x1 ) − f (x0 ) 4−1
f [x0 , x1 ] = = = 3.
x 1 − x0 1−0
3. Continue calculating higher-order divided differences.
Once we have the divided differences, we can express the Newton polynomial
P (x) as:

P (x) = f (x0 )+f [x0 , x1 ](x−x0 )+f [x0 , x1 , x2 ](x−x0 )(x−x1 )+f [x0 , x1 , x2 , x3 ](x−x0 )(x−x1 )(x−x2 ).
Substituting the computed values from the divided difference table:
1
P (x) = 1 + 3(x − 0) + 4(x − 0)(x − 1) + (x − 0)(x − 1)(x − 2).
6
The Newton polynomial P (x) that passes through the given points is:
1 17
P (x) = x3 + x + 1.
6 6

3.3.1 Case of Equidistant Interpolation Points


Consider (n + 1) equidistant points xi within the interval [a, b],

x0 ∈ R, x1 = x0 + h, x2 = x0 + 2h, . . . , xn = x0 + nh,
b−a
with h = n
> 0 representing the step size. Alternatively, this can be expressed
as:

xi = xi−1 + h = x0 + ih, h > 0, i = 1, . . . , n.

48
Numerical Analysis

Definition. Let (n+1) equidistant points (xi , yi )ni=0 . The Forward Finite Differences
(F.F.D) of order k (where k = 0, . . . , n) are defined by the following expressions:
- For order 0:
∆0 yi = f (xi ) = yi , i = 0, . . . , n.
- For order 1:
∆1 yi = yi+1 − yi , i = 0, . . . , n − 1.
- For order 2:

∆2 yi = ∆1 yi+1 − ∆1 yi , i = 0, . . . , n − 2.

- For order k > 1:

∆k yi = ∆k−1 yi+1 − ∆k−1 yi , i = 0, . . . , n − k.

- For order n:
∆n y0 = ∆n−1 y1 − ∆n−1 y0 (i = 0).

xi f (xi ) ∆f (xi ) ∆2 f (xi ) ∆3 f (xi ) ... ∆n f (xi )


x0 f (x0 )
x1 f (x1 ) ∆f (x0 )
x2 f (x2 ) ∆f (x1 ) ∆2 f (x0 )
x3 f (x3 ) ∆f (x2 ) ∆2 f (x1 ) ∆3 f (x0 )
.. .. .. .. .. .. ..
. . . . . . .
xn f (xn ) ∆f (xn−1 ) ∆2 f (xn−2 ) ∆3 f (xn−3 ) ... n
∆ f (x0 )

Table 3.2: Table of Forward Finite Differences

Theorem: Relation Between Forward Finite Differences and Divided


Differences
Let f be a function whose values are known at the points (xi ) where
xi = x0 + ih with h > 0 for all i = 1, . . . , n. Then,

∆k yi
= f [xi , xi+1 , . . . , xi+k ], k = 1, . . . , n; i = 0, . . . , n − k;
k!hk
where yi = f (xi ) for all i ∈ {0, . . . , n}.

Proof. We prove this relation using induction on k(for all i = 0, . . . , n − k):

1. **Base Case:** The relation holds for k = 0. Indeed, we have

0!
f [xi ] = yi = ∆0 yi , ∀i = 0, . . . , n.
h0

49
Numerical Analysis

2. **Inductive Step:** Assume the relation is true for all orders up to k. We will
demonstrate that it also holds for k + 1:
For every i = 0, . . . , n − k, we can express:

f [xi+1 , xi+1 , . . . , xi+k+1 ] − f [xi , xi+1 , . . . , xi+k ]


f [xi , xi+1 , . . . , xi+k+1 ] = .
xi+k+1 − xi

By the induction hypothesis, we know:

∆k yi
f [xi , xi+1 , . . . , xi+k ] =
k!hk
and

∆k yi+1
f [xi+1 , xi+1 , . . . , xi+k+1 ] = .
k!hk
Additionally, we can compute:

xi+k+1 − xi = x0 + (i + k + 1)h − (x0 + ih) = (k + 1)h


Therefore, we find that:

∆k yi+1 − ∆k yi ∆k+1 yi
f [xi , xi+1 , . . . , xi+k+1 ] = = .
k!hk · (k + 1)h (k + 1)!hk+1

Newton’s Forward Formula


The formula 3.2 can be expressed as
n k−1
X ∆k f (x0 ) Y
Pn (x) = f (x0 ) + k
(x − xj ).
k=1
k!h j=0

which is known as Newton’s Forward Formula.


By expressing x as x0 + ih where i ∈ N, and using the notation

i(i − 1) · · · (i − k + 1)
Cnk = for k > 0 and Cn0 = 1,
k!
we obtain:
n
X
Pn (x) = pn (x0 + ih) = Cnk ∆k f (x0 ).
k=0

50
Numerical Analysis

Example
Let’s determine the Newton Forward Formula associated with the function f
passing through the points (0, 2), (1, 3), (2, 5), and (3, 4).

We have n = 3; x0 = 0 and h = 1, so xi = 0 + i = i for i = 0, 1, 2, 3.

xi f (xi ) ∆f (xi ) ∆2 f (xi ) ∆3 f (xi )


0 2
1 3 ∆f (x0 ) = 1
2 5 ∆f (x1 ) = 2 ∆2 f (x0 ) = 1
3 4 ∆f (x2 ) = −1 ∆2 f (x1 ) = −3 ∆3 f (x0 ) = −4

Table 3.3: Table of Forward Differences

Thus, the Newton Forward Formula is given by:

∆f (x0 ) ∆2 f (x0 ) ∆3 f (x0 )


P3 (x) = f (x0 )+ (x−x0 )+ (x−x 0 )(x−x 1 )+ (x−x0 )(x−x1 )(x−x2 )
h 2h2 6h3
Substituting the values, we have:
1 −4
P3 (x) = 2 + 1(x − 0) + (x − 0)(x − 1) + (x − 0)(x − 1)(x − 2)
2 6
This simplifies to:
1 2
P3 (x) = 2 + x + x(x − 1) − x(x − 1)(x − 2)
2 3
Finally, the formula is:
1 11 10
P3 (x) = − x3 + x2 − x + 2.
3 6 3
Definition. Let (n + 1) equidistant points (xi , yi )ni=0 . The Backward Finite Differ-
ences (B.F.D) of order k (where k = 0, . . . , n) are defined by the following expres-
sions:
- For order 0:
∇0 yi = f (xi ) = yi , i = 0, . . . , n.
- For order 1:
∇yi = yi − yi−1 , i = 1, . . . , n.
- For order 2:
∇2 yi = ∇yi − ∇yi−1 , i = 2, . . . , n.
- For order k > 1:

∇k yi = ∇k−1 yi − ∇k−1 yi−1 , i = k, . . . , n.

- For order n:
∇n yn = ∇n−1 yn − ∇n−1 yn−1 (i = n).

51
Numerical Analysis

xi f (xi ) ∇f (xi ) ∇2 f (xi ) ∇3 f (xi ) ··· ∇n f (xi )


x0 f (x0 )
x1 f (x1 ) ∇f (x1 )
x2 f (x2 ) ∇f (x2 ) ∇2 f (x2 )
x3 f (x3 ) ∇f (x3 ) ∇2 f (x3 ) ∇3 f (x3 )
.. .. .. .. .. .. ..
. . . . . . .
xn f (xn ) ∇f (xn ) ∇2 f (xn ) ∇3 f (xn ) ··· n
∇ f (xn )

Table 3.4: Table of Backward Finite Differences

Theorem: Relation Between Backward Finite Differences and Di-


vided Differences
Finite differences Divided are given by

∇k yi+k
= f [xi , xi+1 , . . . , xi+k ], k = 1, . . . , n; i = 0, . . . , n − k.
k!hk
where yi = f (xi ) for all i ∈ {0, . . . , n}.

Proof. We prove this relation using induction on k (for all i = k, . . . , n)

Newton’s Backward Formula


The formula 3.2 can also be expressed as:

n k−1
X ∇k f (xn ) Y
Pn (x) = f (xn ) + (x − xn−j ).
k=1
k!hk j=0

which is known as Newton’s Backward Formula.


Example
Let’s determine the Newton Backward Formula associated with the function
f passing through the points (0, 2), (1, 3), (2, 5), and (3, 4).

We have n = 3; x0 = 0 and h = 1, so xi = 0 + i = i for i = 0, 1, 2, 3.

xi f (xi ) ∇f (xi ) ∇2 f (xi ) ∇3 f (xi )


0 2
1 3 ∇f (x1 ) = 1
2 5 ∇f (x2 ) = 2 ∇2 f (x2 ) = 1
3 4 ∇f (x3 ) = −1 ∇2 f (x3 ) = −3 ∇3 f (x3 ) = −4

Table 3.5: Table of Backward Differences

Thus, the Newton backward formula is given by:

52
Numerical Analysis

∇f (xn ) ∇2 f (xn ) ∇3 f (xn )


P3 (x) = f (xn )+ (x−xn )+ (x−x n )(x−x n−1 )+ (x−xn )(x−xn−1 )(x−xn−2 )
h 2h2 6h3
∇f (x3 ) ∇2 f (x3 ) ∇3 f (x3 )
P3 (x) = f (x3 )+ (x−x3 )+ (x−x 3 )(x−x 2 )+ (x−x3 )(x−x2 )(x−x1 )
h 2h2 6h3
Substituting the values, we have:

−3 −4
P3 (x) = 4 + (−1)(x − 3) + (x − 3)(x − 2) + (x − 3)(x − 2)(x − 1)
2 6
This simplifies to:
3 2
P3 (x) = 4 − (x − 3) − (x − 3)(x − 2) − (x − 3)(x − 2)(x − 1).
2 3
Finally, the formula is:
1 10
P3 (x) = x3 − 4x2 + x + 2.
3 3

3.4 Interpolation Error


Definition. Let Pn be the interpolating polynomial for a function f at the nodes
(xi , f (xi ))ni=0 . We define the interpolation error (or effective error) when approxi-
mating f by Pn at a point x ∈ [min xi , max xi ] as follows:

En (x) = |f (x) − Pn (x)|.


• It is clear that if x = xi (where i = 0, n), then En (x) = 0.
• Since f is not always known, we introduce the notion of the upper bound of
the error, denoted by , and we write:

En (x) = |f (x) − Pn (x)| ≤ .


As a result, we have:

Pn (x) −  ≤ f (x) ≤ Pn (x) + ,


or equivalently:

f (x) ≈ Pn (x) ± .

Lemma
Let g be a continuous function on [a, b] and m times differentiable on ]a, b[.
Suppose there exist m + 1 points c0 < c1 < · · · < cm in [a, b] such that
g(ci ) = 0. Then there exists ξ ∈]c0 , cm [ such that g (m) (ξ) = 0.

53
Numerical Analysis

Proof. The lemma is proven by induction on m. For m = 1, this is (Rolle’s Theo-


rem). Assume the lemma holds for m−1. The Mean Value Theorem provides points
α0 ∈]c0 , c1 [, . . . , αm−1 ∈]cm−1 , cm [ such that g 0 (αi ) = 0. By the induction hypothesis,
there exists ξ ∈]α0 , αm−1 [⊂]c0 , cm [ such that g (m−1) (ξ) = g (m) (ξ) = 0.

Theorem
Let x0 , x1 , . . . , xn ∈ [a, b] be n + 1 distinct points, and let f be a function that
is continuous on [a, b] and (n + 1) times continuously differentiable on ]a, b[,
where a = min0≤i≤n xi and b = max0≤i≤n xi . Then, for every x ∈ [a, b], there
exists a point ξx ∈]a, b[ such that

f (n+1) (ξx )
En (x) = f (x) − Pn (x) = (x − x0 )(x − x1 ) · · · (x − xn ).
(n + 1)!
Moreover, if f (n+1) is continuous on [a, b], then
Mn+1
|En (x)| ≤ |(x − x0 )(x − x1 ) · · · (x − xn )|,
(n + 1)!
where Mn+1 = maxx∈[a,b] |f (n+1) (x)|.

Proof. Let x ∈ [a, b]:


Case 1. If there exists j ∈ {0, 1, . . . , n} such that x = xj , then

En (xj ) = f (xj ) − Pn (xj ) = 0


and also
n
f (n+1) (ξ) Y
× (xj − xi ) = 0.
(n + 1)! i=0

Thus, we obtain the result.


Case 2. If x 6= xj for all j ∈ {0, 1, . . . , n}: In this case, we consider the following
function:
n
Y t − xi
g(t) = f (t) − Pn (t) − En (x) · , ∀t ∈ [a, b].
i=0
x − x i

It is clear that g ∈ C n+1 ([a, b]); g(xi ) = 0 for all i ∈ {0, 1, . . . , n} and g(x) = 0.
Therefore, g has (n + 2) distinct roots in [a, b]. Hence, by the previous lemma, there
exists ξx ∈]a, b[ such that g (n+1) (ξx ) = 0.
n
(n+1) (n+1)
Y 1
g (ξx ) = 0 ⇐⇒ f (ξx ) − En (x) · · (n + 1)! = 0.
i=0
x − xi

From this, we obtain

54
Numerical Analysis

n
f (n+1) (ξx ) Y
En (x) = × (x − xi ).
(n + 1)! i=0

Furthermore, if f (n+1) is continuous on [a, b], which is compact, then f (n+1) is


bounded and attains its bounds, hence

|f (n+1) (ξx )| ≤ max |f (n+1) (x)| = Mn+1 .


x∈[a,b]

Therefore,

n
Mn+1 Y
|En (x)| ≤ (x − xi )
(n + 1)! i=0
Mn+1
≤ × (b − a)n .
(n + 1)!

The interpolation error can be expressed using the same general relation re-
gardless of the method used, whether it is Lagrange, Newton, or another. This
is because the interpolation polynomial obtained through any of these meth-
ods is identical, as ensured by the uniqueness of the interpolating polynomial.
One notable advantage of the Newton form of interpolation is that it provides
an explicit formula for the interpolation error:

f (x) − pn (x) = f [x0 , x1 , . . . , xn , x] · (x − x0 )(x − x1 ) · · · (x − xn )


This expression illustrates that the error depends on both the interpolation
nodes and the behavior of the function being approximated.

Example

Let f (x) = sin(x) to be interpolated at the points 0, 41 , 12 , 34 , and 1. Let’s


calculate the approximation error at x = 31 .

Five interpolation points give n = 4. Therefore, f (n+1) (x) = f (5) (x) = cos(x).
There exists a value ξ ∈ ]0, 1[ such that

f (5) (ξ) 1
         
1 1 1 1 1 1 1 3 1
sin − P4 = −0 − − − −1 .
3 3 5! 3 3 4 3 2 3 4 3

Calculating the factors:


     
cos(ξ) 1 1 1 5 2
= − − − .
5! 3 12 6 12 3

55
Numerical Analysis

Simplifying, we obtain:

cos(ξ) 1 · 1 · 5 · 2 · 1 cos(ξ) 10
= · = · .
5! 3 · 12 · 6 · 12 · 3 5! 1296
Taking maxξ∈[0,1] | cos(ξ)| = 1, we have:
   
1 1 10
sin − p4 ≤ ≈ 0.0000064.
3 3 1296 × 120

56

You might also like