Match the rule to the function
The midpoint rule samples the centre of each subinterval. The trapezoidal rule joins endpoint samples with straight lines. Simpson rules use polynomial panels: quadratics for 1/3 and cubics for 3/8.
For a smooth function, Simpson rules can reach a useful accuracy with fewer subintervals than lower-order rules. That advantage depends on the function behaving smoothly; a narrow peak or a singularity can defeat a coarse sampling grid.
Count subintervals, not sample points
The input n is the number of equal subintervals between the bounds. Composite Simpson 1/3 requires an even n; Simpson 3/8 requires n to be a multiple of three. A count such as 12 works with either rule.
Enter functions with explicit multiplication, such as 2*x, and use ^ for powers. The typeset preview shows how the expression was parsed. Angles are in radians. The tool evaluates the entered function, rather than integrating an uploaded table of measurements.
Compare against an integral we know
For x³ from 0 to 1, the exact integral is 1/4. With six subintervals, midpoint gives about 0.246528 and trapezoid gives 0.256944. Both Simpson rules return 0.25 to floating-point rounding because their polynomial exactness includes cubics.
At twelve subintervals, midpoint gives about 0.249132 and trapezoid gives 0.251736. Their absolute errors are a quarter of the six-subinterval errors in this example. It is a useful check on both the calculation and the interpretation of n.
| Rule | n = 6 | n = 12 |
|---|---|---|
| Midpoint | 0.246528 | 0.249132 |
| Trapezoid | 0.256944 | 0.251736 |
| Simpson 1/3 | 0.25 | 0.25 |
| Simpson 3/8 | 0.25 | 0.25 |
Refine before trusting the digits
When the exact answer is unknown, repeat with a larger valid n and compare. Agreement between two grids is evidence worth checking, not a proof: both grids can miss the same narrow feature. Compare methods and inspect the function over the whole interval.
For sufficiently smooth functions, standard composite midpoint and trapezoidal error bounds depend on a bound for the second derivative; Simpson 1/3 uses a fourth-derivative bound. The calculator does not establish those derivative bounds or certify an error tolerance.
An interval crossing a discontinuity or an improper endpoint needs separate mathematical treatment. Even if a rule happens not to sample the troublesome point, a finite answer does not establish that the integral exists. Split at known breaks and use a method appropriate to each resulting integral.
References & further reading
Equations describe the stated model. Worked values are rounded for reading; the calculator’s download retains its calculated precision. Read about our checks and their limits.