Skip to main content
CalculusABCs
UNIT 6 · AB & BC

Riemann Sums.

Approximate the area under a curve. Then take the limit.

Unit 6 · AB & BC

Riemann Sums

Approximate the area under a curve using rectangles, then sharpen the approximation until the error vanishes. The limit of a Riemann sum is the definite integral.

CalculusABCs · AP® Calculus Review
6.2

The Setup

A function $f$ on the interval $[a, b]$, partitioned into $n = 4$ equal subintervals. One rectangle is highlighted: width $\Delta x$, height set by the sample point on the curve.
Anatomy of one rectangle
The sample point sits on the curve. Whether it's the left endpoint, right endpoint, or midpoint of the subinterval just changes which point. The recipe stays the same.

You want the area bounded by a function $f$, the lines $x = a$ and $x = b$, and the $x$-axis. You don't have an antiderivative, or you have a table of values rather than a formula. So you approximate.

Partition $[a, b]$ into $n$ equal subintervals. Each subinterval supports one rectangle of width $\Delta x$ whose height comes from a sample point on the curve. Sum the rectangles.

Definition · Subinterval Width
$$\Delta x = \ rac{b - a}{n}$$

The endpoints of the subintervals are $a = x_0 < x_1 < x_2 < \cdots < x_n = b$, where $x_i = a + i\,\Delta x$.

Riemann Sum (general form)
$$A \approx \Delta x \cdot \ig[\, f(x_1^*) + f(x_2^*) + \cdots + f(x_n^*) \,\ig]$$

where $x_i^*$ is some sample point in the $i$-th subinterval.


6.2

A Worked Example

Water flows into a reservoir at rate $W(t)$ gallons per hour, with values measured at five times. The flow is continuous and always positive. Approximate the total volume of water added from $t = 0$ to $t = 12$ hours using a left Riemann sum.

Left Riemann sum on the inflow data. Each rectangle's height is the rate at the left end of its subinterval; its width is the time interval.
$t$ (hr)025912
$W(t)$ (gal/hr)411172214

Total volume equals the integral of the rate. With four subintervals $[0, 2], [2, 5], [5, 9], [9, 12]$ of widths $2, 3, 4, 3$, the left Riemann sum samples the rate at the left end of each:

$$\begin{aligned} V_L &\approx 2 \cdot W(0) + 3 \cdot W(2) + 4 \cdot W(5) + 3 \cdot W(9) \\[2pt] &= 2(4) + 3(11) + 4(17) + 3(22) \\[2pt] &= 8 + 33 + 68 + 66 \\[2pt] &= 175 \text{ gallons}. \end{aligned}$$

The subintervals don't have to be equal width. When a rate is given as a table, the Riemann sum is just a weighted addition. Notice that $W(12)$ never appears in a left sum, the last rectangle is built from $W(9)$.

On the Exam
When the data is in a table, the AP exam expects you to use the table's own intervals as $\Delta t$. Do not impose an equal partition.

6.2

The Four Methods

The four standard sample-point choices are: the left endpoint, the right endpoint, the midpoint, and the average of left and right (which gives a trapezoid instead of a rectangle). Each method tells a different lie about the same function.

Left Riemann Sum

Left Riemann sum on $f(x) = 1 + 0.18x + 0.045x^2$, $[a, b] = [0, 8]$, $n = 8$. Hover any rectangle to inspect its area.

Sample the height at the left endpoint of each subinterval. The first rectangle has height $f(x_0) = f(a)$, the second has height $f(x_1)$, and the last has height $f(x_{n-1})$.

Left Riemann Sum
$$A_L \approx \Delta x \cdot \big[\, f(x_0) + f(x_1) + \cdots + f(x_{n-1}) \,\big]$$

In sigma notation, $\displaystyle A_L \approx \sum_{i=0}^{n-1} f(x_i)\,\Delta x$.

Right Riemann Sum

Sample at the right endpoint instead. The first rectangle has height $f(x_1)$, the last has height $f(x_n) = f(b)$.

Right Riemann Sum
$$A_R \approx \Delta x \cdot \big[\, f(x_1) + f(x_2) + \cdots + f(x_n) \,\big]$$

In sigma notation, $\displaystyle A_R \approx \sum_{i=1}^{n} f(x_i)\,\Delta x$. The right sum is just the left sum with the endpoints shifted by one.

Right Riemann sum on the same partition. The bias flips: where the left sum lies low, the right sum lies high.

Midpoint Sum

Midpoint sum. Each rectangle's height is the function's value at the center of its subinterval.

Sample at the midpoint of each subinterval, $\bar{x}_i = (x_{i-1} + x_i)/2$.

