Simpson's Rule Calculator
Enter a function, the limits a and b, and an even number of subintervals to approximate the integral.
Simpson's rule estimates a definite integral by fitting parabolas through the function's points. With an even number of subintervals of width h, the integral is about h/3 times the sum of the first and last values, plus 4 times the odd-indexed values, plus 2 times the even-indexed ones. It is very accurate for smooth functions.
How to Use This Calculator
Enter the function to integrate, the lower and upper limits, and the number of subintervals — which must be even for Simpson's rule. More subintervals give a more accurate result. The calculator returns the approximate value of the definite integral.
Simpson's rule is a standard numerical-integration method, used when an integral is hard or impossible to evaluate exactly, or when you only have data points.
How the Calculation Works
The interval is divided into an even number of equal strips of width h. Simpson's rule fits a parabola through each consecutive triple of points, which approximates a curve far better than the straight lines of the trapezoidal rule.
The pattern of weights — 1 at the ends, 4 on odd-indexed interior points, 2 on even-indexed ones, all scaled by h/3 — comes from integrating those parabolas. For polynomials up to degree three, Simpson's rule is exact.
∫ ≈ (h/3)[f₀ + 4·odd + 2·even + fₙ], h = (b−a)/n
Worked Example
Approximate the integral of x² from 0 to 2 with n = 2. The width is h = (2 − 0)/2 = 1, and the points are f(0) = 0, f(1) = 1, f(2) = 4.
Simpson's rule gives (1/3)[0 + 4(1) + 4] = 8/3 ≈ 2.667 — the exact answer, since Simpson's rule integrates quadratics perfectly.
Assumptions and Limitations
- The number of subintervals n must be even
- Exact for polynomials up to degree 3; approximate for other functions
- Accuracy improves as n increases for smooth functions
- The function must be defined across the whole interval
Who Uses a Simpson's Rule Calculator
Calculus and numerical-methods students, and engineers, use this to approximate a definite integral with Simpson's rule. Run it when an integral has no closed form, to check a numerical answer, or to see how accuracy improves with more intervals. Enter the function, limits, and interval count.
Related Calculators
Partial Derivative Calculator
Differentiate a multivariable function with respect to one variable.
Open calculator →L'Hôpital's Rule Calculator
Evaluate a 0/0 or ∞/∞ limit using L'Hôpital's rule.
Open calculator →Mean Value Theorem Calculator
Find the point c where the tangent slope equals the average slope.
Open calculator →Laplace Transform Calculator
Forward and inverse Laplace transforms of a function.
Open calculator →Frequently Asked Questions
What is Simpson's rule?
A numerical method for approximating a definite integral by fitting parabolas through the function's points, using the weighting (h/3)[f₀ + 4·odd + 2·even + fₙ] over an even number of subintervals.
Why must n be even?
Because Simpson's rule pairs subintervals into parabolic arcs, each spanning two subintervals. An even number lets every pair form a complete arc with no leftover strip.
Is Simpson's rule better than the trapezoidal rule?
For smooth functions, yes. It fits curves with parabolas rather than straight lines, so it is much more accurate for the same number of subintervals and is exact for cubics.
When is Simpson's rule exact?
For polynomials of degree three or lower, Simpson's rule gives the exact integral. For other functions it is an approximation that improves as you add subintervals.
What if I only have data points?
Simpson's rule works directly on evenly spaced data — you don't need a formula. Just supply the values at the equally spaced points, with an even number of intervals.
Looking for a different calculator?
CalculatorPlus has free tools across finance, construction, math, health and more — each one showing the formula and a worked example.