Simpson's Rule Calculator
Approximate a definite integral using composite Simpson's 1/3 rule with n subintervals.
About Simpson's Rule Calculator
Simpson's 1/3 rule approximates ∫f(x)dx by fitting quadratic polynomials through consecutive triplets of points. The composite version splits [a,b] into n equal subintervals (n must be even) and applies the basic rule to each pair. Error is O(h⁴), making it much more accurate than the trapezoidal rule for the same n.
Formula
Simpson's 1/3 rule
∫[a,b]f(x)dx ≈ (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + ... + f(xₙ)]
- h
- (b-a)/n
- n
- Number of subintervals (even)
Worked example
With the default values below, Simpson's Rule Calculator returns Approximate integral of 2.0001095173. Change any input above and every figure here is recalculated in your browser.
Inputs used
- f(x)
- sin(x)
- Lower bound (a)
- 0
- Upper bound (b)
- 3.141593
- Subintervals (n, must be even)accepts 2–100,000
- 10
Results
- Approximate integral
- 2.0001095173
- Step size h
- 0.31415927
Step by step
- 1Values used
- 2Simpson's 1/3 rule
- 3Approximate integral= 2.0001095173
- 4Step size h= 0.31415927
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 10 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why must n be even?
Simpson's rule uses pairs of subintervals (triplets of points) to fit parabolas. An odd n would leave an unpaired subinterval.
How accurate is Simpson's rule?
The error is proportional to h⁴·f''''(c) for some c in [a,b]. Doubling n reduces error by a factor of 16.
