November 4, 2005 --- Class 19 --- Numerical Integration in One Dimension
Numerical Integration
We talked about some of the standard methods for numerical
integration in one dimension. This is discussed in Section 11.1
of CSM. Additional material is available in Numerical Recipes
or in Abramowitz and Stegun. We compared the accuracy of
various methods like the rectangle rule, trapezoid rule and
Simpson's rule. We indicated how Simpson's rule can simply
be derived from removing the leading 1/N^2 error in the trapeziod
rule with N and 2N points. (This is detailed below.)
This technique can be extended in the method
known as Romberg integration. The previous two points are
expanded upon in Numerical Recipes. Practical codes may be found
there.
Simpson's Rule Rederived
Starting from the trapezoid rule, we used the formulae below
for correcting the leading 1/N^2 errors.
S_N = A + E/N^2
S_2N = A + E/(2N)^2
so A = 4/3 S_2N -1/3 S_N
Applying this to a one-dimensional itegral, we will easily find that
the weighting of the sum of two expressions on the right hand side
exactly coincides with the Simpson's rule formula. We previously
found that Simpson's Rule has a leading error of order 1/N^4. Since
the approach above removes the leading 1/N^2 error and since the
error of the trapezoid rule only has even powers of 1/N (asserted, but
not proved), this is not surprising.