MATH 417 Lecture 11

From Notes
Jump to navigation Jump to search

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


Section 4.1: Numerical Differentiation

Given some points x0h, x0, and x0+3h, approximate f(x0h) using the values f(x0h), f(x0), and f(x0+3h) within O(h2) accuracy.

Taylor Method:

f(x0)=f(x0h+h)=f(x0h)+hf(x0h)+h22f(x0h)+h33!f(ξ1)

f(x0+3h)=f(x0h+4h)=f(x0h)+4hf(x0h)+16h22f(x0h)+64h33!f(ξ2)

To cancel the f term, we need to multiply the first equation by 16 and subtract the equations. Doing so yields

16f(x0)f(x0+3h)=15f(x0h)+(16h4h)f(x0h)+0+(163!f(ξ1)643!f(ξ2))h3

Now we solve for f(x0h):

15f(x0h)+16f(x0)f(x0+3h)12h=f(x0h)+h3(163!f(ξ)643!f(ξ2))12h=f(x0h)+h2(83f(ξ)323f(ξ2))12


Section 4.3: Numerical Integration

Given an interval 0x1, we want to find 01f(x)dxA0f(x0)+A1f(1).

To do this, we must find a rule with the least degree of accuracy (DAC) such that the approximation is equivalent for polynomials of degree n.

011dx=A0+A101(x1)dx=A0(x01)+A1001(x1)2dx=A0(x01)2+A102

Hence we get the system

A0+A1=1(x01)A0=12(x01)A0(x01)=13

The solution: A0=34, A1=14, and x0=13

Hence the approximation is equal for polynomials of degree 2:

01f(x)dx=34f(13)+14f(1).

This approximation does not work for polynomials of degree 3 because 01(x13)2(1x)dx is "approximated" to be 0, but is actually positive.


Shifted and Scaled Interval

Using the previous approximation, we want to approximate 1014g(x)dx. The interval maps correspondingly:

01011413134+10

We keep the same coefficients, but multiply by the ratio of the new interval length to the old:

1014g(y)dy41(34f(10+43)+14f(14))=3f(11+13)+f(14)

We keep the same degree of accuracy (i.e. 2) because shifting and scaling is just a linear change of variables.


We can find an alternate rule if we keep the other endpoint (i.e. 10):

1014g(y)dyf(10)+3f(1443)


Composite Simpson's Rule

As done by Stirling (ca. 1730)

Simpson's rule:

abf(x)dxba2(f(a)+f(a+ba2)+f(b))

This rule is exact for polynomials of of up to degree 3, hence DAG = 3


We are going to need the following theorem:

Theorem. [Intermediate Value Theorem]. let g and h be continuous functions with g0 (without loss of generality) on an interval x[a,b]. Then

abg(x)h(x)dx=h(ξ)abg(x)dx

If g(x)=1,

abh(x)dx=(ba)h(ξ)h(ξ)=1baabh(x)dx

Proof. (omitted)

quod erat demonstrandum


Given f(x), we interpolate at a, a+b2, b, and a+b2 (Find p3(x)).

p3(x)=f(a)+f[a,a+b2](xa)+f[a,a+b2,b](xa)(xa+b2)+f[a,a+b2,b,a+b2](xa)(xa+b2)(xb)

The first 3 terms are the Lagrange interpolating polynomial p2(x), and the third is "more" ... something to do with f.

Now abf(x)dx=abp3(x)dx=abf(a)+f[a,a+b2](xa)+f[a,a+b2,b](xa)(xa+b2)dx+abf[a,a+b2,b,a+b2](xa)(xa+b2)(xb)

Now ab(xa)(xa+b2)(xb)dx=0, so we're left with the integral of the interpolating polynomial p2(x):

abf(x)dx=abp2(x)dx


Computing the Error

f(x)p3(x)=f(4)(ξ(x))4!(xa)(xa+b2)(xb)(xa+b2)

So

abf(x)dxabp3(x)=124abf(4)(ξ(x))(xa)(xb)(xa+b2)2

Let h(x)=f(4)(ξ(x)), and g(x)=(xa)(xb)(xa+b2)

Then abh(x)g(x)dx=h(ζ)abg(x)dx by the intermediate value theorem.

abg(x)dx=ab(xa)(xb)(xa+b2)dx

Let y=xa+b2 and h=ba2, then

hhy2(y+h)(yh)dy=4h515


Therefore, the error is f(4)(ξ(ζ))244h515=f(4)(ξ1)90h5


Composite Rule

Suppose we apply Simpson's rule n times (hence we need 2n points) over a large interval [a,b]. In other words, we take n sub-intervals of [a,b] that have equal length.

abf(x)dx=k=0n1x2kx2k+2f(x)dxk=0n1h(f(x2k)+4f(x2k+1)+f(x2k+2))

Where h=ba2h.

Simplifying the expression above gives

abf(x)dx=ba2n(f(a)+f(b)+4k=0n1f(x2k+1)+k=1n1f(x2k))


The error of this composite is given by

k=1n(f(4)(ξk)90(ba2n)5)=h4(ba)1801nk=1nf(4)(ξk)f(4)(ζ)

Hence errorO(h4)