0% found this document useful (0 votes)
7 views25 pages

Numerical Analysis 3

Chapter 6 discusses polynomial interpolation, focusing on finding a polynomial of the lowest degree that passes through given data points. It presents theorems on the uniqueness and existence of such polynomials, along with methods like Newton and Lagrange forms for constructing them. The chapter also covers the error in polynomial interpolation and introduces Chebyshev polynomials to minimize this error.

Uploaded by

vysl.genc01
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)
7 views25 pages

Numerical Analysis 3

Chapter 6 discusses polynomial interpolation, focusing on finding a polynomial of the lowest degree that passes through given data points. It presents theorems on the uniqueness and existence of such polynomials, along with methods like Newton and Lagrange forms for constructing them. The chapter also covers the error in polynomial interpolation and introduces Chebyshev polynomials to minimize this error.

Uploaded by

vysl.genc01
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/ 25

Chapter-6: Approximating Functions

6.1 Polynomial Interpolation

x x0 x1 x2 x3 ……. xn

y y0 y1 y2 y3 ……. yn

-We seek a polynomial p of lowest possible degree for which p(x i )= y i (0≤i≤n).
Such polynomial said to interpolate the data.
Theorem: If x 0 , x1 , x 2 ,…, x n are distinct real numbers, then for arbitraray values
y 0 , y 1 , y 2 ,…, y n there is a unique polynomial p n of degree at most n such that
p n (xi)= y i (0≤i≤n).

Proof: i)Unicity: Assume that there are polynomials p n and q n such that
p n ( x i )= yi , q n ( x i )= yi and p n≠q n ⇒[ p n −q n ]( x i )=0 0≤i≤n
The degree of p n −q n can be at most n. Therefore p n −q n can have at most n zeros if
p n −q n is not the zero polynomial. But ( p n−q n ) has n+1 zeros. Therefore, p n≡q n .
ii) Existence (Proof by induction)
For n=0 p 0 ( x)= y 0 , p 0 ( x0 )= y 0 (degree 0 polynomial)
For n=k−1 assume that p k −1 ( x i )= y i for 0≤i≤k−1
Let p k ( x)= p k−1 ( x)+c k ( x−x0 )( x−x 1 )…( x−x k−1 ) (polynomial with degree at most k)
⇒ p k ( x i )= p k−1 ( xi )= y i (0≤i≤k−1)
Lets find the unknown coefficient c k that p k ( x k )= y k
⇒ p k ( x k )= y k = p k−1 ( xk )+c k ( x k −x 0 )( xk −x1 )…( x k −x k −1)= y k
y k − p k−1 ( xk )
⇒ ck = .
( x k −x 0 )( x k −x 1)…( x k −xk −1 )
ck exists because (x k −x 0 )( x k −x 1 )…( x k −x k−1 ) is nonzero since x k ≠xi for 0≤i≤k−1
Newton Form of the Interpolation Polynomial
p 0 (x )=c 0 , p1 ( x )=c 0 +c1 (x−x 0 )
⇒ p k ( x)=c 0 +c 1 (x−x 0 )+c 2 ( x− x 0 )(x−x 1 )+…+c k ( x− x0 )(x−x1 )…(x−x k −1 )
k i−1 m
⇒ p k ( x)= ∑ c i ∏ (x−x j ) Assume that ∏ (x−x j )=1 whenever m<0
i=0 j=0 j=0
-These polynomials are called the interpolation polynomials in Newton form.
-Example: p 3 (x)=4 x 3 +35 x2−84 x−954

x 5 -7 -6 0

y 1 -23 -54 -954

p 0 ( x)=c 0=1, p1 ( x)=c0 +c1 ( x−x 0 )


