AP Calculus AB and BC
Riemann Sum Visualizer: Rectangles, Error, and Rules
A Riemann sum estimates a definite integral by cutting [a,b] into n strips, multiplying each strip's height by its width, and adding. The visualizer draws rectangles and compares your total to the exact value. Left and right sums err by monotonicity; midpoint and trapezoidal sums, by concavity; all sharpen as n grows.
f is increasing on [0, 2], so each left endpoint is the lowest point of its strip: every rectangle sits below the curve, and the left sum underestimates the integral.
This tool turns a definite integral into a picture you can push around. Enter a function , the endpoints and , and a number of subintervals , then choose left, right, midpoint, or trapezoidal. The visualizer draws every strip, adds their areas into a running total, and reports the gap between that total and the exact value. Approximating area this way is Topics 6.2 and 6.3 in the CED, and it is where the definite integral is born: the area between a rate-of-change graph and the -axis is the accumulated change (CHA-4.A.1).
Each rectangle is a product, not just a shape. Its width is one slice of the input, for equal strips, and its height is a single function value . The product is that strip's area, and when is a rate it is the change accumulated over that slice. Adding the strips adds those pieces of change, which is all the summation notation is saying:
The four buttons differ in one decision only: where each strip reads its height. A left sum uses the left edge of every subinterval, a right sum the right edge, and a midpoint sum the center. The trapezoidal option is different in kind: it replaces each rectangle with a trapezoid whose slanted top joins the left and right function values, which is the same as averaging the left and right sums. Keep fixed and switch methods to see which strips overshoot the curve and which fall short.
Drag upward and the running total settles toward one number. Narrower strips leave a thinner sliver between each flat or slanted top and the curving graph, so the total missed or extra area shrinks. That limiting number is the definite integral: as the widths of the subintervals approach , the Riemann sums approach (LIM-5.C.1, Topic 6.3). The error panel in the tool is that closing gap shown as a number, and it is why no finite ever lands exactly on the answer for a curved graph.
You can usually name which side of the true value an estimate falls on before you ever compute the exact integral. Just two properties of decide it. Monotonicity settles the left and right sums; concavity settles the midpoint and trapezoidal sums.
| Method | What decides it | Underestimates when | Overestimates when |
|---|---|---|---|
| Left sum | Monotonicity | is increasing | is decreasing |
| Right sum | Monotonicity | is decreasing | is increasing |
| Midpoint sum | Concavity | is concave up | is concave down |
| Trapezoidal sum | Concavity | is concave down | is concave up |
The midpoint-trapezoid sandwich
For a given concavity, the midpoint and trapezoidal errors point opposite ways, so the exact integral is trapped between them. On a concave-up graph the midpoint sum sits below the true value and the trapezoidal sum sits above, so the answer lives in between. Put both methods in the visualizer at the same and watch the exact value land inside the two estimates: that is a free accuracy check you can use whenever keeps the same concavity across (no inflection point on the interval), even when you cannot find the integral by hand.
Worked example
Midpoint sum for a concave-up function
Approximate with a midpoint Riemann sum using equal subintervals, then use concavity to decide whether the estimate is too high or too low and check it against the exact value.
- Find the strip width and the grid. On with , . The subintervals are , , , and .
- A midpoint sum reads each height at the center of its subinterval, so list the four midpoints: , , , and .
- Evaluate at each midpoint: , , , and (rounded to four places).
- Add the heights and multiply by the common width: .
- Classify with concavity. Since , we get on , so the graph is concave up. The midpoint rectangle has the same area as the trapezoid under the tangent line at the midpoint; for a concave-up graph the curve lies above that tangent line, so the true area exceeds the rectangle and the midpoint sum underestimates.
- Check against the exact value. . The estimate sits just below it, an error of about , and shrinking in the visualizer drives that gap toward .
, an underestimate of the exact value because is concave up on ; the error is about .
Frequently asked questions
Do all four Riemann sums give the same answer?
No. At any finite the left, right, midpoint, and trapezoidal sums usually give four different numbers, because each reads its strip heights from a different place. They agree only in the limit as , where all four converge to the exact integral . The exception is a straight-line , where the midpoint and trapezoidal sums are already exact at every while the left and right sums still miss.
Why does the estimate get closer to the exact value as I increase n?
More subintervals means each strip is narrower, so its flat or slanted top has less room to drift from the curve. The total missed-or-extra area is the sum of those small gaps, and it shrinks as the strips shrink. In the limit as the subinterval widths approach , the Riemann sum equals the definite integral , which is the definition of the integral (LIM-5.C.1).
How does the calculator get the exact value it compares against?
It evaluates the integral independently of your Riemann sum. For standard functions it uses an antiderivative and the Fundamental Theorem, , and for functions with no elementary antiderivative it falls back to a high-accuracy numerical routine that uses far more subintervals than you would by hand. The error it reports is the distance between that reference value and your estimate.
Are Riemann sums on the AP Calculus exam?
Yes, in both AB and BC. They live in Topics 6.2 and 6.3, and they show up as multiple-choice questions and, very often, as a free-response part where a table of measured values asks for a left, right, midpoint, or trapezoidal approximation of an integral. Reading values off a graph or table and building the sum by hand is the tested skill, so practice the setup, not just the answer.