0% found this document useful (0 votes)
88 views44 pages

Numerica Analysis 1

The document discusses interpolation and polynomial approximation. It describes how the Lagrange interpolating polynomial can be used to fit a polynomial to data points (xi, yi). The Lagrange polynomial is defined such that it passes through each data point by constructing basis polynomials Ln,k(x) that are 1 at xk and 0 at all other data points. The nth degree Lagrange interpolating polynomial is the sum of the basis polynomials multiplied by the corresponding function values f(xk). This allows fitting an nth degree polynomial exactly through n+1 data points.

Uploaded by

Kiio Makau
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)
88 views44 pages

Numerica Analysis 1

The document discusses interpolation and polynomial approximation. It describes how the Lagrange interpolating polynomial can be used to fit a polynomial to data points (xi, yi). The Lagrange polynomial is defined such that it passes through each data point by constructing basis polynomials Ln,k(x) that are 1 at xk and 0 at all other data points. The nth degree Lagrange interpolating polynomial is the sum of the basis polynomials multiplied by the corresponding function values f(xk). This allows fitting an nth degree polynomial exactly through n+1 data points.

Uploaded by

Kiio Makau
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/ 44

Section 3

Interpolation and Polynomial Approximation

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 78
3.1 Interpolation and the Lagrange Polynomial
Interpolation
One of the most useful and
 well-known classes of functions mapping the set of real numbers
