MATH 417 Lecture 7

From Notes
Jump to navigation Jump to search

« previous | Tuesday, February 4, 2014 | next »


Review

f[x0,x1,,xn]={f(n)(x0)x0=x1==xnf[x1,x2,,xn]f[x0,,xn1xnx0x0xn

Finite and Divided Differences

Definition of finite difference:

Δhg(x0)=g(x0+h)g(x0)Δhn+1f(x0)=Δhnf(x0+h)Δhnf(x0)Δh0f(x0)=f(x0)


If points are equidistant, then

f[x0,x1]=f(x0+h)f(x0)h=Δhf(x0)hf[x0,x1+h,x2+2h,,xn]=(1)nn!hnk=0nf(x0+kh)(1)k(nk)


Interpolating Polynomials

Lagrange Polynomials

p(x)=f(xj)Ln,j(x), where Ln,j=i=0nxxixjxi

Basis for space of polynomials Pn is

{(xx1)(xxn)(x0x1)(x0xn),(xx0)(xx2)(xxn)(x1x0)(x1x2)(x1xn),,(xx0)(xx1)(xxn1)(xnx0)(xnx1)(xnxn1}

There are n+1 independent functions in Pn.


Newton Polynomials

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

Basis for space of polynomials Pn is

{1,xx0,(xx0)(xx1),(xx0)(xx1)(xx2),}


Hermite Polynomials

Interpolate function and derivative:

Find H2n+1(x) such that H2n+1(xj)=f(xj) and H2n+1(xj)=f(xj) for j=0,1,,n.


H2n+1=j=0nf(xj)Hn,j(x)+j=0nf(xj)H^n,j(x)

Find H^n,j(x)

Restrictions:

  • H^n,j(xi)=0 for all i
  • H^n,j(xi)=0 if ij
  • dH^n,jdx(xj)=1

H^n,j(x)=α(xxj)(Ln,j(x))2, where α is some constant

Take derivative to find α:

H^n,j(x)=αLn,j2(xj)+α(xjxj)2Ln,j(xj)Ln,j(xj)

Therefore α=1.

H^n,j(x)=(xxj)(Ln,j(x))2


Find Hn,j

Restrictions:

  • Hn,j(xi)=0 for ij
  • Hn,j(xj)=1
  • H'n,j(xi)=0 for all i.

Hn,j(x)=(Ln,j(x))2(1+a(xxj)), where a is some constant.

Differentiating this function reveals a=2Ln,j(xj). Therefore

Hn,j(x)(Ln,j(x))2(12Ln,j(xj)(xxj))


Example

Use Newton's and Hermite's method to compute H2n+1 for n=2 (H5)

Newton
x 0 1 2
f 4 1 7
f 5 0 1

Starting point is

x f(x)
0  4
      5
0  4

1  1
      0
1  1

2  7
      1
2  7

Completed table is

x f(x)
0  4
       5
0  4      -8
      -3       11
1  1       3       -19/4
       0      3/2         -3/4
1  1       6       -25/4
       6      -11
2  7      -5
       1 
2  7

H5(x)0,0,1,1,2,2=4+5x8x2+11x2(x1)194x2(x1)234x2(x1)2(x2)=7+(x2)5(x2)211(x2)2(x1)254(x2)2(x1)234(x2)2(x1)2x


Hermite

First we need the lagrange polynomials:

L2,0(x)=(x1)(x2)(01)(02)=12(x1)(x2)L2,1(x)=(x0)(x2)(10)(12)=x(x2)L2,2(x)=(x0)(x1)(20)(21)=12x(x1)

Therefore, plugging these into the H^-part of our formula for H2n+1 gives

H5(x)=5x((x1)(x2)2)2+0+1(x2)(x(x1)2)2+


Now we need to find the derivatives of our lagrange polynomials above:

L2,0(x)=x32L2,1(x)=2x+2L2,2(x)=x12

Evaluated at our points, we get

L2,0(0)=32L2,1(1)=0L2,2(2)=32

Plugging these values into the H-part of our formula for H2n+1 gives

H5(x)=4(x1)2(x2)24(12(32)x)+1x2(x2)2+7x2(x1)24(1232(x2))+5x((x1)(x2)2)2+0+1(x2)(x(x1)2)2


Quiz

Nothing from section 3.5

Most likely something to do with interpolating polynomials (if no method is specified, use Newton)