Calcoid

Simpson's Rule Calculator

Approximate a definite integral with the composite Simpson 1/3 rule. Enter f(x), the bounds, and an even number of strips to get the result and step size.

Simpson's Rule Calculator

Use x as the variable. Supports + - * / ^, parentheses, pi, e, and sin, cos, tan, exp, ln, log, sqrt, abs.

Number of equal strips. Must be even.

Approximate integral (Simpson's 1/3 rule)

∫ from 0 to 1 of (x^2) dx

0.333333

Subintervals (n)

6

Step size (h)

0.166667

Estimated error

n/a

ixif(xi)Weight
0001
10.1666670.0277784
20.3333330.1111112
30.50.254
40.6666670.4444442
50.8333330.6944444
6111

Simpson's 1/3 rule weights the endpoints by 1, odd-indexed nodes by 4, and even interior nodes by 2, then multiplies the weighted sum by h/3. It is exact for cubic polynomials. The estimated error compares this result with a half-resolution run (Runge's rule) and is only shown when n/2 is itself even; it is a guide, not a guarantee for sharp or near-singular integrands.

Frequently Asked Questions about the Simpson's Rule Calculator

What is Simpson's rule?
Simpson's rule is a numerical method for estimating a definite integral by fitting parabolas through the curve instead of straight lines. The composite Simpson's 1/3 rule splits the interval from a to b into an even number of equal strips of width h, then approximates the area as (h/3) times a weighted sum of the function values. It is more accurate than the trapezoidal rule for the same number of strips because parabolas follow most curves more closely than straight segments.
What is the Simpson's 1/3 rule formula?
With step size h = (b - a) / n and nodes x0, x1, up to xn, the formula is (h/3) times [f(x0) + 4*f(x1) + 2*f(x2) + 4*f(x3) + ... + 4*f(x(n-1)) + f(xn)]. The two endpoints get weight 1, the odd-indexed nodes get weight 4, and the even interior nodes get weight 2. This calculator shows each node, its value, and its weight so you can follow the pattern.
Why does n have to be even?
Simpson's 1/3 rule works on pairs of strips at a time, fitting one parabola through each group of three consecutive points. That means the strips come in twos, so the total number of subintervals n must be even (2, 4, 6, and so on). If you enter an odd number, the calculator returns no result. For an odd count you would need a different scheme such as combining Simpson's 1/3 and 3/8 rules.
How accurate is Simpson's rule?
The composite Simpson's 1/3 rule has a truncation error proportional to h to the fourth power, so halving the strip width cuts the error by roughly a factor of 16. It is exact for any polynomial up to degree three, which is why a cubic returns the precise answer even with just two strips. For smooth functions you usually get several correct digits with a modest n; for sharp peaks or near-singular behavior you need more strips.
What does the estimated error mean here?
The estimated error uses Runge's rule: the calculator compares the result for n strips against the result for n/2 strips and reports the difference divided by 15 (which is 2 to the fourth power minus 1). It only appears when n/2 is itself even, so a comparison run is available. Treat it as a practical guide to how many digits have settled, not a strict bound, since it assumes the function is smooth across the interval.
What functions can I enter?
Type f(x) using x as the variable, with + - * / and ^ for powers, parentheses, the constants pi and e, and functions like sin, cos, tan, exp, ln, log, sqrt, and abs. For example, x^2, sin(x), or 1/(1+x^2) all work. If the function is undefined at any node the rule samples, such as 1/x when a node lands on x = 0, no result is shown.

Related Calculators

More calculators in "Math"

See all 202 calculators in "Math"