Simpson's Rule Calculator

Enter a function f(x), set your lower limit (a) and upper limit (b), and choose the number of subintervals (n) to approximate a definite integral using Simpson's Rule. You get the approximate integral value along with a breakdown of the evaluated points used in the parabolic approximation.

Enter the function using x as the variable. Use standard JS math: Math.sin(x), Math.sqrt(x), Math.exp(x), Math.log(x), Math.PI, etc. Powers: Math.pow(x,n) or x**n.

The lower bound of integration.

The upper bound of integration.

Must be a positive even integer. More subintervals → greater accuracy.

Results

Approximate Integral

--

Step Size (Δx)

--

Subintervals Used (n)

--

Evaluation Points

--

Function Values at Evaluation Points

Results Table

Frequently Asked Questions

What is Simpson's Rule?

Simpson's Rule (also called Simpson's 1/3 Rule) is a numerical integration method that approximates a definite integral by fitting parabolic arcs through groups of three points on the function curve. It is generally more accurate than the trapezoidal rule for smooth functions and requires an even number of subintervals.

Why must the number of subintervals n be even?

Simpson's 1/3 Rule requires pairs of subintervals to form each parabolic segment, so n must always be a positive even integer. If you enter an odd number, the calculator automatically rounds up to the nearest even integer to ensure the formula is applied correctly.

What is the formula for Simpson's Rule?

The formula is: ∫[a to b] f(x) dx ≈ (Δx/3) × [f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + ... + 4f(x_{n-1}) + f(xₙ)], where Δx = (b − a)/n. Interior points alternate between coefficients of 4 and 2, while the endpoints each have a coefficient of 1.

How accurate is Simpson's Rule?

Simpson's Rule has an error of order O(h⁴), making it significantly more accurate than the Trapezoidal Rule (O(h²)) for the same number of subintervals. Accuracy increases as n increases. For polynomial functions of degree 3 or less, Simpson's Rule gives the exact answer.

How do I enter functions into this calculator?

Enter your function using JavaScript math syntax with x as the variable. For example: use Math.sin(x) for sine, Math.sqrt(x) for square root, Math.exp(x) for eˣ, Math.log(x) for natural log, and x**2 or Math.pow(x,2) for powers. Constants like Math.PI and Math.E are also supported.

What is the difference between Simpson's Rule and the Trapezoidal Rule?

The Trapezoidal Rule approximates the function with straight line segments between points, while Simpson's Rule uses parabolic curves through groups of three points. Because parabolas better capture the curvature of smooth functions, Simpson's Rule typically produces much smaller errors for the same step size.

What is Simpson's 3/8 Rule and how does it differ?

Simpson's 3/8 Rule is a variant that fits cubic polynomials through groups of four points instead of parabolas through three. It requires n to be divisible by 3 and uses coefficients 1, 3, 3, 1 in its pattern. Simpson's 1/3 Rule (used here) is more commonly applied because it requires only an even n.

How many subintervals should I use for accurate results?

For most smooth functions, n = 4 to 20 gives very good accuracy. If the function has rapid oscillations or steep changes, increase n toward 100 or higher. Doubling n generally reduces the Simpson's Rule error by a factor of about 16 due to its O(h⁴) convergence rate.

More Math Tools