Numerical Quadrature and Error Bounds
Compute trapezoidal and Simpson approximations and interpret their smoothness-dependent error bounds.
Builds on Improper Integrals and Convergence
The bigger question: When is an integral meaningful, and when is an estimate reliable?
On this page
Approximate a function locally
With equal subintervals, and , the composite trapezoidal rule joins neighboring samples by straight lines:
Composite Simpson's rule fits quadratics across pairs of subintervals. It requires even :
Samples must correspond to the same equally spaced grid. An odd interval count or inconsistent spacing invalidates these composite Simpson weights.
Visual guide
- x²
- Trapezoid tops
Worked example: a known integral
For on and , samples are and . Thus , while . The exact integral is . Simpson is exact here because it integrates polynomials of degree at most three exactly; trapezoids overestimate this convex function.
Try it yourself.
Choose an answer and explain your reasoning to yourself. Use a hint if you get stuck.
Hint 1 · Find a starting point
A trapezoid has width times average endpoint height.
Hint 2 · Take the next step
The width is 2 and average height is (1+5)/2.
Show the reasoning
Answer: 6
2×3=6. Its accuracy still depends on the curve between the endpoints.
Before moving on: what would make one of the other answers wrong? Saying why is part of understanding.
Worked example: choosing resolution
If on , then . For on , use . To guarantee error below , require , so suffices. This is a sufficient bound, not a claim that necessarily fails in practice.
If has a continuous fourth derivative bounded by , Simpson's error satisfies . These guarantees depend on derivatives being bounded over the entire interval. They do not apply unchanged to a singular integrand such as on .
Practice
- Compute for on .
- Compute for on .
- What happens to the stated trapezoidal error bound when doubles?
Show worked solutions
- Samples give , exactly the integral.
- Samples give , exactly the integral.
- It becomes one quarter as large. The actual error may behave better, including being zero for a linear function.
Pause before the next idea.
Can you explain how the visualization connects to this lesson’s goal? If a step still feels uncertain, put this lesson on your review list and try the check again another day.