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 x0−h, x0, and x0+3h, approximate f′(x0−h) using the values f(x0−h), f(x0), and f(x0+3h) within O(h2) accuracy.

Taylor Method:

f(x0)=f(x0−h+h)=f(x0−h)+hf′(x0−h)+h22f″(x0−h)+h33!f‴(ξ1)

f(x0+3h)=f(x0−h+4h)=f(x0−h)+4hf′(x0−h)+16h22f″(x0−h)+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(x0−h)+(16h−4h)f′(x0−h)+0+(163!f‴(ξ1)−643!f‴(ξ2))h3

Now we solve for f′(x0−h):

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


Section 4.3: Numerical Integration

Given an interval 0≤x≤1, we want to find ∫01f(x)dx≈A0f(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+A1∫01(x−1)dx=A0(x0−1)+A1⋅0∫01(x−1)2dx=A0(x0−1)2+A1⋅02

Hence we get the system

A0+A1=1(x0−1)A0=−12(x0−1)A0(x0−1)=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(x−13)2(1−x)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:

0→101→1413→13⋅4+10

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

∫1014g(y)dy≈41(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)dy≈f(10)+3f(14−43)


Composite Simpson's Rule

As done by Stirling (ca. 1730)

Simpson's rule:

∫abf(x)dx−b−a2(f(a)+f(a+b−a2)+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 g≥0 (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=(b−a)h(ξ)h(ξ)=1b−a∫abh(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](x−a)+f[a,a+b2,b](x−a)(x−a+b2)+f[a,a+b2,b,a+b2](x−a)(x−a+b2)(x−b)

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](x−a)+f[a,a+b2,b](x−a)(x−a+b2)dx+∫abf[a,a+b2,b,a+b2](x−a)(x−a+b2)(x−b)

Now ∫ab(x−a)(x−a+b2)(x−b)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!(x−a)(x−a+b2)(x−b)(x−a+b2)

So

∫abf(x)dx−∫abp3(x)=−124∫abf(4)(ξ(x))(x−a)(x−b)(x−a+b2)2

Let h(x)=f(4)(ξ(x)), and g(x)=(x−a)(x−b)(x−a+b2)

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

∫abg(x)dx=∫ab(x−a)(x−b)(x−a+b2)dx

Let y=x−a+b2 and h=b−a2, then

∫−hhy2(y+h)(y−h)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=0n−1∫x2kx2k+2f(x)dx≈∑k=0n−1h(f(x2k)+4f(x2k+1)+f(x2k+2))

Where h=b−a2h.

Simplifying the expression above gives

∫abf(x)dx=b−a2n(f(a)+f(b)+4∑k=0n−1f(x2k+1)+∑k=1n−1f(x2k))


The error of this composite is given by

∑k=1n(−f(4)(ξk)90(b−a2n)5)=−h4(b−a)180⋅1n∑k=1nf(4)(ξk)⏟f(4)(ζ)

Hence error∈O(h4)