๐ขNumerical Analysis II
Fundamental Numerical Integration Methods
Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Why This Matters
Numerical integration is what you turn to whenever a closed-form antiderivative doesn't exist, which is most of the time in real applications. In Numerical Analysis II, you're expected to go beyond applying formulas: you need to understand error behavior, convergence rates, and when to choose one method over another. These concepts tie directly into polynomial interpolation, Taylor series error bounds, and approximation theory more broadly.
What separates strong exam performance from mediocre recall is understanding the why behind each method. Why does Simpson's Rule outperform the Trapezoidal Rule? Why might you abandon classical methods entirely for Monte Carlo in high dimensions? For each method, know what order of accuracy it achieves, what assumptions it requires, and what trade-offs it makes between function evaluations and precision.
Polynomial-Based Interpolation Methods
These foundational methods approximate the integrand using polynomials of increasing degree over subintervals. Higher-degree polynomial interpolation generally yields faster error convergence, but there are important caveats once the degree gets large enough.
Rectangle Rule (Midpoint Rule)
The Midpoint Rule approximates the integrand as a constant (degree-0) polynomial on each subinterval, using the function value at the midpoint as the rectangle's height.
- The composite error is , where is the subinterval width. This matches the Trapezoidal Rule despite the simpler construction, because evaluating at the midpoint causes the first-order error term to cancel by symmetry.
- Left-endpoint and right-endpoint rectangle rules only achieve , so the midpoint choice is doing real work here.
Trapezoidal Rule
The Trapezoidal Rule uses linear (degree-1) interpolation, connecting function values at subinterval endpoints to form trapezoids.
- The composite error is with leading error term for some in the interval. The second derivative controls accuracy: low curvature means small error.
- It's exact for linear functions (degree ) and performs well on smooth, non-oscillatory integrands.
Simpson's Rule
Simpson's Rule fits a quadratic (degree-2) polynomial through three equally spaced points (both endpoints and the midpoint of each pair of subintervals). This requires an even number of subintervals.
- The composite error is , two orders better than the Trapezoidal Rule. For smooth functions, this improvement is dramatic.
- It's exact for polynomials up to degree 3, not just degree 2. This "bonus" degree of exactness comes from the symmetry of the nodes and weights: the error term involving vanishes because the odd-powered error contribution cancels over symmetric intervals.
- The weighting pattern across nodes follows the familiar (1, 4, 2, 4, 2, ..., 4, 1) scheme in the composite version.
Compare: Trapezoidal Rule vs. Simpson's Rule: both use endpoint values, but Simpson's adds the midpoint and weights them (1, 4, 1 pattern per panel) to fit parabolas instead of lines. If you're asked to justify choosing Simpson's, cite the vs. error improvement.
Newton-Cotes Formulas
The Newton-Cotes family is the general framework using equally spaced nodes. The Rectangle, Trapezoidal, and Simpson's Rules are all special cases (closed formulas using degree-0, 1, and 2 interpolation, respectively).
- Higher-degree Newton-Cotes formulas exist (e.g., Simpson's 3/8 rule at degree 3, Boole's rule at degree 4), but beyond moderate degree they suffer from Runge's phenomenon: oscillatory behavior in the interpolating polynomial can cause errors to grow with more nodes.
- Additionally, high-order closed Newton-Cotes formulas develop negative weights, which leads to numerical instability through cancellation.
- Open vs. closed variants: closed formulas include the interval endpoints as nodes; open formulas (like the Midpoint Rule) exclude them. Open formulas are useful when the integrand is undefined or singular at an endpoint.
Extrapolation and Refinement Techniques
These methods build on basic rules by systematically combining approximations to cancel error terms. The core principle: if you know the structure of the error expansion, you can eliminate leading terms through careful linear combinations.
Romberg Integration
Romberg Integration applies Richardson extrapolation to the composite Trapezoidal Rule. It exploits the fact that the Trapezoidal Rule's error has an expansion in even powers of :
By computing for successively halved step sizes (), you build a triangular table where each new column eliminates another power of from the error.
- The first extrapolation column reproduces Simpson's Rule.
- Subsequent columns achieve even higher orders of accuracy.
- For smooth functions, the diagonal entries converge rapidly. But the method assumes the error expansion in even powers of is valid, which requires sufficient smoothness of the integrand.
Composite Integration Methods
Composite methods subdivide the full interval and apply a basic rule to each subinterval (or pair of subintervals for Simpson's).
- Composite Trapezoidal has global error ; Composite Simpson's has global error .
- Single-interval formulas rarely provide sufficient accuracy on their own. Composition is how these methods are actually used in practice.
- The trade-off is straightforward: more subintervals means more function evaluations but smaller error, with the rate of improvement governed by the method's order.
Compare: Romberg Integration vs. Composite Simpson's: both achieve high accuracy, but Romberg automatically improves order through extrapolation, while Composite Simpson's requires you to choose the number of subintervals upfront. Romberg is more "set and forget" for well-behaved (sufficiently smooth) functions, but it can struggle if the integrand lacks the smooth error expansion it assumes.
Optimal Node Selection Methods
Rather than using equally spaced points, these methods choose node locations strategically to maximize accuracy per function evaluation. Optimal node placement can achieve exponential convergence for analytic functions, far outperforming fixed-spacing methods.
Gaussian Quadrature
Gaussian quadrature selects nodes as roots of orthogonal polynomials (Legendre polynomials for standard intervals, Chebyshev, Laguerre, or Hermite for other weight functions) along with corresponding optimal weights.
- An -point Gaussian quadrature rule is exact for polynomials of degree . That's twice the degree you'd expect from points, because both the node locations and the weights are free parameters ( parameters total).
- For analytic (infinitely differentiable) functions, Gaussian quadrature achieves exponential convergence as increases, making it the gold standard when function evaluations are expensive.
- The main limitation: nodes are on a fixed reference interval (typically ), so you need a change of variables for other domains. Also, the nodes are not nested between different -values, so you can't easily reuse function evaluations when increasing .
Adaptive Quadrature
Adaptive quadrature dynamically refines subintervals based on local error estimates, concentrating computational effort where the integrand is hardest to approximate.
The typical procedure:
- Apply a quadrature rule (e.g., Simpson's) on a subinterval to get an estimate .
- Subdivide that interval in half and apply the same rule to each half, getting a refined estimate .
- Compare to a local error tolerance. If the difference is small enough, accept . If not, recursively subdivide each half.
This approach is essential for functions with localized complexity (sharp peaks, rapid oscillations in a small region, near-singularities) where uniform spacing would waste evaluations on smooth regions.
Compare: Gaussian Quadrature vs. Adaptive Quadrature: Gaussian optimizes node placement globally, assuming smooth behavior throughout. Adaptive adjusts locally to handle varying complexity. For integrands with sharp peaks or near-discontinuities, Adaptive wins. For smooth analytic functions on a fixed interval, Gaussian's efficiency is hard to beat.
Probabilistic and High-Dimensional Methods
When deterministic methods become impractical, especially in high dimensions, randomized approaches offer a fundamentally different strategy. Monte Carlo convergence depends on sample count, not dimension, which breaks the curse of dimensionality.
Monte Carlo Integration
Monte Carlo integration estimates integrals via random sampling:
where are points sampled uniformly at random from the domain and is the volume of that domain.
- The convergence rate is regardless of dimension. In 1D, this is terrible compared to Simpson's or Gaussian quadrature's exponential rate. But in high dimensions, deterministic methods require a number of nodes that grows exponentially with dimension (the curse of dimensionality), while Monte Carlo's rate stays fixed.
- Variance reduction techniques can significantly improve practical performance:
- Importance sampling: sample more densely where is large
- Stratified sampling: divide the domain into strata and sample each
- Control variates: subtract a function with a known integral to reduce variance
Compare: Monte Carlo vs. Gaussian Quadrature: in one dimension, Gaussian's exponential convergence dominates Monte Carlo's rate. But in 10+ dimensions, an -point tensor-product Gaussian rule requires evaluations (where is the dimension), making it astronomically expensive. Monte Carlo's rate stays regardless. Dimensionality determines which method wins.
Error Analysis and Convergence Theory
Understanding error behavior is how you choose methods, set parameters, and verify results. Error expansions reveal both the rate of convergence and the conditions under which methods succeed or fail.
Error Analysis and Convergence Rates
- Order of accuracy means the error scales as the -th power of the step size. Halving (doubling the number of subintervals) reduces the error by a factor of . This is a practical tool: if you compute results at two different step sizes, you can estimate empirically and check whether your implementation matches the theoretical order.
- Error bounds depend on derivative magnitudes: the Trapezoidal error bound involves , Simpson's involves . This means higher-order methods only deliver their promised convergence rate if the integrand has enough smoothness (continuous derivatives of sufficiently high order).
- Asymptotic vs. pre-asymptotic behavior: theoretical rates like apply only for sufficiently small . In practice, if isn't small enough relative to the integrand's features, you may not yet see the expected convergence rate. Conversely, once is very small, round-off error from floating-point arithmetic can start to dominate, and further refinement actually increases the total error.
Quick Reference Table
| Concept | Best Examples |
|---|---|
| Polynomial interpolation (low degree) | Rectangle Rule, Trapezoidal Rule |
| Polynomial interpolation (higher degree) | Simpson's Rule, Newton-Cotes Formulas |
| Error extrapolation | Romberg Integration |
| Optimal node placement | Gaussian Quadrature |
| Adaptive refinement | Adaptive Quadrature, Composite Methods |
| High-dimensional integration | Monte Carlo Integration |
| Error order | Rectangle (Midpoint), Trapezoidal |
| Error order or better | Simpson's Rule, Romberg, Gaussian |
Self-Check Questions
-
Both the Midpoint Rule and Trapezoidal Rule have error. What geometric or symmetry argument explains why the Midpoint Rule achieves the same order as the Trapezoidal Rule despite using degree-0 (rather than degree-1) interpolation?
-
Simpson's Rule is exact for polynomials up to degree 3, not just degree 2. What property of the method causes this "bonus" degree of exactness?
-
Compare Romberg Integration and Adaptive Quadrature: under what conditions would you prefer each, and what assumption does Romberg make that Adaptive does not?
-
A colleague suggests using 10-point Gaussian quadrature for a 15-dimensional integral. Explain why this is impractical and what method you would recommend instead.
-
You're integrating a function with a sharp spike near but smooth behavior elsewhere. Would Composite Simpson's with uniform subintervals or Adaptive Quadrature be more efficient? Justify your answer in terms of how each method distributes its error budget.