Enter the positive interval length L = b − a, then the samples y0 = f(a), ym = f((a + b)/2), and y1 = f(b). The middle observation must be at the exact midpoint: each gap is L/2. No function expression is needed.

Inputs are dimensionless numeric entries. If your observations have physical units, use consistent units; the resulting integral has the units of interval length multiplied by sample value. Negative and zero samples are allowed. L must be strictly positive; zero length produces unavailable results.

\[S=\frac{L}{6}(y_0+4y_m+y_1),\qquad T=\frac{L}{4}(y_0+2y_m+y_1),\qquad D=S-T\]

These are signed integral estimates: values below the horizontal axis contribute negatively, so positive and negative contributions can cancel. They do not estimate total unsigned geometric area.

Simpson’s rule integrates a quadratic interpolant through the three samples; the trapezoidal comparison integrates straight segments between them. Smoothness matters: jumps, singularities, narrow peaks and oscillations between samples can make either estimate unreliable. A small or zero S − T does not certify accuracy. A rigorous Simpson error bound needs additional information, such as an appropriate bound on the fourth derivative across the interval; three observations cannot supply that bound. See OpenStax: Numerical Integration.

For L = 2 and samples y0 = 0, ym = 1 and y1 = 4, Simpson’s estimate is 2 × (0 + 4 × 1 + 4)/6 = 8/3 ≈ 2.66666667. The trapezoidal estimate is 2 × (0 + 2 × 1 + 4)/4 = 3. The signed comparison is −1/3 ≈ −0.33333333.

These observations do not establish the function’s behavior between sample positions, so neither value is asserted to be the true integral.

Can I use three observations taken at unequal intervals?

No. These formulas require the second observation exactly halfway between the endpoints. Obtain a midpoint observation or use an integration method designed for unequal spacing.

Does a negative result indicate an invalid input?

No. Negative function samples and negative signed integral estimates are valid. The interval length itself must be positive.

What does an unavailable result mean?

A zero interval length or arithmetic outside the supported numeric range can make a result unavailable. Unavailable results are not zero. Check that L is strictly positive and all entries are finite; extremely large or small numbers can exceed numerical limits. Displayed decimal places are formatting, not a guarantee of accuracy.

Which tool should I use when I have a function expression?

Use the integral calculator or Riemann-sum calculator. This calculator is for three available observations.

Reference

  1. OpenStax, Calculus Volume 2, Section 3.6: Numerical Integration