y 1−c 0 −23−1
p 1 ( x 1 )=c 0 +c 1 ( x 1−x0 )= y 1 ⇒ c1 = = =2
x 1−x 0 −7−5
p 2 ( x)=c0 +c1 ( x−x 0 )+c2 ( x−x0 )( x−x 1 )
−54−1+22
p 2 ( x 2)= y 2 =c 0 +c1 ( x 2−x0 )+c 2 (x 2−x0 )( x 2−x 1) ⇒ c 2= =3
−11
p 3 ( x)=c0 +c1 ( x−x 0 )+c2 ( x−x0 )( x−x 1 )+c3 ( x−x 0 )( x−x 1 )( x−x 2 )
p 3 ( x 3 )= y 3 =c 0 +c1 ( x 3−x0 )+c 2 (x 3 −x0 )( x 3−x 1)+c3 ( x3 −x0 )( x 3−x 1 )( x 3−x 2)
−954−1+10−3(−5)(7)
⇒ c 3= =4
(−5)(7)(6)
⇒ p 3 (x)=1+2( x−5)+3( x−5)( x+7)+4( x−5)( x+7)(x+6)
Lagrange Form of the Interpolation Polynomial
p( x) can be expressed in the form
n
p( x)= y 0 l 0 (x)+ y 1 l 1 (x)+…+ y n l n ( x)= ∑ y k l k ( x)= p n ( x)
k=0
for the data points ( x i , y y ) for 0≤i≤n.
Let l i (x j )= 1 if i= j
{ 0 otherwise } ⇒ p n ( xi )= y i

Clearly l 0 must be of the form :


n
l 0 ( x)=c(x−x1 )(x−x 2 )( x−x 3 )…(x−xn )=c ∏ (x−x j ) ⇒ l 0 ( xi )=0 for 1≤i≤n
j=1
n n n
1 1 x−x j
l 0 ( x0 )=1=c ∏ (x 0 −x j ) ⇒ c= =∏ ⇒ l 0 (x)= ∏
n ( x −x ) ( x −x )
j=1 j=1 0 j j=1 0 j
∏ ( x0 −x j )
j=1
n
x−x j
The general formula for l i ( x ) is : ⇒l i ( x )= ∏ (0≤i≤n)
( x i −x j )
j=0
j≠i
n
l i ( x )'s are called cordinal functions. p ( x )= ∑ y k l k ( x ) is called Lagrange form
k =0
of the interpolating polynomial.

Example: What are the cordinal functions and Lagrange for of the
interpolating polynomial for the data in the table given below.
x 5 -7 -6 0

y 1 -23 -54 -954

Solution:
(x +7)(x +6) x (x−5)(x +6) x (x−5)(x +7) x
l 0 (x)= , l1 ( x)= , l2 (x)=
(5+7)(5+6)5 (−7−5)(−7+6)(−7) (−6−5)(−6+7)(−6)

(x−5)(x +7)(x+6)
l 3 (x)= ⇒ p3 (x)=l 0 (x)−23 l 1 (x)−54 l 2 (x)−954 l 3 (x)
(0−5)(0+7)(0+6)
Example: Find an interpolation formula for the table given below.
x x0 x1 x−x 1 x−x0
Solution: ⇒ p(x)= y 0 + y1
y y0 y1 x0− x1 x1−x 0

2 3 n
-Another Approach: p(x)=a 0 +a 1 x+a 2 x +a 3 x +…+a n x , p( x i )= yi for 0≤i≤n
1 x 0 x 20 x30 … x n0 a0 y 0

[ 2 2
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
2

][ ] [ ]
1 x 1 x 21 x31 … x n1 a1 y 1
⇒ 1 x x 2 x3 … x n a = y
2 2

1 x n x n xn … x n an y n
2 3 n

2