Midpoint Sum
$$A_M \approx \Delta x \cdot \big[\, f(\bar{x}_1) + f(\bar{x}_2) + \cdots + f(\bar{x}_n) \,\big]$$

Or compactly: $\displaystyle A_M \approx \sum_{i=1}^{n} f\!\left(\tfrac{x_{i-1} + x_i}{2}\right) \Delta x$.

Trapezoidal Sum

Connect $f(x_{i-1})$ and $f(x_i)$ with a straight line segment. The shape between the segment and the $x$-axis is a trapezoid; its area is $\tfrac{1}{2} \Delta x \cdot \big[ f(x_{i-1}) + f(x_i) \big]$. Adding all $n$ of them telescopes:

Trapezoidal Sum
$$A_T = \frac{\Delta x}{2} \cdot \big[\, f(x_0) + 2 f(x_1) + 2 f(x_2) + \cdots + 2 f(x_{n-1}) + f(x_n) \,\big]$$

Equivalently, $A_T = \tfrac{1}{2}(A_L + A_R)$. The trapezoidal sum is the average of the left and right sums.

Trapezoidal sum. Same partition; each top is now tilted to meet the curve at both endpoints of the subinterval.

6.2

Over or Under

Whether each method overestimates or underestimates depends on the function's shape on each subinterval. The four methods divide cleanly: rectangles care about monotonicity; midpoint and trapezoid care about concavity. The irrelevant attribute is shown struck through in each scenario.

Left Riemann

increasing, concave up
decreasing, concave up
decreasing, concave down
increasing, concave down

For a strictly increasing function the left Riemann sum is an underestimate; for a strictly decreasing function it is an overestimate. Concavity is irrelevant.

Right Riemann

increasing, concave up
decreasing, concave up
decreasing, concave down
increasing, concave down

Mirror of the left sum. For a strictly increasing function the right Riemann sum is an overestimate; for a strictly decreasing function it is an underestimate.

Midpoint

increasing, concave up
decreasing, concave up
decreasing, concave down
increasing, concave down

The bias depends on concavity, not monotonicity. If $f$ is concave up, the midpoint sum is an underestimate; if concave down, an overestimate. Geometrically, the slivers above the rectangle (where the curve rises) outweigh the slivers below, or vice versa.

Trapezoidal

increasing, concave up
decreasing, concave up
decreasing, concave down
increasing, concave down

Mirror of the midpoint sum. If $f$ is concave up, the trapezoidal sum is an overestimate (the chord lies above the curve); if concave down, an underestimate (the chord lies below).

Summary

MethodIncreasingDecreasingConcave upConcave down
Left RiemannUnderOver
Right RiemannOverUnder
MidpointUnderOver
TrapezoidalOverUnder
Common Error
Applying a monotonicity rule to a midpoint or trapezoidal sum, or a concavity rule to a left or right sum. Match the rule to the method.

6.2

Going to the Limit

Every Riemann sum has an error: the curve passes above or below the rectangles by some amount. When $n$ grows, $\Delta x$ shrinks, and the rectangles cling closer to the curve. The error tends to zero.

We define the area under $f$ as the limit of the Riemann sum as $n \to \infty$. That limit is the definite integral.

Definite Integral
$$\int_a^b f(x)\,dx \;=\; \lim_{n \ o \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x$$

provided the limit exists and is independent of the choice of sample points $x_i^*$.

For a continuous function on $[a, b]$, all four methods (left, right, midpoint, trapezoidal) converge to the same value: the exact area. For our running example, $\displaystyle\int_0^8 (1 + 0.18x + 0.045x^2)\,dx = 21.44$ exactly.

All four Riemann sums on $f(x) = 1 + 0.18x + 0.045x^2$ over $[0, 8]$, plotted against $n$. Each method approaches the true area, $21.44$, as $n \to \infty$.

6.2

Try It Yourself

Pick a method. Pick a function shape. Slide $n$ from 2 to 100. Watch the approximation chase the true area and the signed error chase zero, and use the over/under shading to confirm the rules from the previous section.

Sample-point method
Function shape
f(x) = ·true area 21.440
8
Step size, Δx = (b−a)/n
1.0000
Approximation
0.000
True area
21.440
Signed error
+0.000
|error|
0.00%
Increasing, concave upEXACT
Switch shapes to confirm the rules: left/right care about monotonicity, midpoint/trapezoidal care about concavity. Toggle the shading to see over/under highlighted in the lesson colors.
CalculusABCs.com · AP® Calculus AB & BC Review
AP® and Advanced Placement® are registered trademarks of the College Board, which was not involved in the production of, and does not endorse, this material.