01.12.2014 Views

LECTURE 3: Polynomial interpolation and numerical differentiation

LECTURE 3: Polynomial interpolation and numerical differentiation

LECTURE 3: Polynomial interpolation and numerical differentiation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In general, an analysis of errors goes as follows: Suppose that p n is the polynomial of<br />

least degree that interpolates f at the nodes x 0 ,x 1 ,...,x n . Then according to first theorem<br />

on interpolating errors (Sec.3.2):<br />

f(x)− p n (x)=<br />

1<br />

(n+1)! f(n+1) (ξ)w(x)<br />

with ξ dependent on x <strong>and</strong> w(x)=(x−x 0 )...(x−x n ). Differentiating gives<br />

f ′ (x)− p ′ n(x)=<br />

1<br />

(n+1)! w(x) d 1<br />

dx f(n+1) (ξ)+<br />

(n+1)! f(n+1) (ξ)w ′ (x)<br />

The first observation is that w(x) vanishes at each node. The evaluation is simpler if it is<br />

done at a node x i :<br />

f ′ (x i )= p ′ 1<br />

n(x i )+<br />

(n+1)! f(n+1) (ξ)w ′ (x i )<br />

The second observation is that it becomes simpler if x is chosen such that w ′ (x)=0. Then<br />

f ′ (x i )= p ′ n (x i)+<br />

1<br />

(n+1)! w(x) d dx f(n+1) (ξ)<br />

Example.<br />

Derive a first-derivative formula for f ′ (x) using an interpolating polynomial p 3 (x) obtained<br />

with four nodes x 0 , x 1 , x 2 <strong>and</strong> x 3 . Use central difference in choosing the nodes.<br />

Solution. The interpolating polynomial written in the Newton form is<br />

Its derivative is<br />

p 3 (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 />

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

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

+ f[x 0 ,x 1 ,x 2 ,x 3 ]{(x−x 1 )(x−x 2 )+(x−x 0 )(x−x 2 )<br />

+(x−x 0 )(x−x 1 )}<br />

Formulas for the divided differences can be obtained<br />

recursively:<br />

f[x i ]= f(x i )<br />

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

x i+1 − x i<br />

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

x i+2 − x i<br />

We now choose the nodes using central difference:<br />

x 0 = x−h, x 1 = x+h, x 2 = x−2h, x 3 = x+2h.

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

Saved successfully!

Ooh no, something went wrong!