Numerical Analysis 3
Numerical Analysis 3
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
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
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 .
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
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.