numerical integration
Numerical Integration
You should know: integral, numerical methods
Overview
Numerical integration, or quadrature, approximates the value of a definite integral ∫ₐᵇ f(x) dx when no closed-form antiderivative exists, or when f is known only from discrete data points. The core idea is to replace the integrand by a simple approximating function — a constant, a line, or a low-degree polynomial — over small subintervals, integrate that approximation exactly, and sum the pieces. The two most common elementary rules, the trapezoidal rule and Simpson's rule, arise from approximating f by piecewise linear and piecewise quadratic interpolants respectively. Quadrature underlies computations from areas under experimental curves to probability calculations to solving differential equations.
Intuition
Imagine trying to find the area under an irregular curve without a formula for it — you can approximate that area with shapes you already know how to measure. Slice the region into narrow vertical strips; over each strip, replace the curve with something simple (a flat top, a slanted top, or a gentle arc) whose area you can compute exactly, then add the strips up. The narrower the strips and the better the local approximation, the closer the total gets to the true area — this trade-off between how many pieces you use and how well each piece fits is the entire game of numerical quadrature.
Formal Definition
Partition [a, b] into n subintervals of width h = (b−a)/n with nodes xᵢ = a + ih, and approximate the integral by a weighted sum of function values fᵢ = f(xᵢ):
Worked Examples
Step size h = (1−0)/2 = 0.5; nodes x = 0, 0.5, 1.
Function values: f(0) = e⁰ = 1, f(0.5) = e^{0.5} ≈ 1.648721, f(1) = e ≈ 2.718282.
Apply the trapezoidal formula (h/2)[f₀ + 2f₁ + f₂].
Exact value is e − 1 ≈ 1.718282, so the trapezoidal estimate overshoots by about 0.0357 (about 2.1%).
Answer: Trapezoidal estimate ≈ 1.753931 vs. exact ≈ 1.718282 (overestimate, since eˣ is convex).
Practice Problems
Approximate ∫₀¹ x³ dx using the trapezoidal rule with n = 1 (a single trapezoid). Compare to the exact value.
Water flow rate (m³/s) measured at 1-second intervals over 4 seconds is 2, 3, 5, 4, 2. Use the composite trapezoidal rule to estimate the total volume that passed.
Numerical quadrature methods are most useful when:
Quiz
Summary
- Numerical integration approximates ∫f(x)dx by replacing the integrand with simple pieces (constant, linear, quadratic) that are integrated exactly and summed.
- It is essential when no elementary antiderivative exists or when f is known only from sampled data.
- The trapezoidal and Simpson's rules are the most common elementary quadrature schemes, differing in the degree of the local approximating polynomial.
Mathematics