Riemann Sum — Midpoint Approximation
Problem
Approximate ∫₀⁴ x² dx using 8 midpoint rectangles.
Explanation
The midpoint Riemann sum uses the function value at the center of each subinterval. For most functions this is dramatically more accurate than left or right sums — the over-and-under errors of the rectangle's two halves tend to cancel.
The Setup
The midpoint of the -th subinterval is:
The midpoint Riemann sum is:
Step-by-Step Solution
Given: , , , .
Find: The midpoint Riemann sum .
Step 1 — Compute .
Step 2 — List the midpoints.
The first midpoint is at , then they spread out by :
Step 3 — Evaluate .
Step 4 — Sum the function values.
Step 5 — Multiply by .
Step 6 — Compare to the exact value.
The error is only — about 0.4%! Compare this to the left sum's 18% error and the right sum's 20% error with the exact same number of subdivisions. The midpoint rule is dramatically better.
Why? Inside each subinterval, the curve is approximately linear. The midpoint rectangle's height matches the line's average value over the interval — so it counts the high half of the interval and the low half exactly equally. The error is proportional to (concavity) rather than (slope), which makes it converge much faster as .
Answer: The midpoint Riemann sum with rectangles is
This is within 0.4% of the exact value . With the same number of rectangles, midpoint dominates left and right sums. Even better is Simpson's rule, which combines midpoint and trapezoidal sums to get error proportional to .
Try It
- Adjust n — see how quickly the midpoint error vanishes (it shrinks like , twice as fast as left/right).
- Toggle show exact area to compare against the true region.
- Notice how each rectangle's top spans both above and below the curve — the over-counting on one side cancels the under-counting on the other.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.