Interpolation Using Equally Spaced Points

advertisement
Jim Lambers
MAT 460/560
Fall Semester 2009-10
Lecture 18 Notes
These notes correspond to Section 3.2 in the text.
Interpolation Using Equally Spaced Points
Suppose that the interpolation points π‘₯0 , π‘₯1 , . . . , π‘₯𝑛 are equally spaced; that is, π‘₯𝑖 = π‘₯0 + π‘–β„Ž for
some positive number β„Ž. In this case, the Newton interpolating polynomial can be simplified, since
the denominators of all of the divided differences can be expressed in terms of the spacing β„Ž. If we
recall the forward difference operator Δ, defined by
Δπ‘₯π‘˜ = π‘₯π‘˜+1 − π‘₯π‘˜ ,
where {π‘₯π‘˜ } is any sequence, then the divided differences 𝑓 [π‘₯0 , π‘₯1 , . . . , π‘₯π‘˜ ] are given by
𝑓 [π‘₯0 , π‘₯1 , . . . , π‘₯π‘˜ ] =
1
Δπ‘˜ 𝑓 (π‘₯0 ).
π‘˜!β„Žπ‘˜
The interpolating polynomial can then be described by the Newton forward-difference formula
)
𝑛 (
∑
𝑠
Δπ‘˜ 𝑓 (π‘₯0 ),
𝑝𝑛 (π‘₯) = 𝑓 [π‘₯0 ] +
π‘˜
π‘˜=1
where the new variable 𝑠 is related to π‘₯ by
𝑠=
(
and the extended binomial coefficient
(
𝑠
π‘˜
)
=
𝑠
π‘˜
π‘₯ − π‘₯0
,
β„Ž
)
is defined by
𝑠(𝑠 − 1)(𝑠 − 2) ⋅ ⋅ ⋅ (𝑠 − π‘˜ + 1)
,
π‘˜!
where π‘˜ is a nonnegative integer.
Example We will use the Newton forward-difference formula
)
𝑛 (
∑
𝑠
𝑝𝑛 (π‘₯) = 𝑓 [π‘₯0 ] +
Δπ‘˜ 𝑓 (π‘₯0 )
π‘˜
π‘˜=1
to compute the interpolating polynomial 𝑝3 (π‘₯) that fits the data
1
𝑖
0
1
2
3
π‘₯𝑖
−1
0
1
2
𝑓 (π‘₯𝑖 )
3
−4
5
−6
In other words, we must have 𝑝3 (−1) = 3, 𝑝3 (0) = −4, 𝑝3 (1) = 5, and 𝑝3 (2) = −6. Note that the
interpolation points π‘₯0 = −1, π‘₯1 = 0, π‘₯2 = 1 and π‘₯3 = 2 are equally spaced, with spacing β„Ž = 1.
To apply the forward-difference formula, we define 𝑠 = (π‘₯ − π‘₯0 )/β„Ž = π‘₯ + 1 and compute
( )
𝑠
= 𝑠
1
= π‘₯ + 1,
( )
𝑠(𝑠 − 1)
𝑠
=
2
2
π‘₯(π‘₯ + 1)
=
,
2
( )
𝑠(𝑠 − 1)(𝑠 − 2)
𝑠
=
3
6
(π‘₯ + 1)π‘₯(π‘₯ − 1)
,
=
6
𝑓 [π‘₯0 ] = 𝑓 (π‘₯0 )
= 3,
Δ𝑓 (π‘₯0 ) = 𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )
= −4 − 3
= −7,
2
Δ π‘“ (π‘₯0 ) = Δ(Δ𝑓 (π‘₯0 ))
= Δ[𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )]
= [𝑓 (π‘₯2 ) − 𝑓 (π‘₯1 )] − [𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )]
= 𝑓 (π‘₯2 ) − 2𝑓 (π‘₯1 ) + 𝑓 (π‘₯0 )
= 5 − 2(−4) + 3,
= 16
3
Δ π‘“ (π‘₯0 ) = Δ(Δ2 𝑓 (π‘₯0 ))
= Δ[𝑓 (π‘₯2 ) − 2𝑓 (π‘₯1 ) + 𝑓 (π‘₯0 )]
= [𝑓 (π‘₯3 ) − 𝑓 (π‘₯2 )] − 2[𝑓 (π‘₯2 ) − 𝑓 (π‘₯1 )] + [𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )]
= 𝑓 (π‘₯3 ) − 3𝑓 (π‘₯2 ) + 3𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )
= −6 − 3(5) + 3(−4) − 3
2
= −36.
It follows that
𝑝3 (π‘₯) =
=
=
=
)
3 (
∑
𝑠
𝑓 [π‘₯0 ] +
Δπ‘˜ 𝑓 (π‘₯0 )
π‘˜
π‘˜=1
( )
( )
( )
𝑠
𝑠
𝑠
2
3+
Δ𝑓 (π‘₯0 ) +
Δ π‘“ (π‘₯0 ) +
Δ3 𝑓 (π‘₯0 )
1
1
2
(π‘₯ + 1)π‘₯(π‘₯ − 1)
π‘₯(π‘₯ + 1)
16 +
(−36)
3 + (π‘₯ + 1)(−7) +
2
6
3 − 7(π‘₯ + 1) + 8(π‘₯ + 1)π‘₯ − 6(π‘₯ + 1)π‘₯(π‘₯ − 1).
Note that the forward-difference formula computes the same form of the interpolating polynomial
as the Newton divided-difference formula. β–‘
If we define the backward difference operator ∇ by
∇π‘₯π‘˜ = π‘₯π‘˜ − π‘₯π‘˜−1 ,
for any sequence {π‘₯π‘˜ }, then we obtain the Newton backward-difference formula
𝑝𝑛 (π‘₯) = 𝑓 [π‘₯𝑛 ] +
𝑛
∑
π‘˜
(
(−1)
π‘˜=1
−𝑠
π‘˜
)
∇π‘˜ 𝑓 (π‘₯𝑛 ),
where 𝑠 = (π‘₯ − π‘₯𝑛 )/β„Ž, and the preceding definition of the extended binomial coefficient applies.
Example We will use the Newton backward-difference formula
𝑝𝑛 (π‘₯) = 𝑓 [π‘₯𝑛 ] +
𝑛
∑
π‘˜
(−1)
π‘˜=1
(
−𝑠
π‘˜
)
∇π‘˜ 𝑓 (π‘₯𝑛 )
to compute the interpolating polynomial 𝑝3 (π‘₯) that fits the data
𝑖
0
1
2
3
π‘₯𝑖
−1
0
1
2
𝑓 (π‘₯𝑖 )
3
−4
5
−6
In other words, we must have 𝑝3 (−1) = 3, 𝑝3 (0) = −4, 𝑝3 (1) = 5, and 𝑝3 (2) = −6. Note that the
interpolation points π‘₯0 = −1, π‘₯1 = 0, π‘₯2 = 1 and π‘₯3 = 2 are equally spaced, with spacing β„Ž = 1.
3
To apply the backward-difference formula, we define 𝑠 = (π‘₯ − π‘₯3 )/β„Ž = π‘₯ − 2 and compute
(
)
−𝑠
= −𝑠
1
= −(π‘₯ − 2),
(
)
−𝑠(−𝑠 − 1)
−𝑠
=
2
2
𝑠(𝑠 + 1)
=
2
(π‘₯ − 2)(π‘₯ − 1)
=
,
2
(
)
−𝑠(−𝑠 − 1)(−𝑠 − 2)
−𝑠
=
3
6
𝑠(𝑠 + 1)(𝑠 + 2)
= −
6
(π‘₯ − 2)(π‘₯ − 1)π‘₯
,
= −
6
𝑓 [π‘₯3 ] = 𝑓 (π‘₯3 )
= −6,
∇𝑓 (π‘₯3 ) = 𝑓 (π‘₯3 ) − 𝑓 (π‘₯2 )
= −6 − 5
= −11,
2
∇ 𝑓 (π‘₯3 ) = ∇(∇𝑓 (π‘₯3 ))
= Δ[𝑓 (π‘₯3 ) − 𝑓 (π‘₯2 )]
= [𝑓 (π‘₯3 ) − 𝑓 (π‘₯2 )] − [𝑓 (π‘₯ − 2) − 𝑓 (π‘₯1 )]
= 𝑓 (π‘₯3 ) − 2𝑓 (π‘₯2 ) + 𝑓 (π‘₯1 )
= −6 − 2(5) + −4,
= −20
3
∇ 𝑓 (π‘₯3 ) = ∇(∇2 𝑓 (π‘₯3 ))
= ∇[𝑓 (π‘₯3 ) − 2𝑓 (π‘₯2 ) + 𝑓 (π‘₯1 )]
= [𝑓 (π‘₯3 ) − 𝑓 (π‘₯2 )] − 2[𝑓 (π‘₯2 ) − 𝑓 (π‘₯1 )] + [𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )]
= 𝑓 (π‘₯3 ) − 3𝑓 (π‘₯2 ) + 3𝑓 (π‘₯1 ) − 𝑓 (π‘₯0 )
= −6 − 3(5) + 3(−4) − 3
= −36.
4
It follows that
𝑝3 (π‘₯) = 𝑓 [π‘₯3 ] +
3
∑
(−1)π‘˜
π‘˜=1
(
(
−𝑠
π‘˜
∇π‘˜ 𝑓 (π‘₯3 )
)
(
)
−𝑠
−𝑠
2
= −6 −
∇𝑓 (π‘₯3 ) +
∇ 𝑓 (π‘₯3 ) −
∇3 𝑓 (π‘₯3 )
1
2
−(π‘₯ − 2)(π‘₯ − 1)π‘₯
(π‘₯ − 2)(π‘₯ − 1)
(−20) −
(−36)
= −6 − [−(π‘₯ − 2)](−11) +
2
6
= −6 − 11(π‘₯ − 2) − 10(π‘₯ − 2)(π‘₯ − 1) − 6(π‘₯ − 2)(π‘₯ − 1)π‘₯.
−𝑠
1
)
)
(
Note that the backward-difference formula does not compute the same form of the interpolating
polynomial 𝑝𝑛 (π‘₯) as the Newton divided-difference formula. Instead, it computes a different Newton
form of 𝑝𝑛 (π‘₯) given by
𝑝𝑛 (π‘₯) =
𝑛
∑
𝑗=0
𝑓 [π‘₯𝑗 , π‘₯𝑗+1 , . . . , π‘₯𝑛 ]
𝑛
∏
(π‘₯ − π‘₯𝑖 )
𝑖=𝑗+1
= 𝑓 [π‘₯𝑛 ] + 𝑓 [π‘₯𝑛−1 , π‘₯𝑛 ](π‘₯ − π‘₯𝑛 ) + 𝑓 [π‘₯𝑛−2 , π‘₯𝑛−1 , π‘₯𝑛 ](π‘₯ − π‘₯𝑛−1 )(π‘₯ − π‘₯𝑛 ) +
⋅ ⋅ ⋅ + 𝑓 [π‘₯0 , π‘₯1 , . . . , π‘₯𝑛 ](π‘₯ − π‘₯1 )(π‘₯ − π‘₯2 ) ⋅ ⋅ ⋅ (π‘₯ − π‘₯𝑛−1 )(π‘₯ − π‘₯𝑛 ).
The divided-differences 𝑓 [π‘₯𝑗 , . . . , π‘₯𝑛 ], for 𝑗 = 0, 1, . . . , 𝑛, can be obtained by constructing a divideddifference table as in the first example. These divided differences appear in the bottom row of the
table, whereas the divided differences used in the forward-difference formula appear in the top row.
β–‘
5
Download