3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfย ยท Interpolation โ€ข Problem...

10
3.1 Interpolation and Lagrange Polynomial 1

Transcript of 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfย ยท Interpolation โ€ข Problem...

3.1 Interpolation and Lagrange Polynomial

1

Interpolation โ€ข Problem to be solved: Given a set of ๐‘› + 1sample values of an

unknown function ๐‘“, we wish to determine a polynomial of degree ๐‘› so that

๐‘ƒ ๐‘ฅ๐‘– = ๐‘“ ๐‘ฅ๐‘– = ๐‘ฆ๐‘– , ๐‘– = 0, 1,โ€ฆ , ๐‘›

Weierstrass Approximation theorem Suppose ๐‘“ โˆˆ ๐ถ[๐‘Ž, ๐‘]. Then โˆ€๐œ– > 0, โˆƒ a polynomial ๐‘ƒ ๐‘ฅ : ๐‘“ ๐‘ฅ โˆ’ ๐‘ƒ ๐‘ฅ < ๐œ–, โˆ€๐‘ฅ โˆˆ ๐‘Ž, ๐‘ .

Remark: 1. The bound is uniform, i.e. valid for all ๐‘ฅ in ๐‘Ž, ๐‘ 2. The way to find ๐‘ƒ ๐‘ฅ is unknown.

2

๐’™ ๐’‡(๐’™)

0 0

1 0.84

2 0.91

3 0.14

4 -0.76

โ€ฆ โ€ฆ

โ€ข Question: Can Taylor polynomial be used here? โ€ข Taylor expansion is accurate in the neighborhood of one point.

We need to the (interpolating) polynomial to pass many points.

โ€ข Example. Taylor approximation of ๐‘’๐‘ฅ for ๐‘ฅ โˆˆ [0,3]

3

โ€ข Problem: Construct a functions passing through two points (๐‘ฅ0, ๐‘“ ๐‘ฅ0 ) and (๐‘ฅ1, ๐‘“ ๐‘ฅ1 ).

First, define ๐ฟ0 ๐‘ฅ =๐‘ฅโˆ’๐‘ฅ1

๐‘ฅ0โˆ’๐‘ฅ1, ๐ฟ1 ๐‘ฅ =

๐‘ฅโˆ’๐‘ฅ0

๐‘ฅ1โˆ’๐‘ฅ0

Note: ๐ฟ0 ๐‘ฅ0 = 1; ๐ฟ0 ๐‘ฅ1 = 0

๐ฟ1 ๐‘ฅ0 = 0; ๐ฟ0 ๐‘ฅ1 = 1

Then define the interpolating polynomial ๐‘ƒ ๐‘ฅ = ๐ฟ0 ๐‘ฅ ๐‘“ ๐‘ฅ0 + ๐ฟ1 ๐‘ฅ ๐‘“(๐‘ฅ1)

Note:๐‘ƒ ๐‘ฅ0 = ๐‘“ ๐‘ฅ0 , and ๐‘ƒ ๐‘ฅ1 = ๐‘“ ๐‘ฅ1

Claim: ๐‘ƒ ๐‘ฅ is the unique linear polynomial passing through (๐‘ฅ0, ๐‘“ ๐‘ฅ0 ) and (๐‘ฅ1, ๐‘“ ๐‘ฅ1 ). 4

Linear Lagrange Interpolating Polynomial Passing through ๐Ÿ Points

๐’-degree Polynomial Passing through ๐’ + ๐Ÿ Points

โ€ข Constructing a polynomial passing through the points (๐‘ฅ0, ๐‘“ ๐‘ฅ0 ), ๐‘ฅ1, ๐‘“ ๐‘ฅ1 , ๐‘ฅ2, ๐‘“ ๐‘ฅ2 , โ€ฆ , (๐‘ฅ๐‘›, ๐‘“ ๐‘ฅ๐‘› ).

Define Lagrange basis functions

๐ฟ๐‘›,๐‘˜ ๐‘ฅ = ๐‘ฅโˆ’๐‘ฅ๐‘–

๐‘ฅ๐‘˜โˆ’๐‘ฅ๐‘–

๐‘›๐‘–=0,๐‘–โ‰ ๐‘˜ =

๐‘ฅโˆ’๐‘ฅ0

๐‘ฅ๐‘˜โˆ’๐‘ฅ0โ€ฆ๐‘ฅโˆ’๐‘ฅ๐‘˜โˆ’1

