Lecture 13
Lecture 13
be expressed.
The Newton and the Lagrange polynomials are the most popular and
useful forms.
THE INTERPOLATION PROBLEM
f [ x0 ] f ( x0 ) Zeroth order DD
f [ x1 ] f [ x0 ]
f [ x0 , x1 ] First order DD
x1 x0
f [ x1 , x2 ] f [ x0 , x1 ]
f [ x0 , x1 , x2 ] Second order DD
x2 x0
............
f [ x1 , x2 ,..., xn ] f [ x0 , x1 ,..., xn 1 ]
f [ x0 , x1 ,..., xn ]
xn x0
DIVIDED DIFFERENCE TABLE
x F[ ] First second F[ , , ,]
x0 F[x0] F[x0,x1] F[x0,x1,x2] F[x0,x1,x2,x3]
x1 F[x1] F[x1,x2] F[x1,x2,x3]
x2 F[x2] F[x2,x3]
x3 F[x3]
EXAMPLE
x 1 4 5 6
F(x) 0 1.386294 1.609438 1.791759
Note that the true value of ln 2 is 0.6931472.
x F(x) first second third
1 0 0.462098 -0.0597385 0.0078654
4 1.386294 0.223144 -0.0204115
5 1.609438 0.182321
6 1.791759
𝑓1 𝑥 = 𝑏0 + 𝑏1 𝑥 − 𝑥0 ⇒ 𝑓1 2 = 0 + 0.462098 2 − 1 = 0.462098
𝑓2 𝑥 = 𝑏0 + 𝑏1 𝑥 − 𝑥0 + 𝑏2 𝑥 − 𝑥0 𝑥 − 𝑥1
𝑓2 2 = 0 + 0.462098 2 − 1 − 0.0597385(2 − 1)(2 − 4) = 0.581575
𝑓3 𝑥 = 𝑏0 + 𝑏1 𝑥 − 𝑥0 + 𝑏2 𝑥 − 𝑥0 𝑥 − 𝑥1 + 𝑏3 𝑥 − 𝑥0 𝑥 − 𝑥1 𝑥 − 𝑥2
𝑓3 2 = 0 + 0.462098 2 − 1 − 0.0597385 2 − 1 2 − 4 + 0.0078654 2 − 1 2 − 4 (2 − 5) = 0.6287674
First-order polynomial Third-order polynomial
Estimate the error for the second-order polynomial interpolation at x =2 for the
following given data.
X Y
1 0
4 1.386294
5 1.609438
6 1.791759
SOLUTION
x F(x) first second third
1 0 0.462098 -0.0597385 0.0078654
4 1.386294 0.223144 -0.0204115
5 1.609438 0.182321
6 1.791759
𝑅𝑛 ≅ 𝐹[𝑥𝑛+1 , 𝑥𝑛 , 𝑥𝑛−1 , … , 𝑥0 ] 𝑥 − 𝑥0 𝑥 − 𝑥1 … (𝑥 − 𝑥𝑛 )
𝑅2 ≅ 𝐹[𝑥3 , 𝑥2 , 𝑥1 , 𝑥0 ] 𝑥 − 𝑥0 𝑥 − 𝑥1 (𝑥 − 𝑥2 )
𝑅2 ≅ 0.0078654 2 − 1 2 − 4 (2 − 5)
𝑅2 ≅ 0.0471924
LAGRANGE INTERPOLATING POLYNOMIALS
n
f n ( x) f xi i ( x)
i 0
x x
n
i ( x) x x
j 0, j i
j
i j
LAGRANGE INTERPOLATING POLYNOMIALS
For example:
when n=1
(𝑥 − 𝑥1 ) (𝑥 − 𝑥0 )
𝑓1 𝑥 = 𝑓 𝑥𝑜 + 𝑓(𝑥1 )
(𝑥0 −𝑥1 ) (𝑥1 −𝑥0 )
when n=2
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) 𝑥 − 𝑥0 𝑥 − 𝑥2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )
𝑓2 𝑥 = 𝑓 𝑥𝑜 + 𝑓 𝑥1 + 𝑓(𝑥2 )
(𝑥0 −𝑥1 )(𝑥0 −𝑥2 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 ) (𝑥2 −𝑥0 )(𝑥2 −𝑥1 )
EXAMPLE
Use a Lagrange interpolating polynomial of the first and second order to evaluate ln 2
on the basis of the data given in the following table.
x 1 4 5
F(x) 0 1.386294 1.609438
SOLUTION
for n=1
(𝑥 − 𝑥1 ) (𝑥 − 𝑥0 )
𝑓1 𝑥 = 𝑓 𝑥𝑜 + 𝑓(𝑥1 )
(𝑥0 −𝑥1 ) (𝑥1 −𝑥0 )
2−4 2−1
𝑓1 2 = 0 ∗ + 1.386294 ∗ = 0.462098
1−4 4−1
for n=2
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) 𝑥 − 𝑥0 𝑥 − 𝑥2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )
𝑓2 𝑥 = 𝑓 𝑥𝑜 + 𝑓 𝑥1 + 𝑓(𝑥2 )
(𝑥0 −𝑥1 )(𝑥0 −𝑥2 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 ) (𝑥2 −𝑥0 )(𝑥2 −𝑥1 )
2−4 2−5 2−1 2−5 2−1 2−4
𝑓2 2 = 0 ∗ + 1.386294 ∗ + 1.609438 = 0.581575
1−4 1 −5 4−1 4 −5 5−1 5 −4
HIGH ORDER POLYNOMIALS INTERPOLATION
20th order polynomial
Polynomial interpolation may lead to large errors (especially for high order
polynomials).
BE CAREFUL
SUMMARY