Why the Midpoint Rule Often Beats Left and Right Sums
A worked explanation of why the midpoint rule often beats left and right sums, including the key limitation and a checkable example.
The Midpoint Rule vs. Left and Right Sums
You have ∫₀¹ x² dx to approximate with two rectangles. The left sum gives 0.125. The right sum gives 0.625. The exact value is 1/3 ≈ 0.3333. Both are off by more than 0.2. The midpoint rule, using the same two rectangles, returns 0.3125, an error of just 0.0208. That is ten times smaller. This is why the midpoint rule often beats left and right sums: it cancels symmetric error that the endpoint methods cannot touch.
The midpoint rule evaluates the height at the centre of each subinterval, not at its edge. For a smooth curve, the overestimate on one side of the midpoint and the underestimate on the other side nearly cancel. Left and right sums have no such symmetry; they accumulate error in one direction across the whole interval.
Why The Midpoint Rule Often Beats Left And Right Sums: A Worked Example
Work the same integral ∫₀¹ x² dx with n = 2 subintervals. Δx = (1 − 0)/2 = 0.5. The midpoints are at x = 0.25 and x = 0.75. Heights: f(0.25) = 0.0625, f(0.75) = 0.5625. Sum the heights: 0.625. Multiply by Δx: 0.5 × 0.625 = 0.3125. The exact integral is 1/3 ≈ 0.3333. Absolute error: 0.0208.
Now compare with left and right sums. Left sum uses heights at x = 0 and x = 0.5: f(0) = 0, f(0.5) = 0.25. Sum = 0.25, times Δx = 0.125. Error: 0.2083. Right sum uses heights at x = 0.5 and x = 1: f(0.5) = 0.25, f(1) = 1. Sum = 1.25, times Δx = 0.625. Error: 0.2917.
The midpoint approximation error is an order of magnitude smaller than either endpoint method. This is not a coincidence, it follows directly from the error term in numerical analysis.
Calculation Steps
The error bound for the midpoint rule is |E_m| ≤ (b − a)³ / (24n²) × max|f''(x)|. For ∫₀¹ x² dx, f''(x) = 2, so max|f''| = 2. (b − a)³ = 1. n = 2. Plug in: 1 / (24 × 4) × 2 = 2 / 96 = 0.02083. The actual error was 0.0208. The bound is tight.
For the same n, the trapezoidal rule error bound is twice that: (b − a)³ / (12n²) × max|f''(x)| = 0.04167. The midpoint rule is exactly half the error of the trapezoidal rule for the same number of subintervals. That is the direct consequence of error cancellation: the midpoint rule's first-order error term vanishes because the midpoint is the average of the function over the interval for a linear approximation.
When you need a quick approximation without doubling the number of rectangles, use the midpoint rule. If you are working through the calculation by hand, reach for a riemann sum calculator to check your work, but the midpoint method will consistently give you a closer answer for the same computational effort.
Why the Method Works
The error cancellation works because the midpoint rule approximates the average value of the function on each subinterval. For a smooth, twice-differentiable function, the midpoint height is the value at which the area of the rectangle equals the area under the tangent line at that point. The overestimate on one side of the midpoint and the underestimate on the other side cancel to first order.
Left and right sums have no such compensation. A left sum always underestimates an increasing function and overestimates a decreasing one. A right sum does the opposite. The midpoint rule, by contrast, straddles the error: it overestimates on the left half of the subinterval and underestimates on the right half, or vice versa, and the two errors nearly cancel.
This is why the error term depends on the second derivative f''(x), not the first. For any linear function, f''(x) = 0, and the midpoint rule gives the exact integral. Left and right sums, even for a straight line, still miss by the slope times half the interval width.
The Error Cancellation Mechanism
Take a single subinterval [xᵢ₋₁, xᵢ] of width Δx. The midpoint is m = (xᵢ₋₁ + xᵢ)/2. Expand f(x) in a Taylor series around m: f(x) = f(m) + f'(m)(x − m) + ½f''(ξ)(x − m)². Integrate from xᵢ₋₁ to xᵢ. The linear term f'(m)(x − m) integrates to zero because the midpoint is symmetric in the interval. Only the quadratic term contributes to the error.
For left and right sums, the Taylor expansion is around the endpoint. The linear term does not vanish. The error contains a first-derivative term that is O(Δx), not O(Δx²). That is the fundamental gap in accuracy.
When Error Cancellation Breaks Down
The assumption is that f is twice differentiable. For a function with a corner, a cusp, or a discontinuity, the Taylor expansion fails and the cancellation does not occur.
Test f(x) = |x − 0.5| on [0, 1] with n = 1. The midpoint is at x = 0.5. f(0.5) = 0. The midpoint approximation is 0. The exact integral is 0.25. Error: 0.25, larger than either endpoint method. Left sum: f(0) = 0, approximation 0, error 0.25. Right sum: f(1) = 0.5, approximation 0.5, error 0.25. All three methods fail equally, but the midpoint rule did not beat anything. The function is not smooth at the midpoint itself, so the error cancellation assumption is violated.
A Concrete Failure Case
The midpoint rule assumes the function is twice differentiable across the whole interval. When that fails, the method can be worse than the endpoint alternatives.
Use f(x) = |x − 0.5| on [0, 1] with n = 1. The single midpoint rectangle covers the whole interval. Midpoint at x = 0.5 gives height 0. Area = 0. Exact integral = 0.25. Error = 0.25. Left sum: height at x = 0 is 0, area = 0, error = 0.25. Right sum: height at x = 1 is 0.5, area = 0.5, error = 0.25.
All three are equally bad. But increase n to 2. Midpoints at x = 0.25 and x = 0.75: f(0.25) = 0.25, f(0.75) = 0.25. Sum = 0.5, times Δx = 0.5 × 0.5 = 0.25. Exact integral = 0.25. The midpoint rule is exact for n = 2 on this function. Left and right sums remain off by 0.125 each. The error cancellation works when the midpoint falls on a smooth region, even if the function has a corner elsewhere, as long as no subinterval contains the corner at its midpoint.
The lesson: the midpoint rule's advantage is real but conditional. For smooth, twice-differentiable curves, it beats left and right sums by a factor of two in the error bound. For non-smooth curves, check where the subinterval boundaries and midpoints land relative to the discontinuity.
| Method | Approximation | Exact Value | Absolute Error | Error Bound |
|---|---|---|---|---|
| Left Sum | 0.125 | 0.3333 | 0.2083 | 0.0417 |
| Right Sum | 0.625 | 0.3333 | 0.2917 | 0.0417 |
| Midpoint Rule | 0.3125 | 0.3333 | 0.0208 | 0.0208 |
What the Midpoint Rule Cannot Do
The midpoint rule is not a universal improvement. It assumes the function is twice differentiable. For integrands with jump discontinuities, sharp corners, or vertical asymptotes, the error cancellation does not apply. The failure case of f(x) = |x − 0.5| with n = 1 shows that a single non-smooth point at the midpoint ruins the approximation.
When the function is smooth, the midpoint rule is the better choice for the same computational cost. When it is not, check the placement of subinterval midpoints relative to problem points. One corner inside a subinterval but not at its midpoint still leaves the cancellation intact on the rest of the interval.
The single thing that most often goes wrong: assuming the midpoint rule always beats endpoint methods without checking whether the function is twice differentiable across the integration interval. That one condition is the difference between a tenfold error reduction and a useless approximation.
Common Questions
What exactly is the error cancellation in the midpoint rule?
When you expand f(x) around the midpoint of a subinterval, the linear term integrates to zero because the midpoint is symmetric. Only the quadratic term contributes to the error. Left and right sums keep the linear term, which is O(Δx). The midpoint rule's error is O(Δx²), which is smaller for small Δx.
How much more accurate is the midpoint rule than left or right sums?
For the same number of subintervals n, the midpoint rule error bound is (b − a)³ / (24n²) × max|f''(x)|. The trapezoidal rule, which has the same structure as left and right sums, has bound (b − a)³ / (12n²) × max|f''(x)|. The midpoint rule error is exactly half.
Does the midpoint rule always beat left and right sums?
No. For functions that are not twice differentiable across the whole interval, the error cancellation fails. For f(x) = |x − 0.5| with n = 1, the midpoint rule is no better than the endpoint methods. For n = 2, it becomes exact while endpoint methods still have error.
What is the error bound formula for the midpoint rule?
|E_m| ≤ (b − a)³ / (24n²) × max|f''(x)| over the interval [a, b]. This is standard in numerical analysis textbooks such as Burden and Faires, Numerical Analysis, 9th edition, §4.1.
Can I use the midpoint rule for functions with corners or cusps?
You can, but the error cancellation may not hold. If a corner falls exactly at a subinterval midpoint, the approximation can be worse. If corners fall between midpoints, the method still works well. Check the second derivative across each subinterval.
Why does the midpoint rule have an error term with f''(x) instead of f'(x)?
The first-derivative term integrates to zero over a symmetric interval around the midpoint. Only the second-derivative term remains. Left and right sums do not have that symmetry, so their error contains the first-derivative term, which is larger.
When should I choose the midpoint rule over left or right sums?
Always for smooth, twice-differentiable functions. For the same n, you get roughly twice the accuracy. For piecewise smooth functions, use the midpoint rule but verify that no subinterval midpoint falls on a non-differentiable point.