Simpson's 3/8 Rule Calculator

Enter equally-spaced f(x) values and the limits to integrate.

How it is calculated

You supply the function values y0…yn at equally spaced points, plus the limits a and b. The step is h = (b − a) / n, where n is the number of intervals, one fewer than the number of values. The integral is (3h/8) × [y0 + yn + 3·(values at positions not divisible by 3) + 2·(interior values at positions 3, 6, 9…)]. Because the rule works in groups of three intervals, n must be a multiple of 3, so you need 4, 7, 10… values; any other count returns no result. Values can be separated by commas, spaces, semicolons or new lines, and decimals must use a point, not a comma.

Worked example

Integrate f(x) = x² from 0 to 3 using 7 values at x = 0, 0.5, 1, … 3, which gives y = 0, 0.25, 1, 2.25, 4, 6.25, 9. There are 6 intervals, a multiple of 3, so h = 3 / 6 = 0.5. The ends add 0 + 9 = 9. Positions 1, 2, 4 and 5 carry weight 3: 3 × (0.25 + 1 + 4 + 6.25) = 34.5. Position 3 carries weight 2: 2 × 2.25 = 4.5. The sum is 48, and (3 × 0.5 / 8) × 48 gives 9.000000. This matches the exact integral, since the rule is exact for cubic and lower polynomials.

Try this example →

Common mistakes

  • Giving a number of values that does not fit the rule. Seven values (6 intervals) work, but six values (5 intervals) do not.
  • Using unevenly spaced points. The tool assumes a constant step, so a gap that is wider than the others gives a wrong integral.
  • Typing decimals with a comma, as in 0,25. The comma is read as a separator and splits the number in two; use 0.25.
  • Counting values instead of intervals when working out h. The step is the width divided by the number of intervals, not by the number of values.
  • Swapping the limits a and b. The tool does not stop you; it returns a negative integral and a negative step.

About this calculator

Simpson's 3/8 rule approximates a definite integral by fitting cubic curves through groups of four equally-spaced points, using the formula ∫f(x)dx ≈ (3h/8)[f₀ + 3f₁ + 3f₂ + 2f₃ + 3f₄ + 3f₅ + 2f₆ + … + fₙ], where h is the spacing between points. Unlike the standard Simpson's 1/3 rule, this variant requires the number of intervals to be a multiple of three, and it's often combined with the 1/3 rule to handle interval counts that don't divide evenly by either method alone.

Engineers and numerical analysts use Simpson's 3/8 rule to estimate integrals of functions known only at discrete sample points — such as data from sensors or experiments — and it's a standard topic in numerical methods coursework as an alternative to the more common 1/3 rule for specific interval-count situations.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators