Simpson's 1/3 rule approximates ∫ₐᵇ f(x) dx by fitting parabolas through pairs of strips: with an even number n of strips of width h = (b − a)/n, it gives (h/3)[y₀ + yₙ + 4(odd-numbered ordinates) + 2(even-numbered interior ordinates)]. The trapezoidal rule joins points with straight lines instead, giving (h/2)[y₀ + yₙ + 2(all interior ordinates)]. Simpson's error shrinks like h⁴ and the trapezoidal error like h², which is why Simpson is usually far more accurate for the same work.
Below, all three standard rules are applied to the same integrals so you can compare them, followed by the error formulas, how to choose n for a stated accuracy, and a data-table question of the kind many B.Tech papers set.
The three rules side by side
| Rule | Strips n must be | Formula | Error term (composite) | Exact for |
|---|---|---|---|---|
| Trapezoidal | any | (h/2)[y₀ + yₙ + 2(y₁ + … + yₙ₋₁)] | −(b − a)h² f″(ξ)/12 | straight lines |
| Simpson's 1/3 | even | (h/3)[y₀ + yₙ + 4(y₁ + y₃ + …) + 2(y₂ + y₄ + …)] | −(b − a)h⁴ f⁗(ξ)/180 | cubics |
| Simpson's 3/8 | multiple of 3 | (3h/8)[y₀ + yₙ + 3(y₁ + y₂ + y₄ + y₅ + …) + 2(y₃ + y₆ + …)] | −(b − a)h⁴ f⁗(ξ)/80 | cubics |
Here ξ is some point in (a, b). In the 3/8 rule, ordinates whose index is a multiple of 3 get weight 2 and all other interior ordinates get weight 3.
Numerical integration usually sits in the same unit as root finding and interpolation. For help across the whole numerical methods syllabus, our engineering mathematics tutoring page explains how online sessions with Ajay Vatsyayan are organised.
Example 1: the trapezoidal and 1/3 rules, then halving h
Estimate ∫₀¹ x eˣ dx with n = 4, by both rules. (The exact value is 1, by integration by parts.)
Step 1: tabulate. h = 0.25.
| x | 0 | 0.25 | 0.5 | 0.75 | 1 |
|---|---|---|---|---|---|
| y = x eˣ | 0 | 0.321006 | 0.824361 | 1.587750 | 2.718282 |
Step 2: trapezoidal.
T = (0.25/2)[0 + 2.718282 + 2(0.321006 + 0.824361 + 1.587750)] = 0.125 × 8.184516 = 1.023064
Step 3: Simpson's 1/3. Odd ordinates y₁, y₃; even interior ordinate y₂.
S = (0.25/3)[0 + 2.718282 + 4(0.321006 + 1.587750) + 2(0.824361)] = (0.25/3)(12.002028) = 1.000169
Step 4: halve h. With n = 8 the values become T = 1.005774 and S = 1.000011.
| n | Trapezoidal | Error | Simpson's 1/3 | Error |
|---|---|---|---|---|
| 4 | 1.023064 | 2.3 × 10⁻² | 1.000169 | 1.7 × 10⁻⁴ |
| 8 | 1.005774 | 5.8 × 10⁻³ | 1.000011 | 1.1 × 10⁻⁵ |
Halving h cut the trapezoidal error by about 4 and the Simpson error by about 16, exactly as the h² and h⁴ error terms predict.
Example 2: all three rules on one integral
Evaluate ∫₁³ dx/x with n = 6 by the trapezoidal rule, Simpson's 1/3 rule and Simpson's 3/8 rule, and compare with ln 3 ≈ 1.098612.
h = (3 − 1)/6 = 1/3, so x = 1, 4/3, 5/3, 2, 7/3, 8/3, 3.
| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| yᵢ = 1/xᵢ | 1 | 0.75 | 0.6 | 0.5 | 0.428571 | 0.375 | 0.333333 |
Trapezoidal. y₀ + y₆ = 1.333333; interior sum = 2.653571.
T = (1/6)[1.333333 + 2(2.653571)] = 6.640476/6 = 1.106746
Simpson's 1/3. Odd: y₁ + y₃ + y₅ = 1.625. Even interior: y₂ + y₄ = 1.028571.
S = (1/9)[1.333333 + 4(1.625) + 2(1.028571)] = 9.890476/9 = 1.098942
Simpson's 3/8. Weight 3: y₁ + y₂ + y₄ + y₅ = 2.153571. Weight 2: y₃ = 0.5.
S₃/₈ = (1/8)[1.333333 + 3(2.153571) + 2(0.5)] = 8.794048/8 = 1.099256
| Rule | Value | Error |
|---|---|---|
| Trapezoidal | 1.106746 | 8.1 × 10⁻³ |
| Simpson's 1/3 | 1.098942 | 3.3 × 10⁻⁴ |
| Simpson's 3/8 | 1.099256 | 6.4 × 10⁻⁴ |
The 3/8 rule's error constant (1/80) is larger than the 1/3 rule's (1/180), so with the same h the 1/3 rule usually wins. The 3/8 rule exists for when n is odd or a multiple of 3 is forced on you.
Example 3: a data-table question
A car starts from rest. Its speed v (m/s) is recorded every 2 seconds:
| t (s) | 0 | 2 | 4 | 6 | 8 | 10 | 12 |
|---|---|---|---|---|---|---|---|
| v (m/s) | 0 | 5 | 12 | 20 | 25 | 27 | 28 |
Estimate the distance travelled in 12 seconds using Simpson's 1/3 rule.
Distance = ∫₀¹² v dt, with h = 2 and n = 6 (even, so the 1/3 rule applies).
Distance ≈ (2/3)[0 + 28 + 4(5 + 20 + 27) + 2(12 + 25)]
Distance ≈ (2/3)(28 + 208 + 74) = (2/3)(310) ≈ 206.7 m
For comparison the trapezoidal rule gives 206.0 m. When the data are smooth the two agree closely; a big gap is a hint that you have mislabelled an ordinate.
With tabulated data there is no formula for f⁗, so you cannot quote an error bound. Say so if the question asks about accuracy, and compare two rules instead.
Example 4: choosing n for a given accuracy
How many strips are needed so that the error in ∫₁³ dx/x is below 10⁻⁴, (a) by the trapezoidal rule, (b) by Simpson's 1/3 rule?
(a) Trapezoidal. f(x) = 1/x, f″(x) = 2/x³, which is largest at x = 1, so max |f″| = 2.
Error bound: |E| ≤ (b − a)h² max|f″|/12 = 2 × h² × 2/12 = h²/3
We need h²/3 < 10⁻⁴, so h < 0.017321 and n = 2/h > 115.47. Take n = 116.
(b) Simpson's 1/3. f⁗(x) = 24/x⁵, so max |f⁗| = 24.
Error bound: |E| ≤ (b − a)h⁴ max|f⁗|/180 = 2 × h⁴ × 24/180 = 4h⁴/15
We need 4h⁴/15 < 10⁻⁴, so h < 0.139158 and n > 14.37. Simpson needs an even n, so take n = 16.
Running both confirms it: with n = 116 the trapezoidal error is about 2.2 × 10⁻⁵, and with n = 16 the Simpson error is about 7.8 × 10⁻⁶. Sixteen Simpson strips beat 116 trapezoids.
Example 5: why Simpson is exact for cubics
Apply Simpson's 1/3 rule with n = 2 to ∫₀² x³ dx.
h = 1, ordinates 0, 1, 8. S = (1/3)[0 + 4(1) + 8] = 4, and the exact value is 2⁴/4 = 4.
The error term contains f⁗, and f⁗ = 0 for any cubic, so Simpson's rule has no error. This is a quick way to test that you have the weights right.
Which rule does the question need?
- The rule is named: use it, and check n satisfies its condition (even for 1/3, multiple of 3 for 3/8).
- n is odd and only Simpson is allowed: use 3/8 on three strips and 1/3 on the rest.
- Data at unequal spacing: none of these rules applies as written; use the trapezoidal rule strip by strip.
- "How many intervals for accuracy ε": bound f″ or f⁗ on [a, b] and solve the error inequality for h.
- Comparing methods: tabulate errors against an exact value, as in Example 2.
Where students lose marks
- Using Simpson's 1/3 rule with odd n. Count strips, not points: seven ordinates means six strips.
- Mixing up the weights. In the 1/3 rule the pattern is 1, 4, 2, 4, …, 2, 4, 1. Write the weight above each ordinate in your table.
- Using h = (b − a)/(number of points). It is (b − a)/(number of strips).
- Bounding f″ or f⁗ at the wrong end. Find where |f″| or |f⁗| is largest on the interval, not just at x = a.
- Rounding n down. n > 115.47 means 116; and for Simpson, round up to the next even number.
- Calculator in degrees for integrands with trigonometric functions.
Practice set
- Use the trapezoidal rule with n = 4 for ∫₀¹ x² dx.
- Use Simpson's 1/3 rule with n = 4 for ∫₀¹ x⁴ dx, and find the error.
- A table has ordinates at x = 0, 0.5, …, 3: 1, 1.6, 2.4, 2.9, 3.1, 3.0, 2.8. Estimate the area under the curve by Simpson's 1/3 rule.
- How many Simpson strips are needed to be sure the error is below 10⁻⁶ for ∫₀¹ eˣ dx?
- You have 5 strips of data and must use Simpson-type rules. What do you do?
Answers. (1) 0.34375 (exact 1/3). (2) 0.200521, error about 5.2 × 10⁻⁴ (exact 0.2). (3) 7.4667 (the trapezoidal rule gives 7.45). (4) h⁴ e/180 < 10⁻⁶ gives h < 0.0902, n > 11.09, so n = 12. (5) Apply the 3/8 rule to the first three strips and the 1/3 rule to the last two (or the other way round).
Where numerical integration leads next
Simpson's weights reappear in the fourth-order Runge-Kutta method, which reduces to Simpson's rule when the slope depends on x only; see our RK4 worked examples with an Euler comparison. The error terms themselves come from Taylor expansions, covered in the Taylor and Maclaurin series guide. When an integral does have a closed form through special functions, the beta and gamma functions guide gives exact values you can test these rules against. Students who met the trapezoidal rule at school will recognise the start of this in the IB AI SL trapezoidal rule guide, and root finding from the same unit is in our Newton-Raphson and bisection walkthrough.
How Maths Bodhi helps
We practise setting out ordinate tables and weights cleanly, work through the error-bound questions from your past papers, and review your own attempts. If numerical methods is part of a back paper, our back paper plan for engineering maths shows what to prioritise.
Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.
Written and checked by the Maths Bodhi team (November 2026).
Frequently asked questions
- What is Simpson's 1/3 rule formula?
- (h/3)[y₀ + yₙ + 4(sum of odd-numbered ordinates) + 2(sum of even-numbered interior ordinates)], with n even.
- What is the error formula for Simpson's rule?
- For the composite 1/3 rule, E = −(b − a)h⁴ f⁗(ξ)/180 for some ξ in (a, b).
- Why must n be even in Simpson's 1/3 rule?
- Each parabola covers two strips, so the strips must pair up.
- Which is more accurate, Simpson's rule or the trapezoidal rule?
- For smooth functions Simpson's rule, since its error is of order h⁴ against h² for the trapezoidal rule.
- When should I use Simpson's 3/8 rule?
- When the number of strips is a multiple of 3, or combined with the 1/3 rule when n is odd.
- Is Simpson's rule exact for cubic polynomials?
- Yes; its error term depends on the fourth derivative, which is zero for any cubic.
