06.09.2021 Views

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3. INTERPOLATION 101<br />

Solution. We want to compute<br />

p 2 (x) =f[x 0 ]+f[x 0 ,x 1 ](x − x 0 )+f[x 0 ,x 1 ,x 2 ](x − x 0 )(x − x 1 ).<br />

Here are the f<strong>in</strong>ite differences:<br />

x f[x] <strong>First</strong> divided difference Second divided difference<br />

x 0 = −1 f[x 0 ]=−6<br />

f[x 0 ,x 1 ]= f[x 1]−f[x 0 ]<br />

x 1 −x 0<br />

= 3<br />

x 1 =1 f[x 1 ]=0 f[x 0 ,x 1 ,x 2 ]= f[x 1,x 2 ]−f[x 0 ,x 1 ]<br />

x 2 −x 0<br />

= 1<br />

f[x 1 ,x 2 ]= f[x 2]−f[x 1 ]<br />

x 2 −x 1<br />

=6<br />

x 2 =2 f[x 2 ]=6<br />

Therefore<br />

p 2 (x) =−6 + 3(x +1)+1(x +1)(x − 1),<br />

which is the same polynomial we had <strong>in</strong> Example 49.<br />

Exercise 3.1-4:<br />

Consider the function f given <strong>in</strong> the follow<strong>in</strong>g table.<br />

x 1 2 4 6<br />

f(x) 2 3 5 9<br />

a) Construct a divided difference table for f by hand, and write the Newton form of the<br />

<strong>in</strong>terpolat<strong>in</strong>g polynomial us<strong>in</strong>g the divided differences.<br />

b) Assume you are given a new data po<strong>in</strong>t for the function: x =3,y =4. F<strong>in</strong>d the<br />

new <strong>in</strong>terpolat<strong>in</strong>g polynomial. (H<strong>in</strong>t: Th<strong>in</strong>k about how to update the <strong>in</strong>terpolat<strong>in</strong>g<br />

polynomial you found <strong>in</strong> part (a).)<br />

c) If you were work<strong>in</strong>g <strong>with</strong> the Lagrange form of the <strong>in</strong>terpolat<strong>in</strong>g polynomial <strong>in</strong>stead of<br />

the Newton form, and you were given an additional data po<strong>in</strong>t like <strong>in</strong> part (b), how<br />

easy would it be (compared to what you did <strong>in</strong> part (b)) to update your <strong>in</strong>terpolat<strong>in</strong>g<br />

polynomial?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!