MATH/APPM 4650
Class notes, February 25
Numerical integration (compound)
Most of today's notes will be on the board. Here are the basic ideas.
Main idea:
To approximate an integral over a large interval, we divide it up, setting the step size to h = (b-a)/n and the sampling points to xk = a+hk
We could try a high-order Newton-Cotes formula, but there will probably be lots of hard-to-predict error.
Instead it makes more sense to use a low-order Newton-Cotes formula on subintervals.
The most common ones are the midpoint rule, the trapezoid rule, and Simpson's rule.
- If the function is always concave up, the midpoint rule is a lower estimate for the integral.
- If the function is always concave up, the trapezoid rule is an upper estimate for the integral.
- The error in the trapezoid rule is roughly twice the error in the midpoint rule, and the opposite sign.
- So a good estimate is 2/3*M + 1/3*T, which happens to be Simpson's rule.
Formulas
- The composite trapezoid rule:
- The composite midpoint rule:
- The composite Simpson's rule:
Important: Not everyone uses the same notation for h and xk. Check your formulas to be sure!
I think this form is more convenient (since it uses the same h and xk for all three formulas), but the book's is different.
Errors:
- The composite trapezoid rule:

- The composite midpoint rule:

- The composite Simpson's rule:

Again note that these formulas are dependent on the choice of h and xk. Use your favorite version; just keep track of how each term is defined.
Note also that the error terms in the midpoint and Simpson rule are better than one would expect, due to getting the odd terms for free by symmetry. In trapezoid we don't get any error term for free.