0% found this document useful (0 votes)
12 views7 pages

5 Ders

The document discusses interpolation and polynomial approximation, focusing on methods for estimating new data points within a discrete set of known data. It introduces the Lagrange interpolating polynomial and divided differences as techniques for constructing unique polynomials that fit given data points. Additionally, it presents the Weierstrass Approximation Theorem and the Interpolation Error Theorem, providing examples and formulas for practical application.

Uploaded by

Ali Ali
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)
12 views7 pages

5 Ders

The document discusses interpolation and polynomial approximation, focusing on methods for estimating new data points within a discrete set of known data. It introduces the Lagrange interpolating polynomial and divided differences as techniques for constructing unique polynomials that fit given data points. Additionally, it presents the Weierstrass Approximation Theorem and the Interpolation Error Theorem, providing examples and formulas for practical application.

Uploaded by

Ali Ali
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/ 7

1 Interpolation and Polynomial Approximation

Interpolation is a type of estimation, a method of constructing new data points


within the range of a discrete set of known data points.

Consider the following table:

Year 2000 2005 2010 2015 2020


Turkey Urban Population(in millions) 40,942 46,065 51,225 57,616 63,803

These data could be used to provide a reasonable estimate of the urban


population at some other years, say, in 2008 or in 2030.
One of the most useful and well-known classes of functions mapping the set
of real numbers into itself is the algebraic polynomials

Pn (x) = an xn + an−1 xn−1 + ... + a1 x + a0

where n is a nonnegative integer and a0 , ..., an are real constants. One reason
for their importance is that they uniformly approximate continuous functions.

Theorem: (Weierstrass Approximation Theorem)

Suppose that f is defined and continuous on [a, b]. For each ε > 0, there
exists a polynomial P (x), with the property that

|f (x) − P (x)| < ε

for all x in [a, b] .

Another important reason for considering the class of polynomials in the


approximation of functions is that the derivative and indefinite integral of a
polynomial are easy to determine and are also polynomials. For these reasons,
polynomials are often used for approximating continuous functions.

Definition: The interpolating polynomial for a set of n + 1 points

(x0 , f (x0 )), (x1 , f (x1 )), ..., (xn , f (xn ))

is the unique polynomial P (x) such that

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

QUESTION: How to construct a polynomial P (x) of degree at most n?

1
1.1 Lagrange Interpolating Polynomials
Suppose n = 1 and we have only two points (x0 , f (x0 )) and (x1 , f (x1 )). The
linear Lagrange interpolating polynomial through (x0 , f (x0 )) and (x1 , f (x1 ))
is
(x − x1 ) (x − x0 )
P (x) = L0 (x)f (x0 ) + L1 (x)f (x1 ) = f (x0 ) + f (x1 )
(x0 − x1 ) (x1 − x0 )
which implies that

P (x0 ) = 1.f (x0 ) + 0.f (x1 ) = f (x0 )

P (x1 ) = 0.f (x0 ) + 1.f (x1 ) = f (x1 )

Example 1: Determine the linear Lagrange interpolating polynomial that


passes through the points (2, 4) and (5, 1).

Solution: The linear Lagrange interpolating polynomial that passes through


the points (2, 4) and (5, 1) is

P (x) = L0 (x)f (x0 ) + L1 (x)f (x1 )


(x − 5) (x − 2)
= 4+ 1
(2 − 5) (5 − 2)
= −x + 6

In general, the nth Lagrange interpolating polynomial, is defined in


the following theorem.

Theorem: If x0 , x1 , ..., xn are n + 1 distinct numbers and f is a function


whose values are given at these numbers, then a unique polynomial P (x) of
degree at most n exists with

P (xk ) = f (xk ), k = 0, 1, 2, ..., n

This polynomial is given by


n
X
P (x) = Ln,0 (x)f (x0 ) + Ln,1 (x)f (x1 ) + ... + Ln,n (x)f (xn ) = Ln,k (x)f (xk )
k=0

where, for each k = 0, 1, ..., n,


(x − x0 ) (x − x1 ) ... (x − xk−1 ) (x − xk+1 ) ... (x − xn )
Ln,k (x) =
(xk − x0 ) (xk − x1 ) ... (xk − xk−1 ) (xk − xk+1 ) ... (xk − xn )
n
Y (x − xi )
=
i=0
(xk − xi )
i6=k