Vandermonde matrix
-But Vandermonde matrix is often ill conditioned.
The Error in Polynomial Interpolation
Theorem: Let f be a function in C n+1 [a , b], and let p be the polynomial of
degree ≤n that interpolates the function f at n+1 points x 0 , x1, x 2 ,…, x n in the
internal [a , b] . To each x in [a , b] there corresponds a point ξ x in [a , b] such that
n
1 (n+1)
f ( x)− p(x)= f ( ξ x ) ∏ (x−xi )
n+1 !
i=0
n
Proof: If x=xi 1 (n+1)
⇒ f ( x i )− p ( x i )=0= f ( ξ x ) ∏ ( x−x i )=0.
n+1 !
i=0
n
If x≠x i define w (t )= ∏ (t −x i ) ϕ =f − p− λ w
i=0
f ( x )− p ( x )
λ is a real number that makes ϕ ( x)=0 ⇒ λ= .
w( x )
n+ 1
Now ϕ ( x )∈C [a , b ] , and ϕ ( x ) vanishes at the n+2 points x , x 0 , x 1 , x 2 ,…, x n .
2
By Rolle's Theorem, ϕ ' ( x ) has at least n+1 distinct zeros in (a , b). ϕ ( x) has at
(n+1)
least n distinct zeros in (a , b). ϕ ( x ) has at least one zero say ξ x in (a , b) .
(n+ 1) (n+1) (n+1) (n+ 1) (n+1)
⇒ϕ ( x)=f ( x)− p ( x )− λ w ( x )=f ( x)−(n+1)! λ
(n+ 1) (n+1) (n+1) f ( x)− p( x)
⇒ϕ ( ξ x )=0=f ( ξ x )−(n+1)! λ =f ( ξ x )−(n+1)! =0
w( x)
n
1 (n+1)
⇒ f ( x)− p( x)= f ( ξ x ) ∏ ( x−x i )
n+1!
i=0
n
⇒|f ( x)− p( x)|=
1
n+1 !
f
(n+1)

|
( ξ x ) ∏ (x−x i )
i=0 |
Example: If the function f(x)=sin(x) is approximated by a polynomial of
degree 9 that interpolates f(x) at ten points in the interval [0,1], how large is
the error on this interval?
Solution:
9
|f (10 ) ( ξ x )|≤1, ∏ |x−x i|≤1 for all x in [0,1]
i=0
1
|sinx− p ( x)|≤ <2.8∗10−7
10 !
Chebyshev Polynomials
-We want to minimize the error (|f (x)− p(x)|) given in the previous theorem by
choosing appropriate nodes.
-The Chebyshev polynomials (of the first kind) are defined recursively as follows:
T 0 (x)=1, T 1 (x)=x
{T n +1 (x)=2 x T n (x)−T n−1 (x) n≥1
2
}
⇒ T 2 (x)=2 x −1
3
T 3 (x)=4 x −3 x
T 4 (x)=8 x4 −8 x 2+1
5 3
T 5 (x)=16 x −20 x +5 x
6 4 2
T 6 (x)=32 x −48 x +18 x −1
Theorem: For x in the interval [-1,1], the Chebyshev polynomials have this
closed-form expression: T n (x)=cos(n .cos−1 x) n≥0
Proof:
cos( A +B)=cosA cosB−sinA sin B
cos(n+1) θ =cos θ cos n θ−sin θ sin n θ
cos(n−1) θ =cos θ cos n θ +sin θ sin n θ
⇒ cos(n+1) θ=2cos θ cos n θ−cos(n−1) θ
Let θ=cos−1 x ⇒ x=cos θ
−1 −1
Define f n ( x)=cos(n θ )=cos(n cos x) ⇒ f 0 ( x)=1, f 1 ( x)=cos(cos x)=x
⇒ f n+1 (x)=cos(n+1) θ=2 x f n ( x)−f n−1 ( x) n≥1
⇒ f n ( x)=T n ( x) for all n.
Properties of the Chebyshev Polynomials
|T n ( x)|≤1 (−1≤x≤1)
jπ j
T n (cos )=(−1) (0≤ j≤n)
n
2 j−1
T n (cos π )=0 (0≤ j≤n)
2n
-A monic polynomial is one which the term of highest degree has a
coefficient unity.
n−1 1−n
-The term of highest degree of T n (x) is 2 for n>0. Therefore, 2 T n (x) is a
monic polynomial for n>0.
Theorem:
1−n
If p is a monic polynomial of degree n, then ‖p(x)‖∞= max |p( x)|≥2
−1≤x≤1
1/ p
b

