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,…,xn−1xn−x0x0≠xn

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!hn∑k=0nf(x0+kh)(−1)k(nk)


Interpolating Polynomials

Lagrange Polynomials

p(x)=∑f(xj)Ln,j(x), where Ln,j=∏i=0nx−xixj−xi

Basis for space of polynomials Pn is

{(x−x1)…(x−xn)(x0−x1)…(x0−xn),(x−x0)(x−x2)…(x−xn)(x1−x0)(x1−x2)…(x1−xn),…,(x−x0)(x−x1)…(x−xn−1)(xn−x0)(xn−x1)…(xn−xn−1}

There are n+1 independent functions in Pn.


Newton Polynomials

p(x)=f(x0)+f[x0,x1](x−x0)+f[x0,x1,x2](x−x0)(x−x1)+…+f[x0,x1,…,xn](x−x0)…(x−xn−1)

Basis for space of polynomials Pn is

{1,x−x0,(x−x0)(x−x1),(x−x0)(x−x1)(x−x2),…}


Hermite Polynomials

Interpolate function and derivative:

Find H2n+1(x) such that H2n+1(xj)=f(xj) and H2′n+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 i≠j
  • dH^n,jdx(xj)=1

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

Take derivative to find α:

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

Therefore α=1.

H^n,j(x)=(x−xj)(Ln,j(x))2


Find Hn,j

Restrictions:

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

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

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

Hn,j(x)(Ln,j(x))2(1−2Ln′,j(xj)(x−xj))


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+5x−8x2+11x2(x−1)−194x2(x−1)2−34x2(x−1)2(x−2)=7+(x−2)−5(x−2)2−11(x−2)2(x−1)−254(x−2)2(x−1)2−34(x−2)2(x−1)2x


Hermite

First we need the lagrange polynomials:

L2,0(x)=(x−1)(x−2)(0−1)(0−2)=12(x−1)(x−2)L2,1(x)=(x−0)(x−2)(1−0)(1−2)=−x(x−2)L2,2(x)=(x−0)(x−1)(2−0)(2−1)=12x(x−1)

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

H5(x)=5x((x−1)(x−2)2)2+0+1(x−2)(x(x−1)2)2+…


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

L2′,0(x)=x−32L2′,1(x)=−2x+2L2′,2(x)=x−12

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⋅(x−1)2(x−2)24(1−2(−32)x)+1⋅x2(x−2)2+7⋅x2(x−1)24(1−2⋅32(x−2))+5x((x−1)(x−2)2)2+0+1(x−2)(x(x−1)2)2


Quiz

Nothing from section 3.5

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