Riemann Sums and the Trapezoidal Rule
Practise this section (12)A car's computer doesn't record your speed at every instant. It logs a reading every few seconds, and yet the trip summary still tells you how far you drove. How can a handful of speeds give a distance? The answer is the idea behind this whole page: chop the interval into pieces, estimate each piece, and add.
Riemann sums: left and right
The definite integral $\int_a^b f(x)\,dx$ is the (net) area between the graph of $f$ and the $x$-axis. When you can't find an antiderivative, or all you have is a table, you approximate that area with rectangles.
Split $[a, b]$ into $n$ subintervals of equal width
$$\Delta x = \frac{b-a}{n}, \qquad x_0 = a,\; x_1 = a+\Delta x,\; \dots,\; x_n = b.$$Each subinterval gets one rectangle of width $\Delta x$. Its height is the value of $f$ at one chosen point of the subinterval:
Why does this work? Each rectangle has area (height) $\times$ (width), and the height is a stand-in for "about how tall $f$ is on that piece." The narrower the pieces, the better the stand-in.
Left sum with n = 3 and Δx = 2 on [0, 6]: each rectangle takes the height of f at its left endpoint (f(0) = 2, f(2) = 5, f(4) = 7). Since f is increasing, all rectangles lie under the curve and the sum underestimates the area.Here the rectangle heights are $f(0)=2$, $f(2)=5$, $f(4)=7$. Notice that every rectangle sits under the curve, so this left sum is too small. We'll come back to that.
Often the problem hands you a table instead of a formula. Then you can only use the $x$-values that are in the table, and the table decides your subintervals.
Use this table in the next example:
| $x$ | 0 | 2 | 4 | 6 |
|---|---|---|---|---|
| $f(x)$ | 2 | 5 | 7 | 8 |
The function $f$ is continuous on $[0, 8]$ and some of its values are given in the table. | $x$ | 0 | 2 | 4 | 6 | 8 | |---|---|---|---|---|---| | $f(x)$ | 3 | 5 | 6 | 4…
The function $f$ is continuous on $[0, 8]$ and some of its values are given in the table.
| $x$ | 0 | 2 | 4 | 6 | 8 |
|---|---|---|---|---|---|
| $f(x)$ | 3 | 5 | 6 | 4 | 2 |
Use a left Riemann sum with 4 subintervals of equal width to approximate $\int_0^8 f(x)\,dx$. Show the sum you write before you simplify it.
The function $g$ is continuous on $[1, 5]$ and some of its values are given in the table. | $x$ | 1 | 2 | 3 | 4 | 5 | |---|---|---|---|---|---| | $g(x)$ | 2 | 4 | 7 | 11…
The function $g$ is continuous on $[1, 5]$ and some of its values are given in the table.
| $x$ | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| $g(x)$ | 2 | 4 | 7 | 11 | 16 |
Use a right Riemann sum with 4 subintervals of equal width to approximate $\int_1^5 g(x)\,dx$.
Midpoint and trapezoidal sums
Left and right rectangles each lean to one side. Two better ideas are available.
Midpoint sum. Use the value of $f$ at the middle of each subinterval:
$$M_n = \Delta x\,\big[f(m_1)+f(m_2)+\cdots+f(m_n)\big], \qquad m_i = \text{midpoint of the } i\text{th subinterval}.$$The error on the left half of a rectangle tends to cancel the error on the right half.
Trapezoidal sum. Replace each rectangle by a trapezoid whose top joins the two endpoint values. A trapezoid with parallel sides $h_1, h_2$ and width $w$ has area $\tfrac12(h_1+h_2)\,w$. So
$$T_n = \sum \tfrac12\big[f(x_{i-1}) + f(x_i)\big]\,\Delta x_i .$$With equal widths this simplifies to
$$T_n = \frac{\Delta x}{2}\Big[f(x_0) + 2f(x_1) + \cdots + 2f(x_{n-1}) + f(x_n)\Big] = \tfrac12\,(L_n + R_n).$$The big advantage of trapezoids: they work when the table's $x$-values are not evenly spaced. Just use each subinterval's own width $\Delta x_i$. Say a food truck records how fast customers are arriving:
| $t$ (hours) | 0 | 1 | 3 | 6 |
|---|---|---|---|---|
| $C(t)$ (customers/hour) | 20 | 30 | 24 | 12 |
A midpoint sum is possible only when the midpoints are in your table. Take this table with equal spacing:
| $x$ | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| $g(x)$ | 2 | 3 | 5 | 7 | 6 |
With 4 subintervals the midpoints would be $0.5, 1.5, \dots$, which are not in the table. With 2 subintervals, $[0,2]$ and $[2,4]$, the midpoints are $x=1$ and $x=3$, which are in the table.
The function $f$ is continuous on $[0, 6]$ and some of its values are given in the table. | $x$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | |---|---|---|---|---|---|---|---| | $f(x)$…
The function $f$ is continuous on $[0, 6]$ and some of its values are given in the table.
| $x$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| $f(x)$ | 4 | 5 | 7 | 8 | 8 | 6 | 3 |
Use a midpoint Riemann sum with 3 subintervals of equal width to approximate $\int_0^6 f(x)\,dx$. State which values of $x$ you used.
Water flows into a tank at a rate $R(t)$, in gallons per minute, where $t$ is measured in minutes. The rate is measured at unevenly spaced times. | $t$ (min) | 0 | 1 | 3…
Water flows into a tank at a rate $R(t)$, in gallons per minute, where $t$ is measured in minutes. The rate is measured at unevenly spaced times.
| $t$ (min) | 0 | 1 | 3 | 7 | 10 |
|---|---|---|---|---|---|
| $R(t)$ (gal/min) | 12 | 10 | 9 | 5 | 4 |
Use a trapezoidal sum with the four subintervals given by the table to approximate $\int_0^{10} R(t)\,dt$. Then explain, with units, what this integral represents in the context of the problem.
Overestimate or underestimate?
An approximation is only useful if you know which way it errs. The rule comes from looking at a typical subinterval.
Left and right sums depend on increasing or decreasing. Look at a decreasing function:
Two panels for a decreasing, concave-up curve: left rectangles stick out above the curve (overestimate) and right rectangles sit under it (underestimate).On each subinterval of a decreasing function, the highest value is at the left end. A left rectangle uses that highest value, so it sticks out above the curve. The right rectangle uses the lowest value, so it fits under the curve.
| $f$ increasing | $f$ decreasing | |
|---|---|---|
| Left sum $L_n$ | underestimate | overestimate |
| Right sum $R_n$ | overestimate | underestimate |
Trapezoidal and midpoint sums depend on concavity.
-
A trapezoid's top is a chord of the curve. If $f$ is concave up, the curve dips below its chords, so the trapezoids contain extra area: $T$ is an overestimate. If $f$ is concave down, the curve is above its chords: $T$ is an underestimate.
-
A midpoint rectangle has the same area as the trapezoid under the tangent line at the midpoint (the tangent's rise on one half cancels its drop on the other). If $f$ is concave up, the tangent line lies below the curve, so $M$ is an underestimate. If $f$ is concave down, $M$ is an overestimate.
| concave up ($f''>0$) | concave down ($f''<0$) | |
|---|---|---|
| Trapezoidal $T_n$ | overestimate | underestimate |
| Midpoint $M_n$ | underestimate | overestimate |
The function $f$ is continuous and decreasing on $[a, b]$. Let $L_n$ and $R_n$ be the left and right Riemann sums with $n$ subintervals of equal width for…
The function $f$ is continuous and decreasing on $[a, b]$. Let $L_n$ and $R_n$ be the left and right Riemann sums with $n$ subintervals of equal width for $\int_a^b f(x)\,dx$. Does $L_n$ overestimate or underestimate the integral? What about $R_n$? Explain using the height of the rectangles on a typical subinterval.
The function $f$ is differentiable on $[0, 4]$. It is decreasing and concave up on the whole interval. Let $L_4$, $R_4$, $M_4$ and $T_4$ be the left, right, midpoint and…
The function $f$ is differentiable on $[0, 4]$. It is decreasing and concave up on the whole interval. Let $L_4$, $R_4$, $M_4$ and $T_4$ be the left, right, midpoint and trapezoidal sums with 4 subintervals of equal width for $\int_0^4 f(x)\,dx$. For each of the four sums, decide whether it is an overestimate or an underestimate of the integral. Justify each answer.
The function $f$ is twice differentiable on $[1, 9]$ with $f'(x)>0$ and $f''(x)<0$ for all $x$ in the interval. Let $L$, $T$, $M$ be the left, trapezoidal and midpoint…
The function $f$ is twice differentiable on $[1, 9]$ with $f'(x)>0$ and $f''(x)<0$ for all $x$ in the interval. Let $L$, $T$, $M$ be the left, trapezoidal and midpoint sums with 4 subintervals of equal width, and let $I=\int_1^9 f(x)\,dx$. Prove that $L<T<I<M$. In your argument, use the fact that $T=\tfrac{1}{2}(L+R)$, where $R$ is the right sum.
From a limit of sums to an integral
As $n$ grows, the rectangles get thinner and the approximation gets better. The definite integral is exactly what the sums approach:
This is a right sum, because it uses $x_i$ for $i = 1, \dots, n$. The matching left sum uses $i = 0, \dots, n-1$:
$$L_n = \sum_{i=0}^{n-1} f(a + i\,\Delta x)\,\Delta x \qquad R_n = \sum_{i=1}^{n} f(a + i\,\Delta x)\,\Delta x.$$ The interval [a, b] divided into n = 4 equal subintervals of width Δx = (b − a)/n, with endpoints x₀ = a, x₁, x₂, x₃ and x₄ = b. The left sum uses x₀…x₃ and the right sum uses x₁…x₄.To go the other way, from a limit of a sum to an integral, read off three things:
-
The factor at the end, $\dfrac{k}{n}$, is $\Delta x$. So $b - a = k$.
-
The part of the argument without $i$ is $a$ (the value when $i = 0$).
-
Then $b = a + k$, and $f(x)$ is the expression with $a + \dfrac{ki}{n}$ replaced by $x$.
Consider the limit $$\lim_{n\to\infty}\sum_{i=1}^{n}\left(3+\frac{2i}{n}\right)^2\cdot\frac{2}{n}.$$ Identify the width of each subinterval, the interval $[a, b]$ and…
Consider the limit
$$\lim_{n\to\infty}\sum_{i=1}^{n}\left(3+\frac{2i}{n}\right)^2\cdot\frac{2}{n}.$$Identify the width of each subinterval, the interval $[a, b]$ and the function $f$, and write the limit as a definite integral.
Consider the limit $$\lim_{n\to\infty}\sum_{i=1}^{n}\ln\!\left(2+\frac{3i}{n}\right)\cdot\frac{3}{n}.$$ (a) Write the limit as a definite integral whose lower limit is…
Consider the limit
$$\lim_{n\to\infty}\sum_{i=1}^{n}\ln\!\left(2+\frac{3i}{n}\right)\cdot\frac{3}{n}.$$(a) Write the limit as a definite integral whose lower limit is $2$.
(b) Write the same limit as a different definite integral whose lower limit is $0$.
(a) Show that $$\lim_{n\to\infty}\sum_{i=1}^{n}\sqrt{4-\left(-2+\frac{4i}{n}\right)^2}\cdot\frac{4}{n}$$ is a right Riemann sum limit for a definite integral, and write…
(a) Show that
$$\lim_{n\to\infty}\sum_{i=1}^{n}\sqrt{4-\left(-2+\frac{4i}{n}\right)^2}\cdot\frac{4}{n}$$is a right Riemann sum limit for a definite integral, and write that integral.
(b) Evaluate the integral using a geometric argument. Describe the region you used and its area.
(c) Write the left Riemann sum with $n$ subintervals for the same integral in sigma notation.
Accumulation in context
Why do we care about these area approximations? Because the integral of a rate is the amount accumulated.
Each rectangle or trapezoid is a small piece of the total: rate $\times$ time elapsed, which is the amount added during that stretch. For velocity, that piece is the distance covered. So $\int_a^b v(t)\,dt$ is the net change in position (displacement) from time $a$ to time $b$.
Graph of R(t) in gal/hr, a drain rate that decreases with time t (hr). The shaded area under the curve is the accumulated amount: the gallons drained, ∫R(t) dt.How to interpret an integral on the AP exam. A complete sentence names the quantity, the time interval, and the units: "$\int_0^{10} R(t)\,dt$ is the total number of gallons of water that flow into the tank from $t = 0$ to $t = 10$ minutes." Use "approximately" when the number came from a sum.
Back to the start: the car's computer multiplies the speed on each stretch by the time elapsed on that stretch and adds up the pieces. That is exactly a Riemann or trapezoidal sum, and its answer is in feet.
Water drains from a swimming pool at a rate $R(t)$, in gallons per hour. The function $R$ is differentiable and decreasing, and $t$ is measured in hours. | $t$ (hours) |…
Water drains from a swimming pool at a rate $R(t)$, in gallons per hour. The function $R$ is differentiable and decreasing, and $t$ is measured in hours.
| $t$ (hours) | 0 | 2 | 5 | 9 | 12 |
|---|---|---|---|---|---|
| $R(t)$ (gal/hr) | 40 | 34 | 25 | 13 | 8 |
(a) Use a trapezoidal sum with the four subintervals given by the table to approximate $\int_0^{12} R(t)\,dt$. Include units.
(b) Use a right Riemann sum with the same four subintervals to approximate the same integral. Does it overestimate or underestimate the true value? Justify.
(c) The pool held $900$ gallons at $t=0$. Using your answer to (a), estimate how many gallons it held at $t=12$, and explain what the integral means in this calculation.
A car moves along a straight road with velocity $v(t)$, in feet per second, where $t$ is in seconds. Values of $v$ are recorded at unevenly spaced times. | $t$ (s) | 0 |…
A car moves along a straight road with velocity $v(t)$, in feet per second, where $t$ is in seconds. Values of $v$ are recorded at unevenly spaced times.
| $t$ (s) | 0 | 3 | 5 | 8 | 12 |
|---|---|---|---|---|---|
| $v(t)$ (ft/s) | 2 | 6 | 9 | 7 | 3 |
(a) Compute the left sum, the right sum and the trapezoidal sum for $\int_0^{12} v(t)\,dt$ using the four subintervals given.
(b) Interpret the integral, with units.
(c) Suppose $v$ is increasing on $[0, 5]$ and decreasing on $[5, 12]$. For each of the two pieces $[0, 5]$ and $[5, 12]$, decide whether the left sum on that piece overestimates or underestimates the integral over it. Can you decide the question for the whole interval $[0, 12]$ from this information alone? Explain.
Summary
Can't find your problem here?
The AI checks one of your exercises: paste the problem with your answer or take a photo of it.