Comparison7 min read

Riemann Sum vs Trapezoidal Rule

Both Riemann sums and the trapezoidal rule numerically approximate definite integrals — useful when an exact antiderivative is impossible or when only discrete data points are available.

The trapezoidal rule is generally more accurate than simple left or right Riemann sums, and comparable to the midpoint rule. Simpson's rule (parabolic approximation) is more accurate still.

AspectRiemann Sums (L/R/M)Trapezoidal Rule
Shape usedRectanglesTrapezoids
Left sum formulaΣ f(xᵢ₋₁)·ΔxN/A
Right sum formulaΣ f(xᵢ)·ΔxN/A
Midpoint formulaΣ f((xᵢ₋₁+xᵢ)/2)·ΔxN/A
Trapezoidal formulaN/A(Δx/2)[f(x₀)+2f(x₁)+…+2f(xₙ₋₁)+f(xₙ)]
Error orderO(1/n) for L/R; O(1/n²) for midpointO(1/n²)
Error bound (L/R)|E| ≤ M(b−a)²/(2n), M=max|f'|N/A
Error bound (trap)N/A|E| ≤ M(b−a)³/(12n²), M=max|f''|
Overestimate/under?Depends on monotonicityOverestimates for concave-up curves
Best useTeaching Riemann definition; midpoint bestPractical numerical integration of data

Three Riemann Sum Methods Compared

Left Riemann Sum: uses function value at the left endpoint of each subinterval. Underestimates for increasing functions; overestimates for decreasing functions.

Right Riemann Sum: uses right endpoint. Opposite behavior to left sum. Left and right sums bracket the true value for monotone functions.

Midpoint Rule: uses function value at the midpoint of each subinterval. Error order O(1/n²) — same order as trapezoidal but typically about twice as accurate. Often the best simple Riemann approximation.

The Trapezoidal Rule in Detail

Formula: Tₙ = (Δx/2)[f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xₙ₋₁) + f(xₙ)]. The factors of 2 for interior points arise because each interior point is shared by two adjacent trapezoids.

The trapezoidal rule averages the left and right Riemann sums: Tₙ = (Lₙ + Rₙ)/2. This cancels first-order errors and achieves O(1/n²) convergence.

Error bound: |Eₜ| ≤ M(b−a)³/(12n²) where M = max|f''(x)| on [a,b]. To halve the error, double n — reduce error by factor of 4.

Simpson's Rule: Even More Accurate

Simpson's Rule uses parabolas (quadratic interpolation) instead of trapezoids: Sₙ = (Δx/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 4f(xₙ₋₁) + f(xₙ)], n even.

Error: O(1/n⁴) — doubling n reduces error by factor of 16. Error bound: |Eₛ| ≤ M(b−a)⁵/(180n⁴) where M = max|f⁽⁴⁾|. Exact for polynomials of degree ≤ 3.

Composite Simpson's 1/3 rule = (2 × Trapezoidal + Midpoint) / 3. This combination eliminates both first and second order errors.

Verdict

For the same number of subintervals n: Midpoint ≈ Trapezoidal (both O(1/n²)) > Left/Right Riemann (O(1/n)). Simpson's Rule (O(1/n⁴)) is more accurate still. Use trapezoidal for discrete data; midpoint or Simpson's for smooth functions.

  • Left/Right Riemann sums: O(1/n) — need 10× more subdivisions to get 10× more accurate
  • Midpoint and Trapezoidal: O(1/n²) — 10× more subdivisions gives 100× better accuracy
  • Midpoint is typically ~2× more accurate than Trapezoidal for smooth functions
  • Simpson's Rule: O(1/n⁴) — best accuracy for smooth functions; requires even n
  • For tabular/discrete data: trapezoidal is natural (no midpoints available)

Frequently Asked Questions