into itself is the algebraic(x
polynomials, the set of functions of the form
Given data points i , yi ) : i = 1, . . . , n , can we find a function
to “fit” the data? Pn (x) = an x n + an−1 x n−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. By this we mean that
Theorem (Weierstrass
given any function, defined andapproximation
continuous on a closedtheorem)
and bounded interval, there exists
a polynomial
Suppose f ∈that is asb],
C [a, “close”
thento ∀
thegiven
> 0,function as desired. ThisP(x)
∃ a polynomial result issuch
expressed
that
precisely in the Weierstrass Approximation Theorem. (See Figure 3.1.)
|f (x) − P(x)| < , ∀ x ∈ [a, b].
Figure 3.1
y
y ! f(x) " ε
y ! P(x)
y ! f(x)
y ! f(x) # ε

a b x

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 79
Polynomial interpolation

So polynomials could work. But how to find the polynomial?

First Try: Taylor’s polynomial

For any given function f (x) and a point x0 , we approximate f (x)


by the Taylor’s polynomial Pn (x):

0 1 (n)
f (x) ≈ Pn (x) := f (x0 ) + f (x0 )(x − x0 ) + · · · + f (x0 )(x − x0 )n
n!

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 80
Polynomial interpolation

Example (Problem with Taylor’s polynomial)


Let f (x) = e x and x0 = 0. See how Taylor’s polynomial behaves.

1 n
Solution. Taylor’s polynomial Pn (x) = 1 + x + · · · + n! x .

However, no matter how large we choose n, Pn (x) is far from f (x)


where x is slightly large.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 81
functions, had P4 (x) = 1 + x + + + , and P5 (x) = 1 + x + + + + .
2 6 24 2 6 24 120
fluence on an entire
Issue withTheTaylor’s
f students. polynomial
graphs of the polynomials are shownapproximation
in Figure 3.2. (Notice that even for the
higher-degree polynomials, the error becomes progressively worse as we move away from
zero.)

Figure 3.2
y

20
y " P5(x)
y " ex
y " P4(x)
15
y " P3(x)

10
y " P2(x)

5
y " P1(x)

y " P0(x)
!1 1 2 3 x

Although better approximations are obtained for f (x) = ex if higher-degree Taylor


polynomials are used, this is not true for all functions. Consider, as an extreme example,
using Taylor polynomials of various degrees for f (x) = 1/x expanded about x0 = 1 to
approximate f (3) = 1/3. Since
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 82
Example

Example (Problem with Taylor’s polynomial)


1
Let f (x) = x and x0 = 1. See how Taylor’s polynomial behaves.

(−1)n n!
Solution. We know f (n) (x) = x n+1
. Then Taylor’s polynomial is
n
X
Pn (x) = (−1)n (x−1)n = 1−(x−1)+(x−1)2 +· · ·+(−1)n (x−1)n
i=0
Suppose we use Pn (x) to approximate f at x = 3, we get

P0 (3) P1 (3) P2 (3) P3 (3) P4 (3) P5 (3) P6 (3) P7 (3)


1 -1 3 -5 11 -21 43 -85

But the true value is f (3) = 13 .

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 83
Lagrange interpolating polynomial

We should not use Taylor’s polynomial since it only approximates


well locally.

Suppose we have two points (x0 , y0 ) and (x1 , y1 ), then best use a
straight line to interpolate. Define two linear polynomials:
x − x1 x − x0
L0 (x) = and L1 (x) =
x0 − x1 x1 − x0
So L0 and L1 are polynomials of degree 1, and

L0 (x1 ) = 0, L0 (x0 ) = 1, L1 (x0 ) = 0, L1 (x1 ) = 1

Now set P(x) = f (x0 )L0 (x) + f (x1 )L1 (x), then P(x) coincides
f (x) at x0 and x1 .

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 84
Example

Recall that the polynomial we derived is


x − x0 x − x1
P(x) = f (x0 )L0 (x) + f (x1 )L1 (x) = f (x0 ) + f (x1 )
x1 − x0 x0 − x1
P(x) is called the Lagrange interpolating polynomial of f given
values at x0 and x1 .

Example (Linear Lagrange interpolating polynomial)


Use linear Lagrange interpolating polynomial of f where f (2) = 5
and f (4) = 1.
Solution. P(x) = −x + 6.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 85
Lagrange interpolating polynomial

Given n + 1 points (xi , f (xi )) : 0 ≤ i ≤ n . For each i, define:

(x − x0 ) . . . (x − xk−1 )(x − xk+1 ) . . . (x − xn )


Ln,k =
(xk − x0 ) . . . (xk − xk−1 )(xk − xk+1 ) . . . (xk − xn )

for k = 0, 1, . . . , n. Then it is easy to verify


(
1 if x = xk
Ln,k (x) =
0 if x = xj , where j 6= k

Then the nth Lagrange interpolating polynomial of f is


n
X
P(x) = f (xk )Ln,k (x)
k=0

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 86
Lagrange interpolating polynomial

Interpolation and Polynomial Approximation

Illustration of Ln,k (x):


3.5
L n,k(x)

x0 x1 ... x k!1 xk x k"1 ... x n!1 xn x

The interpolating polynomial is easily described once the form of Ln,k is known. This
polynomial, called the nth Lagrange interpolating polynomial, is defined in the following
theorem.
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 87
Lagrange interpolating polynomial

The nth Lagrange interpolating polynomial of f at x0 , . . . , xn is


n
X
P(x) = f (xk )Ln,k (x)
k=0

Properties:
I P(x) is a polynomial of degree n
I P(xk ) = f (xk ) for all k = 0, . . . , n.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 88
Example

Example (Lagrange interpolating polynomial)


Let f (x) = x1 , x0 = 2, x1 = 2.75, x2 = 4. Find the 2nd Lagrange
interpolating polynomial P(x) of f (x) and compute P(3).
Solution. First we compute L2,k for k = 0, 1, 2:
(x − x1 )(x − x2 ) (x − 2.75)(x − 4)
L2,0 (x) = =
(x0 − x1 )(x0 − x2 ) (2 − 2.75)(2 − 4)
(x − x0 )(x − x2 ) (x − 2)(x − 4)
L2,1 (x) = =
(x1 − x0 )(x1 − x2 ) (2.75 − 2)(2.75 − 4)
(x − x0 )(x − x1 ) (x − 2)(x − 2.75)
L2,2 (x) = =
(x2 − x0 )(x2 − x1 ) (4 − 2)(4 − 2.75)

Then the 2nd Lagrange interpolating polynomial is


2
X x2 35x 49
P(x) = f (xk )L2,k (x) = · · · = − +
22 88 44
k=0
32 35×3 49
Note that P(3) = 22 − 88 + 44 ≈ 0.32955, close to f (3) = 31 .

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 89
9 105 49 29
f (3) ≈ P(3) = − + = ≈ 0.32955.
Example 22 88 44 88
Recall that in the opening section of this chapter (see Table 3.1) we found that no Taylor
polynomial expanded about x0 = 1 could be used to reasonably approximate f (x) = 1/x
at x Example
= 3. (Lagrange interpolating polynomial)
Let f (x) = x1 , x0 = 2, x1 = 2.75, x2 = 4. Find the 2nd Lagrange
interpolating polynomial P(x) of f (x) and compute P(3).
e 3.6
y

2 y ! f (x)

1
y ! P(x)

1 2 3 4 5 x

The interpolating polynomial P of degree less than or equal to 3 is defined in Maple


Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 90
Lagrange interpolating polynomial

Theorem (Error of Lagrange interpolating polynomial)


Suppose f (x) ∈ C n+1 [a, b]. Then for every x ∈ [a, b], ∃ ξ(x)
between x0 , . . . , xn , s.t.

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

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 91
Error of Lagrange interpolating polynomial

Proof.
For any given x ∈ [a, b] different from x0 , . . . , xn , define g (t) as

(t − x0 ) . . . (t − xn )
g (t) = f (t) − P(t) − (f (x) − P(x))
(x − x0 ) . . . (x − xn )
| {z }
polynomial of t, degree n + 1

Note that f (t) = P(t) and (t − x0 ) . . . (t − xn ) = 0 for t = xk and


k = 0, . . . , n. So g (t) = 0 for t = x, x0 , . . . , xn (total n + 2
points). By generalized Rolle’s Thm, ∃ ξ(x) between x0 , . . . , xn s.t.

(n+1) (n+1) (n + 1)! · (f (x) − P(x))


0=g (ξ(x)) = f (ξ(x)) −
(x − x0 ) . . . (x − xn )

since P(t) is a poly of t with degree n and (t − x0 ) · · · (t − xn ) is a


monic poly of t with degree n + 1.
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 92
Example

Example (Estimate error of Lagrange interpolating polynomial)


Let f (x) = x1 , x0 = 2, x1 = 2.75, x2 = 4. Estimate the maximal
error of the 2nd Lagrange interpolating polynomial P(x) given
above on [2, 4].

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 93
Example
Solution. Let P(x) be the Lagrange interpolating polynomial, then

f (3) (ξ(x))
f (x) − P(x) = (x − 2)(x − 2.75)(x − 4)
3!
We know f 0 (x) = − x12 , f 00 (x) = x23 , f 000 (x) = − x3!4 , so

f (3) (ξ(x)) 1 1

= − 4 ≤ 4 (∵ ξ(x) ∈ [2, 4])
3! (ξ(x)) 2

Further, denote h(x) := (x − 2)(x − 2.75)(x − 4), find critical


points and then the max/min values of h(x) on [2, 4] to claim
9
|h(x)| ≤ 16 for all x ∈ [2, 4]. Hence

f (3) (ξ(x)) 1 9

|f (x) − P(x)| = h(x) ≤ 4 ≈ 0.00586.
3! 2 16

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 94
Example

Example (Estimate error of Lagrange interpolating polynomial)


Suppose we use uniform partition of [0, 1] and linear Lagrange
interpolating polynomial on each segment to approximate
f (x) = e x . How small the step size h should be to guarantee the
error < 10−6 everywhere?

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 95
Example

Solution. With step size h, we have xj = jh for j = 0, 1, . . . .

Then we use linear Lagrange polynomial to approximate e x on


each [xj , xj+1 ]. The error is

1 (2)
f (ξ(x))(x − xj )(x − xj+1 )
2
f (2) (ξ(x)) e ξ(x) e
So | 2 | = | 2 | ≤ 2 (∵ ξ(x) ∈ [0, 1]).

h2
Again take h(x) = (x − xj )(x − xj+1 ) which has max Then 2.

f (2) (ξ(x)) e h2

(x − xj )(x − xj+1 ) ≤ ≤ 10−6
2 2 4

So we need h ≤ (8 × 10−6 × e −1 )1/2 ≈ 1.72 × 10−3 .

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 96
Recursive constructions of interpolating polynomials

Given points x0 , . . . , xn and function values f (xk ) for k = 0, . . . , n.

There are several questions regarding the use Lagrange


interpolating polynomial:
I Can we use a subset of points to construct Lagrange
interpolating polynomials with lower degree?
I If yes, which interpolating points among x0 , . . . , xn to choose?
I If the result is not satisfactory, can we improve the
constructed polynomial to get a polynomial of higher degree?

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 97
Example

Example (Which points to choose?)


Consider the interpolation of the function f with 5 points:
k xk f (xk )
0 1.0 0.7651977
1 1.3 0.6200860
2 1.6 0.4554022
3 1.9 0.2818186
4 2.2 0.1103623

If we use an interpolating polynomial of degree n < 4, then we


need to decide which points to use.

For example, if n = 2, then we need to chose 3 points. Should we


choose x0 , x1 , x2 or x1 , x2 , x3 , or x0 , x2 , x4 ?

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 98
Neville’s method

We do not know which choice is better, since true f (x) is


unknown. But we can compute all and see the trend.

Question: can we use polynomials obtained earlier (with lower


degree) to get the later ones (with higher degree)?
Definition (Partial interpolating polynomial)
Let f be a function with known values at x0 , . . . , xn and suppose
m1 , . . . , mk are k integers among 0, 1, . . . , n. Then the partial
Lagrange interpolating polynomial that agrees with f at
xm1 , . . . , xmk is denoted by Pm1 ,...,mk (x).

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 99
Example

Example (Partial interpolating polynomial)


Let x0 = 1, x1 = 2, x2 = 3, x3 = 4, x4 = 6 for f (x) = e x . Find
P1,2,4 (x) and approximate the value f (5).

Solution. We only use x1 , x2 , x4 to get P1,2,4 (x):


(x − x2 )(x − x4 ) (x − x1 )(x − x4 ) (x − x1 )(x − x2 )
P1,2,4 (x) = f (x1 ) + f (x2 ) + f (x4 )
(x1 − x2 )(x1 − x4 ) (x2 − x1 )(x2 − x4 ) (x4 − x1 )(x4 − x2 )
(x − 3)(x − 6) 2 (x − 2)(x − 6) 3 (x − 2)(x − 3) 6
= e + e + e
(2 − 3)(2 − 6) (3 − 2)(3 − 6) (6 − 2)(6 − 3)
1 1
P1,2,4 (5) = − e 2 + e 3 + e 6 ≈ 218.105
2 2

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 100
Recursive construction of interpolating polynomials

Now we show how to recursively construct Lagrange interpolating


polynomials:
Theorem (Recursive construction of interpolating polynomials)
Let f be defined at x0 , . . . , xk , and xi and xj are two distinct points
among them. Then

(x − xj )P0,...,j,...,k
ˆ (x) − (x − xi )P0,...,i,...,k
ˆ (x)
P0,1,...,k (x) =
xi − xj

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 101
Recursive construction of interpolating polynomials

Proof.
Denote the RHS by P(x).

Both P0,...,j,...,k
ˆ (x) and P0,...,i,...,k
ˆ (x) are polynomials of degree
k − 1, we know P(x) is a polynomial of degree ≤ k.

Verify that P(xs ) = f (xs ) for s = 0, 1, . . . , k. So


P(x) = P0,...,k (x).

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 102
Neville’s method

Suppose there are 5 points x0 , . . . , x4 , and Pi := f (xi ) for all i,


then we can construct the following table:

x0 P0
(x−x0 )P1 −(x−x1 )P0
x1 P1 P0,1 = x1 −x0
(x−x1 )P2 −(x−x2 )P1 (x−x0 )P1,2 −(x−x2 )P0,1
x2 P2 P1,2 = x2 −x1 P0,1,2 = x2 −x0
(x−x2 )P3 −(x−x3 )P2 (x−x1 )P2,3 −(x−x3 )P1,2 ..
x3 P3 P2,3 = x3 −x2 P1,2,3 = x3 −x1
.
(x−x3 )P4 −(x−x4 )P3 (x−x2 )P3,4 −(x−x4 )P2,3
x4 P4 P3,4 = x4 −x3 P2,3,4 = x4 −x2 ...

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 103
Neville’s method

We introduce a new notation Qij = Pi−j,i−j+1,...,i (i is the ending


index and j + 1 is the length), then the previous table is just

x0 Q0,0
x1 Q1,0 Q1,1
x2 Q2,0 Q2,1 Q2,2
x3 Q3,0 Q3,1 Q3,2 Q3,3
x4 Q4,0 Q4,1 Q4,2 Q4,3 Q4,4
For example Q3,3 = P0,1,2,3 , Q4,3 = P1,2,3,4 , etc.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 104
Example (Neville’s method)
Consider the interpolation of the function f with 5 points:
k xk f (xk )
0 1.0 0.7651977
1 1.3 0.6200860
2 1.6 0.4554022
3 1.9 0.2818186
4 2.2 0.1103623

In addition, interpolate f (1.5) and compare to the true value2 .

2
The data in this table were retrieved from a Bessel function with true value
f (1.5) = 0.5118277.
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 105
Neville’s iterated interpolation

Neville’s iterated interpolation method:


I Input. x0 , . . . , xn and values Qi,0 = f (xi ) for all i.
I For each i = 1, . . . , n: compute
(x−xi−j )Qi,j−1 −(x−xi )Qi−1,j−1
Qi,j = xi −xi−j for j = 1, . . . , i.
I Output. Table Q with P(x) = Qn,n .

Properties of Neville’s method:


1. Add new interpolating nodes easily.
2. Can stop if |Qi,i − Qi−1,i−1 | < tol .

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 106
Divided difference
We can also get the polynomials, not just the interpolating values.

Consider the polynomial Pn (x) of degree n defined by


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

To make it the Lagrangian interpolating polynomial of f at


x0 , . . . , xn , we need to find ai s.t. Pn (xi ) = f (xi ) for all xi .

It is easy to check that:

Pn (x0 ) = a0 = f (x0 ) =⇒ a0 = f (x0 )


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

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 107
Divided difference
We define the following notations of divided difference:

f [xi ] = f (xi )
f [xi+1 ] − f [xi ]
f [xi , xi+1 ] =
xi+1 − xi
f [xi+1 , xi+2 ] − f [xi , xi+1 ]
f [xi , xi+1 , xi+2 ] =
xi+2 − xi
..
.
Once the (k − 1)th divided differences are determined, we can get
the kth divided difference as
f [x1 , . . . , xk ] − f [x0 , . . . , xk−1 ]
f [x0 , . . . , xk ] =
xk − x0
until we get f [x0 , . . . , xn ]. Then set ak = f [x0 , . . . , xk ] for all k:
n
X
Pn (x) = f [x0 ] + f [x0 , . . . , xk ](x − x0 ) . . . (x − xk )
k=1
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 108
Divided difference

We can construct a table of divided difference as follows:

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 ]
x4 f [x4 ] f [x3 , x4 ] f [x2 , x3 , x4 ] f [x1 , x2 , x3 , x4 ] f [x0 , x1 , x2 , x3 , x4 ]

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 109
Divided difference

We can introduce a new notation Fi,j = f [xi−j , . . . , xi ], then the


table can be written as
x0 F0,0
x1 F1,0 F1,1
x2 F2,0 F2,1 F2,2
x3 F3,0 F3,1 F3,2 F3,3
x4 F4,0 F4,1 F4,2 F4,3 F4,4

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 110
Newton’s divided difference formula

Newton’s divided difference


I Input. x0 , . . . , xn and values Fi,0 = f (xi ) for all i.
I For each i = 1, . . . , n: set Fi,j = Fi,j−1 −Fi−1,j−1
xi −xi−j for j = 1, . . . , i.
I Output. Fi,i for i = 0, . . . , n, and set
n
X
Pn (x) = F0,0 + Fi,i (x − x0 ) . . . (x − xi−1 )
i=1

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 111
Special case

In the special case where xi+1 − xi = h for all i, then xi = x0 + ih.


Now if we want to know the value of f at xs = x0 + sh (s can be
non-integer), then
n
X
Pn (xs ) = f [x0 ] + f [x0 , . . . , xk ](xs − x0 ) . . . (xs − xk−1 )
k=1
Xn
= f [x0 ] + f [x0 , . . . , xk ](sh)((s − 1)h) . . . ((s − k + 1)h)
k=1
Xn
− 1) . . . (s − k + 1)
k s(s
= f [x0 ] + f [x0 , . . . , xk ]h k!
k!
k=1
Xn  
k s
= f [x0 ] + f [x0 , . . . , xk ]h k!
k
k=1

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 112
Special case

If we adopt the Aitkin’s ∆2 to simplify notations:


f (x1 ) − f (x0 ) 1 1
f [x0 , x1 ] = = (f (x1 ) − f (x0 )) = ∆f (x0 )
x1 − x0 h h
f [x1 , x2 ] − f [x0 , x1 ] 1 1 1 1
f [x0 , x1 , x2 ] = = ( ∆f (x1 ) − ∆f (x0 )) = 2 ∆2 f (x0 )
x2 − x0 2h h h 2h
..
.
1 k
f [x0 , . . . , xk ] = · · · = ∆ f (x0 )
k!hk

Newton’s divided difference becomes:


n  
X s
Pn (x) = f [x0 ] + ∆k f (x0 )
k
k=1

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 113
Backward difference
We can also use the backward differences:

∇pn := pn − pn−1 and ∇k pn = ∇(∇k−1 pn ) 3

Suppose the points are in reverse order: xn , xn−1 , . . . , x0 , then

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

If xs = xn + sh (s is negative non-integer), then we can derive:


n
X  
−s
Pn (x) = f [xn ] + (−1)k ∇k f (xn )
k
k=1

3
For example, ∇2 pn = (pn − pn−1 ) − (pn−1 − pn−2 ) = pn − 2pn−1 + pn−2 .
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 114
Hermite interpolation

Suppose we also have derivatives f (k) (xi ) at points xi for


k = 0, . . . , mi , we can find the polynomial P(x) s.t.

P (k) (xi ) = f (k) (xi ), ∀ i, k

The total number of conditions (values) we have is


n
X n
X
n̂ := (mi + 1) = (n + 1) + mi
i=0 i=0

So we can find a polynomial P of degree n̂.

Such a polynomial is called an osculating polynomial.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 115
Hermite polynomial
We’re mostly interested in the case with mi = 1, ∀ i. That is, we
have f (xi ) and f 0 (xi ) at each xi .

We want to construct a polynomial P(x) of degree 2n + 1, s.t.


P(xi ) = f (xi ) and P 0 (xi ) = f (xi ), ∀ i.

Let Ln,j (x) be the Lagrange polynomial of degree n such that


(
6 j
0, if i =
Ln,j (xi ) =
1, if i = j

We define two polynomials (both of degree 2n + 1):

Hn,j (x) = (1 − 2(x − xj )L0n,j (xj ))L2n,j (x)


Ĥn,j (x) = (x − xj )L2n,j (x)

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 116
Hermite polynomial

Theorem (Construction of Hermite polynomial)


If f ∈ C 1 [a, b] and x0 , . . . , xn ∈ [a, b] are distinct, then the
polynomial of least degree that satisfies P(xi ) = f (xi ) and
P 0 (xi ) = f 0 (xi ) is
n
X n
X
H2n+1 (x) := f (xj )Hn,j (x) + f 0 (xj )Ĥn,j (x)
j=0 j=0

which has degree ≤ 2n + 1.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 117
Hermite polynomial
Proof.
It’s clear the degree ≤ n + 1. Also,
(
0, if i 6= j
Hn,j (xi ) = and Ĥn,j (xi ) = 0, ∀i
1, if i = j

So H2n+1 (xi ) = f (xi ) ∀ i. Also


0
Hn,j (x) = −2L0n,j (xj )L2n,j (x) + (2 − 4(x − xj )L0n,j (xj ))Ln,j (x)L0n,j (x)
0
Ĥn,j (x) = L2n,j (x) + 2(x − xj )Ln,j (x)L0n,j (x)

Therefore
(
0 0 0, if i 6= j
Hn,j (xi ) = 0 ∀ i, and Ĥn,j (x) =
1, if i = j
0
Hence H2n+1 (x) = f 0 (xi ), ∀ i.
Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 118
Hermite polynomials

We can also construct Hermite polynomials using divided


difference.

Suppose we have x0 , x1 , . . . , xn and f (xi ), f 0 (xi ) are given. Define


z2i = z2i+1 = xi for i = 0, . . . , n

For example, z0 = z1 = x0 , z2 = z3 = x1 , etc.

Now we have z0 , z1 , . . . , z2n+1 , total of 2(n + 1) points. So


2n+1
X
H2n+1 (x) = f [z0 ] + f [z0 , . . . , zk ](z − z0 ) . . . (z − zk )
k=1

and use f 0 (xi ) as f [z2i , z2i+1 ] for all i = 0, . . . , n.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 119
Hermite polynomial

Then we construct the table as follows,

z 0 = x0 f [z0 ] = f (x0 )
z 1 = x0 f [z1 ] = f (x0 ) f [z0 , z1 ] = f 0 (x0 )
f [z2 ]−f [z1 ]
z 2 = x1 f [z2 ] = f (x1 ) f [z1 , z2 ] = z2 −z1
f [z0 , z1 , z2 ]
0
z 3 = x1 f [z3 ] = f (x1 ) f [z2 , z3 ] = f (x1 ) f [z1 , z2 , z3 ] f [z0 , z1 , z2 , z3 ]
f [z4 ]−f [z3 ]
z 4 = x2 f [z4 ] = f (x2 ) f [z3 , z4 ] = z4 −z3
f [z2 , z3 , z4 ] f [z1 , z2 , z3 , z4 ] f [z0 , z1 , z2 , z3 , z4 ]
0
z 5 = x3 f [z5 ] = f (x3 ) f [z4 , z5 ] = f (x2 ) f [z3 , z4 , z5 ] f [z2 , z3 , z4 , z5 ] f [z1 , z2 , z3 , z4 , z5 ]
.
.
.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 120
Hermite interpolation

Hermite interpolation polynomial


I Input. Distinct x0 , . . . , xn , f (xi ), f 0 (xi ) ∀ i.
I For i = 0, . . . , n, do (# Assign values Q·,0 , Q·,1 )
1. Set z2i = z2i+1 = xi , Q2i,0 = Q2i+1,0 = f (xi ), Q2i+1,1 = f 0 (xi ).
Q −Q2i−1,0
6 0, then set Q2i,1 = 2i,0
2. If i = z2i −z2i−1 .
I For i = 2, . . . , 2n + 1 and j = 2, . . . , i, set

Qi,j−1 − Qi−1,j−1
Qi,j =
zi − zi−j
I Output. Hermite polynomial coeff. Q0,0 , . . . , Q2n+1,2n+1 , s.t.

H(x) =Q0,0 + Q1,1 (x − x0 ) + Q2,2 (x − x0 )2 + · · ·


+ Q2n+1,2n+1 (x − x0 )2 . . . (x − xn )2

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 121

You might also like