Skip to content
Calcumatix

Simpson's Rule Calculator

Estimate a definite integral using Simpson's 1/3 rule over 4 subintervals. You enter 5 function values at equally spaced points; this calculator does the rest.

Enter f(x) at 5 evenly spaced points from a to b (4 subintervals):

Result

21.3333

The integral from 0 to 4 is approximately 21.3333

Quick Answer

Simpson's rule calculator applies S = (h/3)[y₀ + 4y₁ + 2y₂ + 4y₃ + y₄] to estimate a definite integral, where h = (b − a)/4 is the subinterval width. You supply the lower bound a, upper bound b, and the five function values y₀ through y₄ evaluated at the equally spaced x-points. For ∫₀⁴ f(x) dx with y-values 1, 4, 9, 16, 25, the estimate is (1/3)[1 + 4(4) + 2(9) + 4(16) + 25] = 41.33.

What This Calculator Needs and How to Prepare Y-Values

Simpson's rule does not accept a typed mathematical expression or formula. It takes five numbers: the values of your function evaluated at five equally spaced x-points across the interval [a, b]. You must compute those values yourself before entering them. The five x-points are x₀ = a, x₁ = a + h, x₂ = a + 2h, x₃ = a + 3h, x₄ = b, where h = (b − a)/4. Enter those five numbers into the calculator along with a and b.

The Simpson's Rule Formula: Four-Subinterval Version

S = (h/3)[y₀ + 4y₁ + 2y₂ + 4y₃ + y₄] subinterval width: h = (b − a) / 4

  • S = (h/3)[y₀ + 4y₁ + 2y₂ + 4y₃ + y₄]
  • h = (b − a) / 4
  • Weighting pattern: 1, 4, 2, 4, 1

How To Run the Simpson's Rule Calculator Step By Step

Inputs

  • a: the lower limit of integration
  • b: the upper limit of integration
  • y₀ through y₄: your function values at the five equally spaced x-points

Steps

  1. Choose your integration bounds a and b.
  2. Compute h = (b − a) / 4.
  3. Evaluate your function at x = a, a+h, a+2h, a+3h, and b to get y₀ through y₄.
  4. Enter a, b, and the five y-values into the calculator.
  5. Read the approximation S; compare to your exact integral if known to assess accuracy.

Simpson's Rule Worked Example: Estimating ∫₁⁵ x² dx

Estimating the integral of f(x) = x² from a = 1 to b = 5 with h = 1.

  1. Compute x-points: x₀ = 1, x₁ = 2, x₂ = 3, x₃ = 4, x₄ = 5.
  2. Evaluate f(x) = x²: y₀ = 1, y₁ = 4, y₂ = 9, y₃ = 16, y₄ = 25.
  3. Apply formula: S = (1/3)[1 + 4(4) + 2(9) + 4(16) + 25] = (1/3)(124) = 41.33.

Simpson's rule gives 41.33, which matches the exact analytical integral 124/3 = 41.33 because Simpson's rule is exact for polynomials up to degree 3.

When Simpson's Rule Gives the Most Accurate Estimate

Simpson's rule works best on smooth, well-behaved functions over moderate intervals. The error bound for the 4-subinterval case is proportional to the fourth derivative of the function. Use this calculator for smooth integrands where you need a quick estimate without software.

Assumptions

  • Exactly 4 equal subintervals (5 points); this is the standard 4-subinterval Simpson's 1/3 rule.
  • The function is smooth (continuous and differentiable) on [a, b].
  • You supply the function values at the correct evenly spaced x-points.

Limitations

  • Uses 4 subintervals only; does not generalise to arbitrary n.
  • Cannot evaluate a typed formula; requires pre-computed y-values at the five fixed x-points.
  • For integrands with large fourth derivatives, accuracy may be poor.

In Practice

The most common mistake with Simpson's rule is entering y-values at the wrong x-positions. The five x-points must be equally spaced, with spacing h = (b−a)/4. If you evaluate your function at unequally spaced points, the weighted sum formula does not apply and the result will be incorrect. Always compute h first and list the five x-values before evaluating your function.

Related Guides

Frequently Asked Questions: Simpson's Rule Calculator

Why does this calculator need y-values rather than a formula?

A browser-based calculator cannot parse and evaluate arbitrary mathematical expressions. You evaluate your function at the five required x-points in advance using a calculator, a table, or any math tool and enter the resulting numbers. The calculator then applies the weighted sum formula.

How accurate is Simpson's rule compared to the trapezoidal rule?

For smooth functions, Simpson's rule is significantly more accurate. The trapezoidal rule has an error of order h², while Simpson's rule has an error of order h⁴. In practice, for the same number of function evaluations, Simpson's rule typically produces 10 to 100 times smaller error than the trapezoidal rule on smooth, non-oscillating integrands.

What does the 1/3 in Simpson's 1/3 rule mean?

The 1/3 refers to the h/3 coefficient in the formula. It distinguishes this form from Simpson's 3/8 rule, which uses 3 subintervals with coefficient 3h/8 and weighting 1, 3, 3, 1. The 1/3 rule is the more commonly taught and used version for an even number of subintervals.

When should I use more than 4 subintervals?

When the integrand varies rapidly over the interval or the required accuracy is high, use composite Simpson's rule with more subintervals (n must be even). The error decreases as n increases: doubling n reduces the error by a factor of 16. For this calculator, use 4 subintervals when a rough estimate is sufficient for a smooth function.

Can I use this calculator for improper integrals?

No. Simpson's rule requires finite bounds and a finite function value at every x-point including the endpoints. Improper integrals with infinite bounds or singularities at endpoints require special techniques such as truncation, substitution, or Gaussian quadrature.

Sources

Last updated: . Reviewed for accuracy against the formula shown above.