How to use the Simpson's Rule Calculator
- 1. Type f(x) and limitsEnter the function and the limits a and b. pi works in limits.
- 2. Choose the rule and nUse an even n for 1/3 rule and a multiple of 3 for 3/8 rule.
- 3. Read the resultSee the table of ordinates and weights, the integral and its error.
The two Simpson's rules
Divide [a, b] into n strips of width h = (b − a)/n and let yᵢ = f(xᵢ).
Simpson's 1/3 rule (n even): ∫ ≈ (h/3)[y₀ + 4(y₁ + y₃ + …) + 2(y₂ + y₄ + …) + yₙ]. It fits a parabola through each pair of strips.
Simpson's 3/8 rule (n a multiple of 3): ∫ ≈ (3h/8)[y₀ + 3(y₁ + y₂ + y₄ + y₅ + …) + 2(y₃ + y₆ + …) + yₙ]. It fits a cubic through each group of three strips.
Worked example
Evaluate ∫₀¹ 1/(1 + x²) dx with n = 6, so h = 1/6. The ordinates are 1, 0.972973, 0.9, 0.8, 0.692308, 0.590164 and 0.5.
With the 1/3 rule the weighted sum is 1 + 4(0.972973 + 0.8 + 0.590164) + 2(0.9 + 0.692308) + 0.5 = 14.137163. Multiply by h/3 = 1/18 to get 0.785398. The exact value is π/4 = 0.785398, so the error is about 0.0000002. The 3/8 rule with the same n gives 0.785396, also very close.
Accuracy and choosing n
Both rules are exact for polynomials up to degree 3. Their error falls like h⁴, so doubling n cuts the error about 16 times. The tool compares your answer with a reference computed on 20,000 strips, which shows how many digits you can trust. For a simpler method with error like h², compare with the trapezoidal rule calculator.
Frequently asked questions
Why must n be even for Simpson's 1/3 rule?
The rule fits one parabola over every two strips, so the strips must come in pairs.
Which is more accurate, 1/3 or 3/8?
For the same h both have errors of order h⁴; the 1/3 rule's constant is slightly smaller. Use 3/8 when n is a multiple of 3 but odd.
Is the reference value exact?
It is a numerical value on 20,000 strips, accurate to many digits for smooth functions, but it is not a symbolic antiderivative.
Is this calculator free?
Yes. You enter your name and WhatsApp number once when you see your result, and other Uncodemy tools then open without the form.