{ ( p
‖f (x)‖p= ∫|f (x)| dx
a
‖f (x)‖∞= max |f (x )|
a≤ x≤b
) a≤x≤b

}
Proof: (By contradiction)
1−n
Suppose |p(x)|<2 (|x|)≤1
1−n iπ
Let q=2 T n and x i=cos( ) (q is a monic polynomial of degree n .)
n
⇒(−1)i p (xi )≤|p (xi )|<21−n=(−1)i q(x i).
⇒(−1)i [ q(xi )− p(xi)] >0 0≤i≤n .
q(x)-p(x) oscillates in sign (n+1) times on the interval [-1,1]. Therefore,
q(x)-p(x) must have at least n roots in (-1,1). This is not possible because
q(x)-p(x) has degree at most n-1.
1−n
⇒ max |p(x)|≥2
−1≤x≤1
Choosing the Nodes
If x ∈[−1,1] and ξ x ∈[−1,1]
n
1 n +1
max|f (x )− p (x)|≤ max |f (x )| max | ∏ ( x−x i )|
(n+1)! |x|≤1 |x|≤1 i=0
n
−n
By the previous theorem max | ∏ (x−xi )|≥2
|x|≤1 i=0
n n
{
|x|≤1 i=0
−n
}
-The minimum value of max | ∏ (x−x i )| will be attained if ∏ (x−xi ) is the
i=0
monic multiple of T n+1 . That is 2 T n+1 . The nodes then will be the roots of T n +1 .
2i+1
These are x i=cos (
2 n+2
π ) 0≤i≤n .
Theorem: If the nodes x i are the roots of the Chebyshev polynomials T n +1 , then
the error formula yields
1 n +1
max|f (x)− p(x)|≤ n max |f (t)|
2 (n+1)! |t|≤1
The Convergence of Interpolating Polynomials
‖f (x)− pn (x)‖= max |f (x)− pn (x)| may not converge to 0 as n→∞ for all
a≤x≤b
functions f (x).
6.2 Divided Differences
-We want to develop an easy way to find the interpolation polynomial in
Newton’s form. Let q n ( x)=(x−x0 )(x−x 1)(x−x 2)…(x−x n−1)
We can write the interpolation polynomial in Newton's form as:
n n
p( x)= ∑ c j q j ( x) ⇒ p(xi )= ∑ c j q j ( x i )=f (xi ) 0≤i≤n
j=0 j=0
Let aij =q j ( xi ) (0≤i , j≤n)
j−1 j−1
q j (x)= ∏ (x− xk ) ⇒ q j (x i )= ∏ (x i −xk )=0 if i≤ j−1.
k =0 k =0
1 0 0 c0 f (x 0)

[
⇒ 1 (x1−x 0) 0
][ ] [ ]
c1 = f (x 1)
1 (x2− x0) ( x2 −x 0)(x 2−x1) c2 f (x 2)
We can easly compute c i .

c0 depends on f (x 0 ), c1 depends on f (x 0 ) and f (x 1), and so on. Thus, c n depends