2
NOTE: We will write Ln,k (x) simply as Lk (x) when there is no confusion
as to its degree.

Example 2:
(i) Use the nodes x0 = 2, x1 = 2.75, and x2 = 4 to find the second Lagrange
interpolating polynomial for f (x) = 1/x.
(ii) Use this polynomial to approximate f (3) = 1/3.

Solution:

(i) The second Lagrange interpolating polynomial for f (x) = 1/x is


2
X
P2 (x) = Lk (x)f (xk )
k=0
= L0 (x)f (x0 ) + L1 (x)f (x1 ) + L2 (x)f (x2 )
(x − x1 ) (x − x2 ) (x − x0 ) (x − x2 ) (x − x0 ) (x − x1 )
= f (x0 ) + f (x1 ) + f (x2 )
(x0 − x1 ) (x0 − x2 ) (x1 − x0 ) (x1 − x2 ) (x2 − x0 ) (x2 − x1 )
(x − 2.75) (x − 4) (x − 2) (x − 4) (x − 2) (x − 2.75)
= f (2) + f (2.75) + f (4)
(2 − 2.75) (2 − 4) (2.75 − 2) (2.75 − 4) (4 − 2) (4 − 2.75)
1 64 1
= (x − 2.75) (x − 4) − (x − 2) (x − 4) + (x − 2) (x − 2.75)
3 165 10
1 2 35 49
= x − x+
22 88 44

(ii)
1 2 35 49
f (3) ≈ P2 (3) = (3) − 3 + ≈ 0.32955
22 88 44

