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.
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"
Trapezoidal Rule CalculatorDefinite Integral CalculatorDerivative CalculatorDice Probability CalculatorDot Product CalculatorFive Number Summary Calculator
See all 202 calculators in "Math"