WhatsApp us
University Maths25 Nov 2026

Simpson's Rule and the Trapezoidal Rule: Formulas, Error Bounds and Worked Examples

Simpson's 1/3 rule, Simpson's 3/8 rule and the trapezoidal rule worked on the same integrals, with the error formulas, how to choose the number of intervals, a data-table question and practice with checked answers.

Simpson's Rule and the Trapezoidal Rule: Formulas, Error Bounds and Worked Examples

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

RuleStrips n must beFormulaError term (composite)Exact for
Trapezoidalany(h/2)[y₀ + yₙ + 2(y₁ + … + yₙ₋₁)]−(b − a)h² f″(ξ)/12straight lines
Simpson's 1/3even(h/3)[y₀ + yₙ + 4(y₁ + y₃ + …) + 2(y₂ + y₄ + …)]−(b − a)h⁴ f⁗(ξ)/180cubics
Simpson's 3/8multiple of 3(3h/8)[y₀ + yₙ + 3(y₁ + y₂ + y₄ + y₅ + …) + 2(y₃ + y₆ + …)]−(b − a)h⁴ f⁗(ξ)/80cubics

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.

x00.250.50.751
y = x eˣ00.3210060.8243611.5877502.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.

nTrapezoidalErrorSimpson's 1/3Error
41.0230642.3 × 10⁻²1.0001691.7 × 10⁻⁴
81.0057745.8 × 10⁻³1.0000111.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.

i0123456
yᵢ = 1/xᵢ10.750.60.50.4285710.3750.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

RuleValueError
Trapezoidal1.1067468.1 × 10⁻³
Simpson's 1/31.0989423.3 × 10⁻⁴
Simpson's 3/81.0992566.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)024681012
v (m/s)051220252728

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?

  1. The rule is named: use it, and check n satisfies its condition (even for 1/3, multiple of 3 for 3/8).
  2. n is odd and only Simpson is allowed: use 3/8 on three strips and 1/3 on the rest.
  3. Data at unequal spacing: none of these rules applies as written; use the trapezoidal rule strip by strip.
  4. "How many intervals for accuracy ε": bound f″ or f⁗ on [a, b] and solve the error inequality for h.
  5. 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

  1. Use the trapezoidal rule with n = 4 for ∫₀¹ x² dx.
  2. Use Simpson's 1/3 rule with n = 4 for ∫₀¹ x⁴ dx, and find the error.
  3. 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.
  4. How many Simpson strips are needed to be sure the error is below 10⁻⁶ for ∫₀¹ eˣ dx?
  5. 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.
Simpson's ruletrapezoidal rulenumerical integrationnumerical methodsB.Tech maths

Related guides

Keep exploring this maths topic

University Maths25 Nov 2026

Runge-Kutta Method (4th Order): Formula, Worked Examples and Euler vs RK4

The fourth-order Runge-Kutta formula explained with full k₁ to k₄ working, an Euler vs RK4 error table against the exact solution, a nonlinear example, a second-order ODE as a system, and practice with checked answers.

Runge-Kutta methodRK4numerical methodsEuler method

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Newton-Raphson Method and Bisection Method: Formula, Iteration Tables and Examples

The Newton-Raphson formula and the bisection method worked step by step, with full iteration tables, how many iterations you need, when Newton fails, and practice questions with checked answers.

Newton-Raphson methodbisection methodnumerical methodsroot finding

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Beta and Gamma Functions in Engineering Maths: Formulas and Worked Examples

Beta and gamma functions for B.Tech engineering maths: the definitions, the key properties and the beta-gamma relation, with six original worked integrals, the trigonometric form, and the slips that cost marks.

beta functiongamma functionengineering mathematicsimproper integrals

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Fourier Series in Engineering Maths: Coefficients, Square Wave and Half-Range Series

How to find Fourier series coefficients step by step, with five original worked examples (square wave, general period, half-range, harmonic analysis from a table) and the slips that cost marks in B.Tech exams.

Fourier seriesengineering mathematicshalf-range seriesharmonic analysis

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Cauchy Residue Theorem: Formula and Worked Examples for Engineering Maths

The Cauchy residue theorem explained through six original worked examples: simple and higher-order poles, a Laurent series residue, rational and trigonometric real integrals, and a Jordan's lemma integral, plus the slips that cost marks.

Cauchy residue theoremcomplex analysiscontour integrationengineering mathematics

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

How to Clear an Engineering Maths Back Paper (M1, M2 or M3)

A realistic plan for B.Tech students re-taking Engineering Mathematics M1, M2 or M3: confirm your scheme, map past papers, revise unit by unit, and master the high-yield question types through seven worked examples and a practice set with answers.

engineering maths back paperM1 back paperM2 back paperM3 back paper

By Maths Bodhi Team

Read guide