• Tidak ada hasil yang ditemukan

Newton’s Interpolation Formula: Divided Differences

Dalam dokumen 4 Systems of Linear Equations 190 (Halaman 53-58)

2.1 Interpolation by Polynomials

2.1.3 Newton’s Interpolation Formula: Divided Differences

The recursion (2.1.2.5) then translates into (2.1.2.6)

Qik:= (Di,k−1−Qi−1,k−1) xi−x xi−k−xi Dik:= (Di,k−1−Qi−1,k−1)xi−k−x xi−k−xi









1≤k≤i, i= 0,1, . . . .

Starting with Qi0 := Di0 := fi, one calculates Qik, Dik from the above recursion. Finally

Pnn := fn+ n k=1

Qnk.

If the valuesf0, . . . , fn are close to each other, the quantitiesQik will be small compared to fi. This suggests forming the sum of the “corrections”

Qn1, . . . , Qnnfirst [contrary to (2.1.2.5)] and then adding it tofn, thereby avoiding unnecessary roundoff errors.

Note finally that forx= 0 the recursion (2.1.2.5) takes a particularly simple form

(2.1.2.7a) Ti0:= fi

(2.1.2.7b) Tik:= Ti,k−1+Ti,k−1−Ti−1,k−1 xi−k

xi 1

, 1≤k≤i ,

— as does its analog (2.1.2.6). These forms are encountered when applying extrapolation methods.

For historical reasons mainly, we mentionAitken’s algorithm. . It is also based on (2.1.2.1), but uses different intermediate polynomials. Its tableau is of the form

x0 f0=P0(x)

x1 f1=P1(x) P01(x)

x2 f2=P2(x) P02(x) P012(x)

x3 f3=P3(x) P03(x) P013(x) P0123(x)

· · · · · ·

The first column again contains the prescribed valuesfi. Each subsequent entry derives from the previous entry in the same row and the top entry in the previous column according to (2.1.2.1b).

or if one wants to find interpolating values for several argumentsξj simul- taneously, then Newton’s interpolation formula ff is to be preferred. Here we write the interpolating polynomialP ∈Πn,P(xi) =fi,i= 0, 1,. . . n, in the form

(2.1.3.1)

P(x)≡P01...n(x)

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

Note that the evaluation of (2.1.3.1) forx=ξmay be done recursively as indicated by the following expression:

P(ξ) = (· · ·(an(ξ−xn−1) +an−1)(ξ−xn−2) +· · ·+a1)(ξ−x0) +a0. This requires fewer operations than evaluating (2.1.3.1) term by term. It corresponds to the so-called Horner scheme for evaluating polynomials which are given in the usual form, i.e. in terms of powers of x, and it shows that the representation (2.1.3.1) is well suited for evaluation.

It remains to determine the coefficientsaiin (2.1.3.1). In principle, they can be calculated successively from

f0=P(x0) =a0

f1=P(x1) =a0+a1(x1−x0)

f2=P(x2) =a0+a1(x2−x0) +a2(x2−x0)(x2−x1)

· · ·

This can be done with ndivisions andn(n−1) multiplications. There is, however, a better way, which requires onlyn(n+ 1)/2 divisions and which produces useful intermediate results.

Observe that the two polynomialsPi0i1...ik−1(x) andPi0i1...ik(x) differ by a polynomial of degree k with k zeros xi0, xi1,. . ., xik−1, since both polynomials interpolate the corresponding support points. Therefore there exists a unique coefficient

(2.1.3.2) fi0i1...ik such that

(2.1.3.3)

Pi0i1...ik(x) =Pi0i1...ik−1(x) +fi0i1...ik(x−xi0)(x−xi1)· · ·(x−xik−1). From this and from the identityPi0≡fi0 it follows immediately that (2.1.3.4) Pi0i1...ik(x) =fi0+fi0i1(x−xi0) +· · ·

+fi0i1...ik(x−xi0)(x−xi1)· · ·(x−xik−1)

is a Newton representation of the interpolating polynomialPi0,...,ik(x). The coefficients (2.1.3.2) are calledkth divided differences.

The recursion (2.1.2.1) for the partially interpolating polynomials translates into the recursion

(2.1.3.5) fi0i1...ik= fi1...ik−fi0...ik−1 xik−xi0

for the divided differences, since by (2.1.3.3), fi1...ik and fi0...ik−1 are the coefficients of the highest terms of the polynomialsPi1i2...ik andPi0i1...ik−1, respectively. The above recursion starts for k= 0 with the given support ordinatesfi,i= 0, . . . , n. It can be used in various ways for calculating di- vided differencesfi0,fi0i1,. . .,fi0i1...in, which then characterize the desired interpolating poynomialP=Pi0i1...in.

Because the polynomialPi0i1...ikis uniquely determined by the support points it interpolates [Theorem (2.1.1.1)], the polynomial is invariant to any permutation of the indicesi0,i1, . . . , ik, and so is its coefficientfi0i1...ik of xk. Thus:

(2.1.3.6).The divided differencesfi0i1...ik are invariant to permutations of the indicesi0,i1, . . . , ik: If

(j0, j1, . . . , jk) = (is0, is1, . . . , isk) is a permutation of the indicesi0,i1, . . . , ik, then

fj0j1...jk=fi0i1...ik.

If we choose to calculate the divided differences in analogy to Neville’s method — instead of, say, Aitken’s method — then we are led to the following tableau, called thedivided-difference scheme:

(2.1.3.7)

