Simpson’s Rule Calculator (1/3 and 3/8 Rules, Step by Step)
CalculusFreeNo sign-up
A Simpson’s rule calculator estimates a definite integral with parabolas over pairs of subintervals: Sn = (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(xn−1) + f(xn)], where h = (b − a)/n and n is even. For 1/x from 1 to 2 with n = 4, h = 0.25 and S₄ ≈ 0.693254, just 0.000107 above ln 2 ≈ 0.693147.
Compare with other methods
| Method (n = 4) | Value | Error |
|---|---|---|
| Simpson’s 1/3 rule | 0.6932539683 | +0.0001068 |
| Trapezoidal rule | 0.6970238095 | +0.003877 |
| Midpoint rule | 0.6912198912 | −0.001927 |
| Left Riemann sum | 0.7595238095 | +0.06638 |
| Right Riemann sum | 0.6345238095 | −0.05862 |
Table of xᵢ, f(xᵢ) and weights (5 points)
| i | xᵢ | f(xᵢ) | weight | weight × f(xᵢ) |
|---|---|---|---|---|
| 0 | 1 | 1 | 1 | 1 |
| 1 | 1.25 | 0.8 | 4 | 3.2 |
| 2 | 1.5 | 0.666667 | 2 | 1.33333 |
| 3 | 1.75 | 0.571429 | 4 | 2.28571 |
| 4 | 2 | 0.5 | 1 | 0.5 |
| Sum | 8.319047619 | |||
| S₄ = h/3 × sum | 0.6932539683 |
Doubling n: the error shrinks about 16 times
| n | S(n) | Error | Error ratio |
|---|---|---|---|
| 4 | 0.6932539683 | 0.000107 | — |
| 8 | 0.6931545307 | 7.35 × 10⁻⁶ | 14.5 |
| 16 | 0.6931476528 | 4.72 × 10⁻⁷ | 15.6 |
| 32 | 0.6931472103 | 2.97 × 10⁻⁸ | 15.9 |
Show steps
- Check n and find the stepn = 4 is even, as the 1/3 rule needs. h = (b − a)/n = (2 − 1)/4 = 0.25.
- Evaluate f at the points xᵢ = a + ihf(1) = 1, f(1.25) = 0.8, f(1.5) = 0.666667, f(1.75) = 0.571429, f(2) = 0.5.
- Apply the weightsThe 1/3 rule uses the pattern 1, 4, 2, 4, 2, …, 4, 1: ends once, odd points 4 times, interior even points 2 times. S₄ = (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(x₃) + f(x₄)].
- Add the weighted values1 + 4·0.8 + 2·0.666667 + 4·0.571429 + 0.5 = 8.319047619.
- Multiply by h/3S₄ = 0.25/3 × 8.319047619 = 0.6932539683.
- Exact value with the Fundamental Theorem of CalculusF(x) = ln(|x|), so the integral from 1 to 2 = F(b) − F(a) = ln(2) ≈ 0.69314718
- Actual errorError = 0.6932539683 − 0.6931471806 = 0.0001068.
- Error boundf⁽⁴⁾(x) = 24/x5. On [a, b], K = max |f⁽⁴⁾(x)| ≈ 24 (at x ≈ 1), so |E| ≤ K(b − a)⁵/(180n⁴) = 24 × 1⁵/(180 × 4⁴) = 0.0005208.
Related: integral calculator · Riemann sum and trapezoid calculator · derivative calculator
How to use the Simpson’s rule calculator
- Type the function, such as 1/x, e^(x^2) or sin(x), and the limits a and b. Limits can be fractions, pi or e.
- Enter the number of subintervals n and pick the rule: Simpson’s 1/3 rule needs an even n, the 3/8 rule needs a multiple of 3.
- Read the estimate, the exact integral when one exists, the actual error and the error bound. The graph shades the parabolas (or cubics) that the rule integrates.
- Optional: type a target error, such as 0.0001, to get the smallest n that the error bound guarantees.
Use the Data table tab when you only have measured values at equal spacing, for example offsets in land surveying or readings every 10 seconds. With an odd number of subintervals, the automatic setting uses the 1/3 rule and finishes with the 3/8 rule on the last three.
Simpson’s rule formula
Split [a, b] into n equal subintervals of width h = (b − a)/n, with points xi = a + ih. Simpson’s 1/3 rule is
∫ f(x) dx from a to b ≈ (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 2f(xn−2) + 4f(xn−1) + f(xn)].
The weights follow the pattern 1, 4, 2, 4, 2, …, 4, 1. Each pair of subintervals gets its own parabola through three points, and the area under one parabola is exactly (h/3)(y₀ + 4y₁ + y₂). Neighbouring parabolas share an end point, which is why the inside even points get weight 2. That pairing is also why n must be even.
Worked examples
Example 1: x² from 0 to 2 with n = 2
h = (2 − 0)/2 = 1, and f(0) = 0, f(1) = 1, f(2) = 4. Simpson’s rule gives (1/3)(0 + 4 × 1 + 4) = 8/3 ≈ 2.667, which is the exact answer. The trapezoidal rule with the same points gives (1/2)(0 + 2 × 1 + 4) = 3, an overestimate. Simpson’s rule is exact for every polynomial of degree 3 or less.
Example 2: 1/x from 1 to 2 with n = 4
| i | xi | f(xi) | Weight | Weight × f(xi) |
|---|---|---|---|---|
| 0 | 1 | 1 | 1 | 1 |
| 1 | 1.25 | 0.8 | 4 | 3.2 |
| 2 | 1.5 | 0.666667 | 2 | 1.333333 |
| 3 | 1.75 | 0.571429 | 4 | 2.285714 |
| 4 | 2 | 0.5 | 1 | 0.5 |
The weighted values add up to 8.319048, so S₄ = (0.25/3) × 8.319048 ≈ 0.693254. The exact integral is ln 2 ≈ 0.693147, so the error is about 0.000107, or 0.015%.
Example 3: Simpson’s 3/8 rule
The 3/8 rule fits a cubic through four points, three subintervals at a time: ∫ f(x) dx ≈ (3h/8)[f(x₀) + 3f(x₁) + 3f(x₂) + 2f(x₃) + 3f(x₄) + … + 3f(xn−1) + f(xn)], with n a multiple of 3. For x⁴ from 0 to 3 with n = 3, h = 1 and (3/8)(0 + 3 × 1 + 3 × 16 + 81) = (3/8)(132) = 49.5. The exact value is 3⁵/5 = 48.6.
Simpson’s rule error bound and choosing n
If |f⁽⁴⁾(x)| ≤ K on [a, b], the error of Simpson’s 1/3 rule is at most
|E| ≤ K(b − a)⁵ / (180n⁴).
For the 3/8 rule the denominator is 80n⁴. For 1/x on [1, 2], f⁽⁴⁾(x) = 24/x⁵, so K = 24 and the bound for n = 4 is 24 × 1⁵/(180 × 4⁴) ≈ 0.000521. The actual error, 0.000107, is well inside it.
To guarantee a given accuracy, solve the bound for n. For 1/(1 + x²) on [0, 1], the largest value of |f⁽⁴⁾| is 24 (at x = 0). An error of at most 0.00001 needs n⁴ ≥ 24/(180 × 0.00001), so n ≥ 10.75, and the smallest even choice is n = 12.
Because of the n⁴ in the denominator, doubling n cuts the error by about 16. In Example 2, going from n = 4 to n = 8 shrinks the error from about 0.000107 to 0.0000073.
Simpson’s rule vs the trapezoidal and midpoint rules
| Method, 1/x on [1, 2], n = 4 | Estimate | Error |
|---|---|---|
| Left Riemann sum | 0.759524 | +0.066377 |
| Right Riemann sum | 0.634524 | −0.058623 |
| Trapezoidal rule | 0.697024 | +0.003877 |
| Midpoint rule | 0.691220 | −0.001927 |
| Simpson’s 1/3 rule | 0.693254 | +0.000107 |
The trapezoidal rule joins points with straight lines; Simpson’s rule uses parabolas, which follow a curve far more closely. The two are linked: Simpson’s rule with 2n subintervals equals (2Mn + Tn)/3, a weighted average of the midpoint and trapezoidal rules. Here (2 × 0.691220 + 0.697024)/3 ≈ 0.693155, which is S₈.
Simpson’s rule with data and in surveying
Simpson’s rule only needs function values at equal spacing, so it works on measurements. A surveyor measures the width of a plot (the offsets) every 10 m along a 60 m baseline: 12, 15, 19, 22, 20, 16 and 13 m. The area is about (10/3)[12 + 4(15) + 2(19) + 4(22) + 2(20) + 4(16) + 13] = (10/3)(315) = 1,050 m². The same method gives distance from a table of speeds or volume from cross-sectional areas.
Common mistakes with Simpson’s rule
- Using an odd n with the 1/3 rule. Use an even n, or switch to the 3/8 rule for the last three subintervals.
- Mixing up the weights. The ends get 1, odd points 4, inside even points 2.
- Dividing by 3 instead of multiplying by h/3, or using (b − a)/3 in place of h/3.
- Applying it to unequally spaced data. Simpson’s rule needs one common width h.
- Evaluating trig functions in degrees. Calculus uses radians.
Simpson’s rule practice quiz: 10 questions
Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
h = 1, so S = (1/3)(0 + 4 × 1 + 8) = 12/3 = 4. This equals the exact value, because Simpson's rule is exact for cubics.
The pattern is 1, 4, 2, 4, 2, 4, 1. Interior points with an even index get weight 2.
A parabola needs three points, so the rule groups subintervals in pairs; an odd n leaves one subinterval without a partner.
h = 1, so S = (1/3)(1 + 4 × 1/2 + 1/3) = (1/3)(10/3) = 10/9 ≈ 1.1111. The exact value is ln 3 ≈ 1.0986.
h = 1: (1/3)(2 + 4 × 3 + 2 × 7 + 4 × 6 + 4) = (1/3)(56) = 56/3. The trapezoidal rule would give 19.
The 3/8 rule fits a cubic through four points, with weights 1, 3, 3, 1 multiplied by 3h/8.
The error bound has n⁴ in the denominator, so doubling n divides it by 2⁴ = 16.
f⁽⁴⁾(x) = 24, so K = 24 and |E| ≤ 24 × 1⁵/(180 × 2⁴) = 24/2880 = 1/120.
Simpson's rule is exact for polynomials of degree 3 or less, because the cubic error terms cancel.
Quiz complete
Frequently asked questions
What is Simpson's rule?
Simpson's rule is a numerical integration method that estimates a definite integral by replacing the curve with parabolas over pairs of subintervals. It is usually far more accurate than the trapezoidal rule with the same number of points.
What is Simpson's rule for calculation of area in surveying?
Surveyors measure offsets (perpendicular widths) at equal intervals d along a baseline and use Area ≈ (d/3)[first + last + 4 × (sum of odd offsets) + 2 × (sum of remaining even offsets)]. It needs an odd number of offsets; with an even number, treat the last strip separately.
How do you do Simpson's rule on a calculator?
Enter f(x), a, b and n in the calculator above. On a TI-84, store f in Y1 and type (h/3)(Y1(a) + 4sum(seq(Y1(a + Ih), I, 1, n − 1, 2)) + 2sum(seq(Y1(a + Ih), I, 2, n − 2, 2)) + Y1(b)) with your own numbers for a, b, h and n. The built-in fnInt command uses its own method and does not show Simpson's rule.
Is Simpson's rule in Calc BC?
AP Calculus questions on approximating integrals usually ask for left, right, midpoint or trapezoidal sums, often from a table. Simpson's rule is more common in college Calculus II and numerical methods courses, so check your course syllabus.
How is Simpson's rule different from the trapezoidal rule?
The trapezoidal rule connects points with straight lines and has an error that shrinks with 1/n²; Simpson's rule connects them with parabolas and its error shrinks with 1/n⁴. Simpson's rule needs an even n and is exact for cubics.
Related calculators
- Riemann sum calculator: left, right, midpoint and trapezoidal sums.
- Integral calculator: exact antiderivatives and definite integrals with steps.
- Derivative calculator: find f⁽⁴⁾(x) for the error bound.
- Area and perimeter calculator: areas of regular shapes.
More calculus calculators
Related to This Article
More math articles
- The Best Grade 7 ELA Practice Tests for Alabama Students
- RBT Frequency, Rate, Duration and Latency: Worked Examples (2027 Prep)
- Nebraska NSCAS Grade 4 Math Free Worksheets: Printable Grade 4 Math Practice, No Login Needed
- 5th Grade North Carolina End-of-Grade Math Worksheets: FREE & Printable
- MM to Inches Converter
- Administrative Procedure Act
- Free Math Games Online
- Free Grade 8 English Worksheets for New Hampshire Students
- Website Speed: How to Build Better Word Games
- Liberty




What people say about "Simpson's Rule Calculator: 1/3 & 3/8 Rules, Error, Steps"?
No one replied yet.