MATH 417 Lecture 6

From Notes
Jump to navigation Jump to search

« previous | Thursday, January 30, 2014 | next »


Last Time

Find p(x) of degree pn such that p(xi)=f(xi) given samples x0,x1,,xn of f.

  1. There is a unique p(x)
  2. p(x)=k=1nf(x)i=1;iknxxixkxi
  3. f(x)p(x)=f(n+1)(ξ)(n+1)!k=0n(xxk)

Iterative Process for Lagrange Interpolating Polynomial

Given x0,x1,,xn1,xn,

  1. L0(x) interpolates f(x) at x0,x1,,xn1: L0(xi)=f(xi) for 0in1
  2. L1(x) interpolates f(x) at x1,,xn1,xn: L1(xi)=f(xi) for 1in1

Can we find p(x)=()L0(x)+()L1(x)? Paul Neville did.

Conditions: p(x0)=f(x0) and p(xn)=f(xn) Hence

pn(x)=(xxnx0xn)L0(x)+(xx0xnx0)L1(x)=(xx0)L1(x)(xxn)L0(x)xnx0
  1. At iteration i=0, our interpolations of each point are the constants xi
  2. At iteration i=1, our interpolations of each consecutive pair of points are linear
  3. At iteration i=2, our interpolations of each consecutive triple of points are quadratic
  4. etc.
  5. until we combine all points into pn(x)

However, this method is unstable (especially when points are close together, and xxixkxi in the product has much roundoff error)


Newton's Formula for p(x)

Given x0,x1, we can find

  1. f(x)f(x0)=p0(x).
  2. f(x)p1(x)=f(x0)+f(x1)f(x0)x1x0(xx0)

Observe that p1(x)f(x0)+f(x0)1!(xx0) as xx0

f(x)=pn1(x)+f[x0,x1,,xn]k=0n1(xxk)

Where f[x0,x1,,xn] is the coefficient of xn in pn(x).

We know from above that

  1. f[x0]=f(x0)
  2. f[x0,x1]={f(x1)f(x0)x1x0x1x0f(x0)1!x1=x0

We can extract

f[x0,x1,x2]={f[x1,x2]f[x0,x1]x2x0x2x0f(x0)2!x0=x1=x2

In general, when the points coincide, we take the Taylor series.

Applying this to Neville's iterative method, we find

  • L1(x)=f[x1,x2,,xn]xn1+Θ(xn2)
  • L0(x)=f[x0,x1,,xn1]xn1+Θ(xn2)
  • pn(x)=xnf[x1,,xn]f[x0,,xn1xnx0+Θ(xn1)


In General,

f[x0,,xn]={f[x1,,xn]f[x0,,xn1]xnx0xnx0f(n)(x0)n!x0=x1==xn

And

pn(x)=f(x0)+f[x0,x1](xx0)+f[x0,x1,x2](xx0)(xx1)++f[x0,x1,,xn](xx0)(xxn1)

Example

x f(x) f[.,.] f[.,.,.] f[.,.,.,.] f[.,.,.,.,.] f[.,.,.,.,.,.]
0  4
         -3
1  1             9/2
          6              -17/6
2  7              -4                  11/12
         -2                5/6                     -3/20
3  5            -3/2                    1/6
         -5                3/2
4  0               3
          1
5  1

Therefore

  • p2(x)=43x+92x(x1)
  • p5(x)=43x+92x(x1)176x(x1)(x2)+1112x(x1)(x2)(x3)320x(x1)(x2)(x3)(x4)

We could have interpolated the polynomial in reverse:

p5(x)=1+1(x5)+3(x5)(x4)+32(x5)(x4)(x3)+16(x5)(x4)(x3)(x2)320(x5)(x4)(x3)(x2)(x1)


Since p5(x) is unique, forwards and backwards methods (and Lagrange's) must give the same result.

Example 2

This cannot be interpolated by Lagrange's method

x 0 1 2
f(x) 2 1 2
f(x) -1 1

Goal: Find p4 such that p4(xi)=f(xi) and p4(xi)=f(xi).

x f(x) f[.,.] f[.,.,.] f[.,.,.,.] f[.,.,.,.,.]
0  2
         -1
0  2              0
         -1                 2
1  1              2                   -3/2
          1                -1
1  1              0
          1
2  2
Note: If we are given the n-th derivative of f at a point, we repeat that point n+1 times in the table. Conversely, if we want to repeat a point k times in the table, we need the values of the k+1-th derivative at that point

Therefore p4(x)=2x+0x2+2x2(x1)32x2(x1)2.


Homework

3.3: 10, 11, 12, 13, 14, 15