k= 0 1 2 · · ·

x0 f0

f01

x1 f1 f012

f12 ... . ..

x2 f2 ...

... ...

The entries in the second column are of the form f01= f1−f0

x1−x0, f12= f2−f1 x2−x1, . . . , those in the third column,

f012=f12−f01

x2−x0 , f123=f23−f12

x3−x1 , . . . .

Clearly,

P(x)≡P01...n(x)

≡f0+f01(x−x0) +· · ·+f01...n(x−x0)(x−x1)· · ·(x−xn−1) is the desired solution to the interpolation problem at hand. The coefficients of the above expansion are found in the top descending diagonal of the divided-difference scheme (2.1.3.7).

Example.With the numbers of the example in sections 2.1.1 and 2.1.2, we have:

x0= 0 f0= 1

f01= 2

x1= 1 f1= 3 f012=56 f12=12

x2= 3 f2= 2

P012(x) = 1 + 2·(x−0)56(x−0)(x−1), P012(2) = (56·(21) + 2)(20) + 1 =103.

Instead of building the divided-difference scheme column by column, one might want to start with the upper left corner and add successive ascending diagonal rows. This amounts to adding new support points one at a time after having interpolated the previous ones. In the following ALGOL procedure, the entries in an ascending diagonal of (2.1.3.7) are found, after each increase ofi, in the top portion of arrayt, and the firsti coefficientsf01...iare found in array a.

fori:= 0 step1 until n do begint[i] :=f[i];

for j:=i−1 step1 until 0 do t[j] := (t[j+ 1]−t[j])/(x[i]−x[j]);

a[i] :=t[0]

end ;

Afterwards, the interpolationg polynomial (2.1.3.1) may be evaluated for any desired argumentz:

p:=a[n];

fori:=n−1 step 1 until 0 do p:=(z−x[i]) +a[i];

Some Newton representations of the same polynomial are numerically more trustworth to evaluate than others. Choosing the permutation so that

|ξ−xik| ≥ |ξ−xik−1|, k= 0,1, . . . , n−1,

dampens the error (see Section 1.3) during the Horner evaluation of

(2.1.3.8)

P(ξ)≡Pi0...in(ξ)≡fi0+fi0i1(ξ−xi0)+· · ·+fi0i1...in(ξ−xi0)· · ·(ξ−xin−1).

All Newton representations of the above kind can be found in the sin- gle divided-difference scheme which arises if the support arguments xi, i= 0, . . . , n, are ordered by size: xi < xi+1 fori= 0, . . . , n−1. Then the preferred sequence of indices i0, i1, . . ., ik is such that each index ik is

“adjacent” to some previous index. More precisely, either ik = min{il | 0≤l < k} −1 orik= max{il|0≤l < k}+ 1. Therefore the coefficients of (2.1.3.8) are found along a zigzag path—instead of the upper descend- ing diagonal—of the divided-difference scheme. Starting withfi0, the path proceeds to the upper right neighbor if ik < ik−1, or to the lower right neighbor ifik > ik−1.

Example.In the previous example, a preferred sequence forξ= 2 is i0= 1, i1= 2, i2= 0.

The corresponding path in the divided difference scheme is indicated below:

x0= 0 f0= 1

f01= 2

x1= 1 f1= 3 f012=56 f12=12

x2= 3 f2= 2 The desired Newton representation is:

P120(x) = 312(x−1)56(x−1)(x−3) P120(2) = (56(23)12(21) + 3 =103.

Frequently, the support ordinates fi are values f(xi) = fi of a given function f(x), which one wants to approximate by interpolation. In this case, the divided differences may be considered as multivariate functions of the support argumentsxi, and are historically written as

f[xi0, xi1, . . . , xik].

These functions satisfy (2.1.3.5). For instance, f[x0] =f(x0)

f[x0, x1] = f[x1]−f[x0]

x1−x0 =f(x1)−f(x0) x1−x0 f[x0, x1, x2] = f[x1, x2]−f[x0, x1]

x2−x0

= f(x0)(x1−x2) +f(x1)(x2−x0) +f(x2)(x0−x1) (x1−x0)(x2−x1)(x0−x2) .

Also, (2.1.3.6) gives immediately:

(2.1.3.9) Theorem.The divided differencesf[xi0, . . . , xik]are symmetric functions of their arguments, i.e., they are invariant to permutations of the xi0,. . .,xik.

If the functionf(x) is itself a polynomial, then we have the (2.1.3.10) Theorem.If f(x) is a polynomial of degreeN, then

f[x0, . . . , xk] = 0 fork > N.

Proof. Because of the unique solvability of the interpolation problem [Theorem (2.1.1.1)], P01···k(x) f(x) for k N. The coefficient of xk in P01···k(x) must therefore vanish fork > N. This coefficient, however, is given byf[x0, . . . , xk] according to (2.1.3.3).

Example.f(x) =x2

xi k= 0 1 2 3 4

0 0

1

1 1 1

3 0

2 4 1 0

5 0

3 9 1

7

4 16

If the functionf(x) is sufficiently often differentiable, then its divided differences f[x0, . . . , xk] can also be defined if some of the arguments xi coincide. For instance, if f(x) has a derivative at x0, then it makes sense for certain purposes to define

f[x0, x0] :=f(x0).

For a corresponding modification of the divided-difference scheme (2.1.3.7) see Section 2.1.5 on Hermite interpolation.

Dalam dokumen 4 Systems of Linear Equations 190 (Halaman 53-58)