Simpson's Rule Calculator
Approximate definite integrals with Simpson 1/3 and 3/8 rules on polynomials up to x⁴, compared against the exact value and the trapezoidal rule.
Simpson’s rule approximates a definite integral by fitting parabolas through each pair of subintervals rather than rectangles. It is far more accurate than simple Riemann sums for smooth functions.
Simpson’s 1/3 rule (n must be even): integral ≈ (dx/3) * [f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + … + 4f(x_{n-1}) + f(x_n)]
The alternating 4-2-4-2 pattern of coefficients is the signature of this rule. Each group of three points (two subintervals) fits one parabola. Requiring n to be even ensures the groups pair up correctly.
Simpson’s 3/8 rule (n must be divisible by 3): integral ≈ (3dx/8) * [f(x0) + 3f(x1) + 3f(x2) + 2f(x3) + 3*f(x4) + … + f(x_n)]
For a polynomial of degree 3 or less, both Simpson rules give the exact answer regardless of n. For a quadratic f(x) = ax^2 + bx + c, even n=2 (three points) is exact.
That last fact has a practical consequence for using this page. If you enter only a quadratic, every error it reports will be zero, which demonstrates nothing about the method beyond the fact that it is exact there. That is why the calculator takes a fourth-degree polynomial: degree 4 is the lowest degree at which Simpson’s rule makes an error at all. Put a value in the x⁴ box and the numbers become interesting; leave it empty and you get a row of zeroes and a trapezoidal comparison to show what the zeroes are worth.
The error in Simpson’s 1/3 rule is proportional to dx^4 (proportional to 1/n^4). That is dramatically better than the trapezoidal rule (1/n^2), since halving the step size reduces the error by a factor of 16 rather than 4. You can watch that happen on this page: integrate x⁴ over [0, 3], then double n and compare.
Gauss-Legendre quadrature and adaptive quadrature can do even better for smooth functions, but Simpson’s rule is what most engineering and physics courses use as the go-to numerical integration method.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.