MATH 417 Lecture 13

From Notes
Jump to navigation Jump to search

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


Gaussian Rule

for n points x1,x2,,xn, our degree of accuracy is 2n1=2(n1)+1.


Legendre Polynomials

Pn(x)=dndxn((1x2)n)=(1)n(2n)!n!(xx1)(xx2)(xxn)

Our goal is to find roots where Pn(x)=0

Recall that the inner product space L2[1,1] is f,g=11f(x)g(x)dx

11Pn(x)q(x)dx=0 for any q(x), where deg(q)n1.

Theorem

Theorem. [Gaussian Rule]. The degree of accuracy of the Gaussian Rule is 2n1 if and only if for all polynomials p(x) of degree 2n1

11P(x)dx=i=1nAip(xi)

Proof. Take p(x) such that the degree of p is at most n1. Then p(x) is identical the Lagrange polynomial i=1ni=1np(xi)Ln,i(x)=i=1np(xi)(j=1;jin(xxj)(xixj))

Since the polynomials are equal, then their integrals are equal:

11p(x)dx=i=1np(xi)11Ln,i(x)dx=i=1nP(xi)Ai

Now take p(x) such that the degree of p is at most 2n1. Then p(x)=Q(x)Pn(x)+R(x), where deg(Q),deg(R)n1.

11p(x)dx=11Q(x)Pn(x)dx+11R(x)=11R(x)dx=i=1nAip(xi)

Observe that the integral is equilavent to zero because deg(Q)n1, and integrating by parts n times gives boundary terms+11dnQdxn(x)=0(1x2)n Evaluating the boundary terms (1x2)n(1+x2)n at the points 1 and 1 both give zero, so we are left with 0+0=0.

quod erat demonstrandum


Now on an arbitrary interval, we have 2baabP(x)dx=i=1nAiP(xi) simply by change of variables.


Example

P5(x)=60x(120560x2+504x4) has 5 roots x1<x2<x3<x4<x5. We know that x3=0, x2=x4, x1=x5.

Solving the equation gives


Error Estimation

Remember Hermite polynomials?

f(x)H2n1(x)=f(2n)(ξ(x))(2n)!(xx1)2(xx2)2(xxn)2

Our error is then

E(x)=abf(x)dxabH2n1(x)dx=abf(2n)(ξ(x))(2n)!(xx1)2(xx2)2(xxn)2

By the intermediate value theorem,

abf(2n)(ξ(x))(2n)!(xx1)2(xx2)2(xxn)2=f(2n)(ζ)(2n)!ab(xx1)2(xx2)2(xxn)2

If we let h:=maxi(xxi), then

|E(x)||f(2n)(ζ)|(2n)!h2n+1


Composite Rule

Recall that the compasite simpson's rule error was

f(4)(ζ)90h4

In comparison, the composite gaussian rule error is at most

maxaxb|f(2n)(x)|1(2n)!h2n


Example

For example, if |f(4)|1 and ϵ=1010, then how many intervals N do we need?

Gaussian
c(2n)!(1N)2n<1010
If we use the n=5 rule as used in the previous example then N=9, so we sample the function at nN=45 points.
Simpson
c90(1N)4<1010
N10104=102.5300, so we sample the function at 2300=600 points
Midpoint
c24(1N)2<1010
N105, so we sample the function at 105 points
Trapezoidal rule
c12(1N)2<1010
N105, so we sample the function at 105+1 points


Hence the midpoint and Trapezoidal rules are lousy, but for a concave-up function (i.e. f>0), the trapezoidal rule always overestimates, and the midpoint rule always underestimates. Therefore, we can get a bound on the value of the exact integral


Section 4.6: Adaptive Integration

If we have a function that "behaves nicely" (i.e. is flat or behaves like a cubic function) on certain intervals and does something interesting on other intervals, we can use several different rules on each interval, but adaptive integratino does this sort of thing "automatically"

Suppose we use Simpson's rule over an entire integral [a,b] (let h=ba2 be the midpoint between a and b):

abba2(f(a)+4f(a+h)+f(b)=f(4)(μ)90h5)

Now what if we split the interval at the midpoint and compute two Simpson's rules:

aa+hf(x)dx+a+hbf(x)dx[S(a,a+b2)+S(a+b2,b)]==116(f(4)(ξ)90h5)


If we assume f(4) is either constant or does not change much, we can assume f(μ)f(ξ):

Δ=S(a,a+b2)+S(a+b2,b)S(a,b)15(116f(4)(ξ)90h5)=15error of S(a,a+b2)+S(a+b2,b)


Algorithm 4.3

Given:

  • ϵ>0
  • "flexibility coefficient" k (usually 10)
  • interval [a,b]
  1. Compute Δ (do simpson's rule on [a,b] and on half-intervals)
  2. if |Δ|<kϵ, then stop
  3. Otherwise, subdivide [a,b] into half-intervals with ϵ2 accuracy
  4. Go to 1 (recursive)