on f (x ) at x 0 , x1 , x 2 ,…, x n . Define c n =f [ x 0 , x1 , x 2 ,…, x n ]. It means c n depends on
f ( x) at x 0 , x1 , x 2 ,… x n .
n n
p ( x)= ∑ c k q k (x)= ∑ f [ x 0 , x 1 , x 2 ,…, x k ]q k (x)
k =0 k =0
n
q n (x )=(x−x 0)(x−x 1)(x−x 2 )…(x−xn −1 )=x + lower-order terms.
n
⇒ f [ x 0 , x1 , x 2 ,…, x n ] is the coefficient of x in p( x).
f [ x 0 , x 1 , x 2 ,…, x n ]'s are called divided difference of f (x).
f ( x1)−f (x 0 ) f [ x1 ]−f [ x0 ]
⇒ f [ x 0 ]=f (x 0 ), f [ x 0 , x1 ]= =
x1−x 0 x 1−x0
Higher Order Divided Differences
Theorem: Divided differences satisfy the equation
f [ x1 , x 2 , x 3 ,…, x n ]−f [ x 0 , x 1 , x 2 ,…, x n−1 ]
f [ x 0 , x 1 , x 2 ,…, xn ]=
x n−x 0
Let p n ( x) be the polynomial of degree at most n that interpolates f ( x) at the nodes
x 0 , x1 , x 2 ,…, xn , p n−1 ( x) interpolates f ( x) at x 0 , x 1 , x2 ,…, x n−1 . Let q( x) be the
polynomial of degree at most n-1 that interpolates f ( x) at x1 , x 2 , x 3 ,…, x n
x−x n
⇒ p n ( x)=q( x)+ [ q( x)− p n−1 ( x)] (degree of both sides are n)
x n−x 0
This is true because p n ( xi )=f ( x i ) for 0≤i≤n
q(xi )=f ( x i ) for 1≤i≤n .
xi −x n
and [q( x i )− p n−1 ( x i )]=0 for 1≤i≤n .
x n−x 0
x n−x n
and q( xn )+ [q( x n )− p n−1 ( x n )]=f ( xn )
x n−x 0
x−x n
⇒ p n ( x)=q( x)+ [ q( x)− p n−1 ( x)] ⇒ c n is same for both sides
x n−x 0
1
⇒ c n =f [ x 0 , x1 , x 2 ,…, x n ]= ( f [ x1 , x 2 , x 3 ,…, x n ]−f [ x 0 , x 1 , x 2 ,…, x n−1 ])
x n −x 0
f [ x 1 ]−f [ x0 ] f [ x1 , x 2 ]−f [ x0 , x1 ]
⇒ f [ x 0 , x1 ]= , f [ x 0 , x1 , x 2 ]=
x1 −x0 x 2 −x 0
We can generalize the formula as:
f [ xi+1 , x i+2 , xi+ 3 ,…, xi+ j ]−f [ xi , x i+1 , x i+2 ,…, x i+ j−1 ]
f [ x i , xi+1 , x i+2 ,…, x i+ j ]=
xi+ j −x i
The Table of divided differences:
c0 c1 c2 c3 c4
x0 f[x0] f[x0,x1] f[x0,x1,x2] f[x0,x1,x2,x3] f[x0,x1,x2,x3,x4]
x1 f[x1] f[x1,x2] f[x1,x2,x3] f[x1,x2,x3,x4]
x2 f[x2] f[x2,x3] f[x2,x3,x4]
x3 f[x3] f[x3,x4]
x4 f[x4]
Example: Compute a divided difference table and find the Newton
interpolating polynomial for function values in the following table.
x 3 1 5 6
f(x) 1 -3 2 4

xi f(xi) c1 c2 c3
3 1 2 -3/8 7/40
1 -3 5/4 3/20
5 2 2
6 4
3 7
⇒ p(x)=1+2(x−3)− (x−3)(x−1)+ (x−3)(x−1)(x−5)= p3 (x)
8 40

Theorem: The divided difference is a symmetric function of its arguments.


Thus, if (z0,z1,z2,...,zn) is a permutation of (x0,x1,x2,...,xn), then
f[z0,z1,z2,...,zn]=f[x0,x1,x2,...,xn].
Theorem: Let p be the polynomial of degree at most n that interpolates a
function f(x) at a set of n+1 distinct nodes x0,x1,x2,...,xn. If t is a point
different from the nodes, then
n
f (t )− p (t )=f [ x 0 , x 1 , x 2 ,…, x n , t ] ∏ (t −x j )
j=0
Proof: Let q be the polynomial of degree at most n+1 interpolates f(x) at the
nodes x0,x1,x2,...,xn,t
n
⇒ q(x)= p( x)+ f [ x 0 , x 1 , x 2 ,…, x n ,t ] ∏ ( x−x j ) since q(t )=f (t ) (by letting x=t)
j=0
n
⇒ f (t )− p(t)=f [ x0 , x1 , x 2 ,…, xn ,t ] ∏ (t−x j )
j=0
Theorem: If f(x) is n times continuously differentiable on [a,b] and if
x0,x1,x2,...,xn are distinct points in [a,b], then there exists a point ξ in [a,b]
such that
1
f [x 0 , x 1 , x 2 ,…, x n ]= f (n)( ξ)
n!

Proof:
n−1
1 (n)
We know that f (x n)− p( x n )= f ( ξ ) ∏ (x n−x j )
n!
j=0
n−1
From the previous theorem f (x n)− p(x n )=f [ x0 , x 1 , x 2 ,…, x n ] ∏ (x n−x j )
j=0
1 (n)
⇒ f [ x0 , x 1 , x 2 ,…, x n ]= f ( ξ ) a≤ ξ ≤b
n!
6.3 Hermite Interpolation
Example: Find an interpolation formula for the table given below.
Example: Find an interpolation formula for the table given below.
Example: Find an interpolation formula for the table given below.
Example: Find an interpolation formula for the table given below.
Example: Find an interpolation formula for the table given below.

You might also like