1
((The value of f (x) at x = 3 is 3 ≈ 0.3333)

Theorem: (Interpolation Error Theorem)

Suppose x0 , x1 , ..., xn are distinct numbers in the interval [a, b] and f ∈


C n+1 [a, b]. Then, for each x in [a, b], a number ξ(x) between x0 , x1 , ..., xn and
hence in (a, b), exists with

f (n+1) (ξ(x))
f (x) = P (x) + (x − x0 ) (x − x1 ) ... (x − xn )
(n + 1)!

where P (x) is the interpolating polynomial given as


n
X
P (x) = Ln,0 (x)f (x0 ) + Ln,1 (x)f (x1 ) + ... + Ln,n (x)f (xn ) = Ln,k (x)f (xk )
k=0

3
Example: Compute the maximum absolute error for Example 2 for x ∈
[2, 4] .

Solution: We have f (x) = 1/x, so

f 0 (x) = −1/x2 , f 00 (x) = 2/x3 and f 000 (x) = −6/x4

Hence, the second Lagrange polynomial has the error form

f 000 (ξ(x)) 1
(x − x0 ) (x − x1 ) (x − x2 ) = − (x − 2) (x − 2.75) (x − 4)
3! (ξ(x))4
1 1 1
where ξ(x) in (2, 4) . The maximum value of (ξ(x))4 = 24 = 16 . Let’s define

35 2 49
g(x) = (x − 2) (x − 2.75) (x − 4) = x3 − x + x − 22
4 2
Since
 
d 35 2 49 35 49 1
x − x + x − 22 = 3x2 − x +
3
= (3x − 7)(2x − 7)
dx 4 2 2 2 2

the critical points are


7 7 25 7 7 9
x= with g( ) = and x = with g( ) = −
3 3 108 2 2 16
Also, from the endpoints
g(2) = g(4) = 0
Hence, the maximum error is

f 000 (ξ(x)) 1
(x − x0 ) (x − x1 ) (x − x2 ) = − (x − 2) (x − 2.75) (x − 4)
3! (ξ(x))4
1 9
≤ ≈ 0.0352
16 16

DİVİDED DİFFERENCES
(ALTERNATE ALGEBRAİC FORMULA FOR INTERPOLATION)

A major difficulty with the Lagrange Interpolation is that if the accuracy is


not good enough with polynomial of a certain degree, one needs to increase the
degree of the polynomial, and computations need to be started all over again.
Start with a table of values of a function f :

x x0 x1 x2 ... xn
f(x) f(x0 ) f(x1 ) f(x2 ) ... f(xn )

4
The points x0 , x1 , ..., xn are assumed to be distinct.

Previously, we established that for each n = 0, 1, ..., there exists a unique


polynomial Pn such that

• The degree of Pn is at most n.


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

The divided differences of f with respect to x0 , x1 , ..., xn are used to express


Pn (x) in the form

Pn (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + ... + an (x − x0 )...(x − xn−1 ) (1)

for appropriate constants a0 , a1 , ..., an .

Note that
a0 = Pn (x0 ) = f (x0 ) (2)
Similarly, when Pn (x) is evaluated at x1

f (x0 ) + a1 (x1 − x0 ) = Pn (x1 ) = f (x1 )

so
f (x1 ) − f (x0 )
a1 = (3)
x1 − x0
We now introduce the divided-difference notation. The zeroth divided
difference of the function f with respect to xi , denoted f [xi ], is simply
the value of f at xi :
f [xi ] = f (xi ) (4)
The remaining divided differences are defined recursively; the first divided
difference of f with respect to xi and xi+1 is denoted f [xi , xi+1 ] and defined
as
f [xi+1 ] − f [xi ]
f [xi , xi+1 ] = (5)
xi+1 − xi
The second divided difference, f [xi , xi+1 , xi+2 ] is defined as

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


f [xi , xi+1 , xi+2 ] = (6)
xi+2 − xi

Similarly, after the (k − 1)st divided differences, the kth divided difference
relative to xi , xi+1 , xi+2 , ..., xi+k is

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


f [xi , xi+1 , ..., xi+k−1 , xi+k ] =
xi+k − xi
(7)

5
The process ends with the single nth divided difference,

f [x1 , ..., xn ] − f [x0 , x1 , ..., xn−1 ]


f [x0 , x1 , ..., xn ] = (8)
xn − x0
Hence the interpolating polynomial in Eq. (1) is

Pn (x) = f [x0 ]+f [x0 , x1 ](x−x0 )+f [x0 , x1 , x2 ](x−x0 )(x−x1 )+...+f [x0 , x1 , ..., xn ](x−x0 )...(x−xn−1 )
(9)
So Pn (x) can be rewritten in a form called Newton’s Divided-Difference:
n
X
Pn (x) = f [x0 ] + f [x0 , x1 , ..., xk ](x − x0 )...(x − xk−1 ) (10)
k=1

Example 1 For the table write out the Newton-Form of the interpolating poly-
nomial.
x 1 -4 0
f(x) 3 13 -23

f [x0 ] = 3
f [x1 ] = 13
f [x2 ] = −23
f [x1 ] − f [x0 ] 13 − 3
f [x0 , x1 ] = = = −2
x1 − x0 −4 − 1
f [x2 ] − f [x1 ] −23 − 13
f [x1 , x2 ] = = = −9
x2 − x1 0+4
f [x1 , x2 ] − f [x0 , x1 ] −9 + 2
f [x0 , x1 , x2 ] = = =7
x2 − x0 0−1

Hence, from Eq. (9)

P2 (x) = 3 − 2 (x − 1) + 7 (x − 1) (x + 4)

Example 2 Construct a divided-difference diagram for the function f given in


the following table, and write out the Newton form of the interpolating polyno-
mial.
x 1 3/2 0 2
f(x) 3 13/4 3 5/3

6
f [x0 ] = 3
13
f [x1 ] =
4
f [x2 ] = 3
5
f [x3 ] =
3
13
f [x1 ] − f [x0 ] 4 −3 1
f [x0 , x1 ] = = 3 =
x1 − x0 2 −1
2
f [x2 ] − f [x1 ] 3 − 13
4 1
f [x1 , x2 ] = = =
x2 − x1 0 − 32 6
5
f [x3 ] − f [x2 ] 3 −3 2
f [x2 , x3 ] = = =−
x3 − x2 2−0 3
1 1
f [x1 , x2 ] − f [x0 , x1 ] − 1
f [x0 , x1 , x2 ] = = 6 2 =
x2 − x0 0−1 3
f [x2 , x3 ] − f [x1 , x2 ] − 32 − 61 5
f [x1 , x2 , x3 ] = = 3 =−
x3 − x1 2− 2 3
f [x1 , x2 , x3 ] − f [x0 , x1 , x2 ] −5 − 1
f [x0 , x1 , x2 , x3 ] = = 3 3 = −2
x3 − x0 2−1
Thus, we obtain
   
1 1 3 3
P3 (x) = 3 + (x − 1) + (x − 1) x − − 2 (x − 1) x − x
2 3 2 2

You might also like