๐‘ฅ๐‘˜โˆ’๐‘ฅ๐‘˜โˆ’1โˆ™๐‘ฅโˆ’๐‘ฅ๐‘˜+1

๐‘ฅ๐‘˜โˆ’๐‘ฅ๐‘˜+1โ€ฆ๐‘ฅโˆ’๐‘ฅ๐‘›

๐‘ฅ๐‘˜โˆ’๐‘ฅ๐‘› for ๐‘˜ = 0,1โ€ฆ๐‘›.

Remark: ๐ฟ๐‘›,๐‘˜ ๐‘ฅ๐‘˜ = 1; ๐ฟ๐‘›,๐‘˜ ๐‘ฅ๐‘– = 0, โˆ€๐‘– โ‰  ๐‘˜.

5

โ€ข ๐ฟ6,3(๐‘ฅ) for points ๐‘ฅ๐‘– = ๐‘–, ๐‘– = 0,โ€ฆ , 6.

6

โ€ข Theorem. If ๐‘ฅ0, โ€ฆ , ๐‘ฅ๐‘› are ๐‘› + 1distinct numbers and ๐‘“ is a function whose values are given at these numbers, then a unique polynomial ๐‘ƒ(๐‘ฅ) of degree at most ๐’ exists with ๐‘ƒ ๐‘ฅ๐‘˜ = ๐‘“ ๐‘ฅ๐‘˜ , for each ๐‘˜ = 0, 1, โ€ฆ ๐‘›.

๐‘ƒ ๐‘ฅ = ๐‘“ ๐‘ฅ0 ๐ฟ๐‘›,0 ๐‘ฅ +โ‹ฏ+ ๐‘“ ๐‘ฅ๐‘› ๐ฟ๐‘›,๐‘› ๐‘ฅ .

Where ๐ฟ๐‘›,๐‘˜ ๐‘ฅ = ๐‘ฅโˆ’๐‘ฅ๐‘–

๐‘ฅ๐‘˜โˆ’๐‘ฅ๐‘–

๐‘›๐‘–=0,๐‘–โ‰ ๐‘˜ .

7

Error Bound for the Lagrange Interpolating Polynomial

Theorem. Suppose ๐‘ฅ0, โ€ฆ , ๐‘ฅ๐‘› are distinct numbers in the interval [๐‘Ž, ๐‘] and ๐‘“ โˆˆ ๐ถ๐‘›+1 ๐‘Ž, ๐‘ . Then for each ๐‘ฅ in [๐‘Ž, ๐‘], a number ๐œ‰(๐‘ฅ) (generally unknown) between ๐‘ฅ0, โ€ฆ , ๐‘ฅ๐‘›, and hence in (๐‘Ž, ๐‘), exists with ๐‘“ ๐‘ฅ =

๐‘ƒ ๐‘ฅ +๐‘“ ๐‘›+ ๐œ‰ ๐‘ฅ

๐‘›+1 !๐‘ฅ โˆ’ ๐‘ฅ0 ๐‘ฅ โˆ’ ๐‘ฅ1 โ€ฆ ๐‘ฅ โˆ’ ๐‘ฅ๐‘› .

Where ๐‘ƒ ๐‘ฅ is the Lagrange interpolating polynomial.

8

โ€ข Remark:

1. Applying the error term may be difficult. ๐‘ฅ โˆ’ ๐‘ฅ0 ๐‘ฅ โˆ’ ๐‘ฅ1 โ€ฆ ๐‘ฅ โˆ’ ๐‘ฅ๐‘› is oscillatory. ๐œ‰ ๐‘ฅ is generally

unknown.

2. The error formula is important as they are used for numerical differentiation and integration.

Plot of ๐‘ฅ โˆ’ 0 ๐‘ฅ โˆ’ 1 ๐‘ฅ โˆ’ 2 ๐‘ฅ โˆ’ 3 ๐‘ฅ โˆ’ 4

9

Example. Suppose a table is to be prepared for ๐‘“ ๐‘ฅ = ๐‘’๐‘ฅ, ๐‘ฅ โˆˆ [0,1]. Assume the number of decimal places to be given per entry is ๐‘‘ โ‰ฅ 8 and that the difference between adjacent ๐‘ฅ-values, the step size is โ„Ž. What step size โ„Ž will ensure that linear interpolation gives an absolute error of at most 10โˆ’6 for all ๐‘ฅ in 0,1 .

10