3.1 interpolation and lagrange polynomialzxu2/acms40390f12/lec-3.1.pdfΒ Β· interpolation β€’ problem...

10
3.1 Interpolation and Lagrange Polynomial 1

Upload: others

Post on 14-Jan-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

3.1 Interpolation and Lagrange Polynomial

1

Page 2: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

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

… …

Page 3: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

β€’ 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

Page 4: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

β€’ 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

Page 5: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

𝒏-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

Page 6: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

β€’ 𝐿6,3(π‘₯) for points π‘₯𝑖 = 𝑖, 𝑖 = 0,… , 6.

6

Page 7: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

β€’ 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

Page 8: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

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

Page 9: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

β€’ 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

Page 10: 3.1 Interpolation and Lagrange Polynomialzxu2/acms40390F12/Lec-3.1.pdfΒ Β· Interpolation β€’ Problem to be solved: Given a set of 𝑛+1sample values of an unknown function , we wish

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