Composite Simpson's rule
The interval [a, b] is divided into n equal sub-intervals (n must be even). Simpson's rule fits parabolas through three consecutive points, integrates them exactly, and sums the results. It's exact for polynomials up to degree 3 and very accurate for any smooth function.
Worked example
∫0π x² · sin(x) dx — analytical answer is π² − 4 ≈ 5.8696. Simpson's rule with n = 1000 hits this to all displayed digits.
FAQ
What if the integrand has a singularity?
Splitting the interval around the singularity and using larger n on the singular side helps. For improper integrals (a or b infinite, or integrand divergent), substitute t = 1/x or use specialised methods — basic Simpson's rule won't converge.
Why must n be even?
Simpson's rule processes points in pairs (groups of 3 with shared endpoints), so the sub-interval count must be even. Odd n is rounded up automatically.
Can I use this for an indefinite integral?
Not directly. For polynomials, see the polynomial calculator which gives the antiderivative symbolically. For other functions, a CAS is needed.