MATH 417 Lecture 9

From Notes
Jump to navigation Jump to search

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


Section 4.1

Given the values f(x0),,f(xn), we want to approximate f(k)(xj) by a numerical rule.

  1. f(x)Pn(x), where Pn(x) is the Lagrange polynomial
  2. f(k)(xj)=dkdxk(Pn(x))|x=xj

We are interested in the absolute error of (2).

We know the error of (1) is

|f(x)Pn(x)|=|f(n+1)(ξ(x))(n+1)!||k=0n(xxk)|

If all points are equidistant (at a distance h), then the error is O(hn+1)

By taking k derivatives, we expect the error of (2) to be at most O(hn+1)hk=O(hn+1k).

Taylor Series

Given 3 points f(x0h), f(x0), and f(x0+h), what is the second derivative at the midpoint (f(x0)). We expect it to be O(h).

The Taylor Series expansions of f(x0+h) and f(x0h) are

f(x0+h)=f(x0)+hf(x0)+h22f(x0)+h33!f(x0)+h44!f(4)(ξ)f(x0h)=f(x0)hf(x0)+h22f(x0)h33!f(x0)+h44!f(4)(ζ)

Where ξ(x0,x0+h), and ζ(x0h,x0).

Adding both equations gives

f(x0+h)+f(x0h)=2f(x0)+h2f(x0)+2h44!f(4)++2h2n(2n)!f(2n)(x0)=2f(x0)+h2f(x0)+h44!(f(4)(ξ)+f(4)(ζ))

Observe that we have

f(x0+h)2f(x0)+f(x0h)h2=f(x0)+h212f(4)(ξ)+f(4)(ζ)2

Hence our error is

h212f(4)(η)

for some η(x0h,x0+h) (this is true by the mean value theorem: the average value of a function between two points is also a value of the function between the two points)


Richardson Extrapolation

From Taylor series expansion of f(x0+h) centered at x0, we get

E(h)=f(x0+h)f(x0)hf(x0)=h2!f(x0)+h23!f(3)(x0)++hn1n!f(n)(x0)+.

E(2h)=f(x0+2h)f(x0)2hf(x0)=hf(x0)+(2h)23!f(3)(x0)++(2h)n1n!f(n)(x0)+.

Taking 2E(h)E(2h) gives

2(f(x0+h)f(x0)hf(x0))f(x0+2h)f(x0)2h+f(x0)=(2h23!(2h)23!)f(x0)++(2hn1n!(2h)n1n!)f(n)(x0)+f(x0+2h)+4f(x0+h)3f(x0)2hf(x0)=13h2f(x0)6h34!f(4)(x0)14h45!f(5)

Let's call that last equation E~(h). Now we can recursively do 4E~(h)E~(2h)=O(h3):

f(x0+4h)12f(x0+2h)+32f(x0+h)23f(x0)12hf(x0)=O(h3)

Richardson Extrapolation on Taylor Series Rule

Suppose we want f(x0)rule=O(h4). Then we need 5 points.

To find the rule, we take 4E(h)E(2h)4, where

E(h)=f(x0+h)2f(x0)+f(x0+h)h2f(x0)=2h24!f(4)(x0)+2h46!f(6)(x0)++2h2n2(2n)!f(2n)(x0)+

After some algebra, we get

f(x0+2h)+16f(x0+h)30f(x0)+16f(x0h)f(x02h)12h2f(x0)=O(h4)

Example: Undetermined Coefficients

Given points x03h, x0, and x0+5h, find an approximation of f(x0) of order O(h2) using the values f(x03h), f(x0), and f(x0+5h).

There are three ways to find this (unique) answer:

  1. find P2(x), differentiate, and plug in x0.
  2. Taylor series/undetermined coefficients:
    • f(x03h)=f(x0)3hf(x0)+9h22f(x0)27h33!f(x0)+O(h4)
    • Failed to parse (syntax error): {\displaystyle f(x_0+5h) = f(x_0) + 5h \, f'(x_0) + \frac{25h^2}{2} \, f''(x_0) + \frac{125h^3}{3!} \' f'''(x_0) + O(h^4)}
    • Take Af(x03h)+Bf(x0+5h)=(A+B)f(x0)=h(5B3A)f(x0)+h22(25B+9A)f(x0)+h36(126B+27A)f(x0)+(A+B)O(h4)
    • We want the coefficient of f(x) to be 1 and the coefficient of f(x0) to be 0, so A=25120h and B=340h.
    • Plugging this back in gives 25f(x03h)120h+3f(x0+5h)40h(25120h+3040h)f(x0)=f(x0)+O(h2)
    • Simplified, our rule is 9f(x0+5h)+16f(x0)25f(x03h)120hf(x0)=O(h2)