Mathematics
Numerical Methods for Approximating Definite Integrals: Simpson's Rule
Quick fact
Simpson's rule is so effective that for many functions it gives exact results for polynomials up to degree 3, while the trapezoidal rule is exact only for linear functions.
Why this is interesting
If a function has no elementary antiderivative, how can we still find the area under its curve? Simpson's rule provides an elegant numerical shortcut that often gives astonishingly accurate results.
Read the full explanation
Understanding Numerical Methods for Approximating Definite Integrals: Simpson's Rule
We often think of integrals as exact areas, but in the real world, many functions—like f(x) = e^(x²)—don't have a nice antiderivative that we can write down. Numerical integration steps in to approximate the definite integral by breaking the area into simple shapes. Imagine drawing vertical lines to split the area under a curve into thin strips. The simplest option is to fill each strip with a rectangle, which gives a rough estimate. A better approach is to use trapezoids—each strip becomes a trapezoid whose slanted top closely follows the curve. This is the trapezoidal rule. Simpson's rule takes this idea further: instead of a straight line for the top of each strip, it uses a parabola. To fit a parabola, we need three points, so Simpson's rule works on pairs of strips. It's like fitting a curved arch over two adjacent slices. This parabolic fit captures the curve's curvature, leading to much better accuracy with the same number of slices.
A deeper explanation
Simpson's rule is derived by using quadratic interpolation. For a pair of subintervals with equally spaced points x₀, x₁, x₂ and corresponding function values y₀, y₁, y₂, we find the unique parabola through these three points. Integrating that parabola exactly from x₀ to x₂ gives the formula: (h/3) (y₀ + 4y₁ + y₂), where h is the width of each subinterval (so the total width is 2h). This is why the rule uses a factor of 1/3 and weights the interior points by 4. The global rule is obtained by applying this locally to each pair of subintervals and summing the results. The magic lies in the error term. For the trapezoidal rule, the error is proportional to h² times the second derivative of the function, while Simpson's rule has an error proportional to h⁴ times the fourth derivative. This means that as we make h smaller, Simpson's rule error shrinks much faster, so we get high accuracy with fewer slices. Moreover, the fourth derivative appears because the cubic term in the Taylor expansion of the function exactly cancels out when integrating the parabola over a symmetric interval. This cancellation is why Simpson's rule is exact for cubics, not just quadratics. In practice, to approximate an integral with Simpson's rule, you need an even number of subintervals. You then apply the formula to each pair and sum the results. The rule's efficiency and accuracy make it a staple in numerical analysis and a foundation for more advanced techniques like adaptive quadrature, which automatically adjusts the step size to control error.