Mathematics
Simpson's Rule for Numerical Integration
Quick fact
Simpson's Rule is exact for polynomials up to degree 3, meaning it can exactly integrate cubics, even though it only fits parabolas to points.
Why this is interesting
You know how to find the area under a curve using antiderivatives, but what if the curve is too messy to integrate exactly? Simpson's Rule lets you approximate that area surprisingly accurately—often with just a few arithmetic steps.
Read the full explanation
Understanding Simpson's Rule for Numerical Integration
Imagine you want to find the area under a curve, but you can't find an antiderivative. Instead, you can approximate the curve with simple shapes whose areas you know how to calculate. The trapezoidal rule does this with straight lines, but Simpson's Rule does it with parabolas. For three points equally spaced along the x-axis, there is exactly one parabola that passes through them. Simpson's Rule uses that parabola to estimate the area between the two outer points. For a single segment, the formula is: (width/3) (endpoint values + 4 middle value + endpoint value). This simple average, with the 4 weighting on the middle, comes from integrating the interpolating parabola exactly. To handle a wider interval, you split it into many small pairs of slices and apply the rule to each pair, then sum the results—this is the composite Simpson's Rule. The key requirement is that the number of subintervals must be even, because each parabola covers two subintervals.
A deeper explanation
The power of Simpson's Rule lies in how it approximates the function locally with a quadratic polynomial. Given three points (x₀, f(x₀)), (x₁, f(x₁)), (x₂, f(x₂)) with x₁ the midpoint, the unique parabola that passes through these points has an integral over [x₀, x₂] that simplifies to the weighted average formula. This is not arbitrary: it comes directly from integrating the Lagrange interpolating polynomial. The reason it is so accurate is that the error term for Simpson's Rule is proportional to the fourth derivative of the function, not the second derivative as in the trapezoidal rule. For smooth functions, this means the error decreases much faster as you refine the interval. Moreover, Simpson's Rule is exact for polynomials of degree 3 or less, because the fourth derivative of such polynomials is zero. In practice, the composite rule is used: divide the interval [a, b] into n even subintervals (n even), apply Simpson's Rule to each pair of subintervals, and sum the results. The resulting formula is: (h/3) [f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + ... + 2f(x{n-2}) + 4f(x{n-1}) + f(xₙ)], where h = (b-a)/n. This method is a standard tool in numerical integration because it offers a good balance between simplicity and high accuracy for a wide range of functions, making it a cornerstone of numerical analysis and a stepping stone to adaptive and more sophisticated quadrature methods.