Step 20: Riemann Sums and the Definite Integral
- The area under a rate graph is the total change in the quantity. Rate times time gives an amount, so the units of the area are (units of \( y \)) \( \times \) (units of \( x \)). Area below the axis counts as negative.
- When the graph is curved, estimate the area with strips: left, right or midpoint rectangles, or trapezia. The trapezoidal sum is the average of the left and right sums.
- The definite integral \( \int_a^b f(x)\,dx \) is the exact value these sums approach as the strips become infinitely thin: \( \displaystyle\lim_{n \to \infty} \sum_{i=1}^{n} f(x_i)\,\Delta x \).
- Exam point: AP tables often have unequal gaps. Work strip by strip (width \( \times \) height, or width \( \times \) average height), show every product, and finish with units and a sentence of meaning.
The area under a rate graph is total change
Everything in Units 2 to 5 started from a quantity and asked how fast it was changing. Integration runs the other way. You know the rate, such as the speed of a car, the flow of water into a tank or the revenue a shop earns per hour, and you want the total amount that has built up.
Start with a steady rate. Rain fills a tank at 6 litres per minute for 10 minutes, so 60 litres go in. On a graph of rate against time, that product is the area of a rectangle 10 wide and 6 high. The units agree: litres per minute times minutes gives litres. When the rate varies, the rectangle becomes a region under a curve, but the idea survives. Over a very short time the rate hardly changes, so each thin sliver of area is still rate \( \times \) time, and the slivers add up to the total.
A negative rate means the quantity is falling: a velocity of \( -3 \) m/s means moving backwards. So area below the axis subtracts from the total. This is the difference between displacement (where you end up, relative to the start) and distance (every metre travelled, in either direction).
A particle moves along a line. Its velocity \( v \) m/s for \( 0 \le t \le 8 \) seconds is made of straight pieces joining \( (0, 0) \), \( (1, 4) \), \( (4, 4) \), \( (6, 0) \) and \( (8, -4) \), as in Figure 1. Find its displacement and the total distance it travels.
The particle finishes 14 m ahead of where it started, but it has covered 22 m, because it went 4 m backwards at the end.
Rectangles and trapezia: four Riemann sums
Curved graphs have no simple shape to measure, so you approximate the region with shapes you can measure. Cut the interval \( [a, b] \) into \( n \) strips of equal width \( \Delta x = \dfrac{b-a}{n} \), with dividing points \( x_0 = a, x_1, \ldots, x_n = b \). Each strip then needs a height.
| Method | Height of each strip | Formula |
|---|---|---|
| Left sum \( L_n \) | value at the left end | \( \Delta x\,[f(x_0) + f(x_1) + \cdots + f(x_{n-1})] \) |
| Right sum \( R_n \) | value at the right end | \( \Delta x\,[f(x_1) + f(x_2) + \cdots + f(x_n)] \) |
| Midpoint sum \( M_n \) | value at the middle of the strip | \( \Delta x\,[f(m_1) + \cdots + f(m_n)] \) |
| Trapezoidal sum \( T_n \) | average of the two ends | \( \tfrac12\Delta x\,[f(x_0) + 2f(x_1) + \cdots + 2f(x_{n-1}) + f(x_n)] \) |
In the trapezoidal sum every inside height belongs to two neighbouring trapezia, so it is counted twice, while the two end heights are counted once. Each trapezium is the average of the left and right rectangles on its strip, so \( T_n = \tfrac12(L_n + R_n) \).
Estimate \( \int_0^3 (9-x^2)\,dx \) with three strips of width 1, using (a) a left sum, (b) a right sum, (c) a midpoint sum and (d) the trapezoidal rule.
The exact value, found in the next step, is 18. The left and midpoint sums are too big; the right and trapezoidal sums are too small. The next table explains why, without needing the exact answer.
You can usually tell which way an estimate is wrong just from the shape of the graph.
| If \( f \) on \( [a, b] \) is | Overestimate | Underestimate |
|---|---|---|
| increasing | right sum | left sum |
| decreasing | left sum | right sum |
| concave up | trapezoidal sum | midpoint sum |
| concave down | midpoint sum | trapezoidal sum |
The reasons are pictures. If \( f \) is decreasing, the left end of each strip is its highest point, so left rectangles stick out above the curve (Figure 2). The top of a trapezium is a chord, and a concave down curve bulges above its chords, so trapezia miss a sliver of area. The midpoint rectangle has the same area as the trapezium under the tangent at the midpoint, and a concave down curve lies below its tangents, so the midpoint sum is slightly too big. For \( 9-x^2 \), which is decreasing and concave down on \( [0, 3] \), all four predictions match the numbers above.
An economics example: revenue from a sales log. Data rarely arrive at equal intervals. A café records the rate \( R(t) \) at which it takes money, in dollars per hour, \( t \) hours after opening.
| \( t \) (hours) | 0 | 1 | 3 | 4 | 7 |
|---|---|---|---|---|---|
| \( R(t) \) ($ per hour) | 30 | 48 | 66 | 60 | 42 |
Total revenue over the seven hours is \( \int_0^7 R(t)\,dt \) dollars. The strip widths are 1, 2, 1 and 3, so no single formula applies; take each strip on its own. A trapezoidal sum gives
So the café takes about $369 in its first seven hours. The left sum is \( 1(30) + 2(48) + 1(66) + 3(60) = 372 \) and the right sum is \( 1(48) + 2(66) + 1(60) + 3(42) = 366 \); their average is again 369. Because the rate rises and then falls, neither is guaranteed to be too big or too small.
The definite integral as a limit of sums
More strips give better estimates. The exact area is the value the estimates close in on as the strips become infinitely thin. To say this precisely you need sigma notation: \( \sum_{i=1}^{n} a_i \) means “add up \( a_i \) for \( i = 1 \) to \( n \)”, so for example \( \sum_{i=1}^{4} 3i = 3 + 6 + 9 + 12 = 30 \).
For simple functions you can actually take this limit. For \( \int_0^3 (9-x^2)\,dx \), the right sum uses \( \Delta x = \tfrac3n \) and \( x_i = \tfrac{3i}{n} \). With the standard result \( \sum_{i=1}^{n} i^2 = \tfrac16 n(n+1)(2n+1) \),
Check: \( n = 3 \) gives \( 27-\tfrac92 \cdot \tfrac43 \cdot \tfrac73 = 13 \), the right sum found earlier. With \( n = 12 \) it is about 16.84 and with \( n = 100 \) about 17.86. As \( n \to \infty \) both brackets tend to 1 and 2, so \( R_n \to 27-9 = 18 \). The exact area is 18.
AP multiple-choice questions (topic 6.3) usually run this backwards: you are given the limit of a sum and asked which integral it is. Read off three things: the width \( \Delta x \), which gives \( b-a \); the expression for \( x_i \), which gives the starting point \( a \); and what the function does to \( x_i \).
Write \( \displaystyle\lim_{n \to \infty} \sum_{i=1}^{n} \sqrt{2 + \frac{5i}{n}}\cdot\frac{5}{n} \) as a definite integral.
The limit is \( \displaystyle\int_2^7 \sqrt{x}\,dx \). Reading the points as \( x_i = \tfrac{5i}{n} \) and the function as \( \sqrt{2 + x} \) gives the equally correct \( \int_0^5 \sqrt{2 + x}\,dx \): the same area slid 2 units to the left.
Properties of definite integrals
A definite integral is a signed area, so a handful of rules follow straight from pictures. They are tested constantly, often with no formula for \( f \) at all.
| Property | Rule |
|---|---|
| Zero width | \( \int_a^a f(x)\,dx = 0 \) |
| Reversing the limits | \( \int_b^a f(x)\,dx = -\int_a^b f(x)\,dx \) |
| Joining intervals | \( \int_a^c f(x)\,dx + \int_c^b f(x)\,dx = \int_a^b f(x)\,dx \) |
| Linearity | \( \int_a^b [k f(x) \pm g(x)]\,dx = k\int_a^b f(x)\,dx \pm \int_a^b g(x)\,dx \) |
| Constant | \( \int_a^b c\,dx = c(b-a) \), a rectangle |
Reversing the limits makes every \( \Delta x \) negative, so every term of the Riemann sum changes sign. Linearity holds for every Riemann sum, so it holds for their limit.
Given \( \int_0^5 f(x)\,dx = 8 \), \( \int_3^5 f(x)\,dx = -2 \) and \( \int_0^3 g(x)\,dx = 4 \), find (a) \( \int_0^3 f(x)\,dx \), (b) \( \int_5^3 f(x)\,dx \) and (c) \( \int_0^3 [3f(x)-2g(x) + 1]\,dx \).
Part (c) is where marks are lost: the \( +1 \) contributes \( 1 \times 3 = 3 \), not 1.
Geometry evaluates some integrals with no calculus at all. The graph of \( y = \sqrt{9-x^2} \) is the top half of the circle \( x^2 + y^2 = 9 \), so \( \int_{-3}^{3} \sqrt{9-x^2}\,dx = \tfrac12\pi(3)^2 = \tfrac{9\pi}{2} \). The graph of \( y = |x-2| \) on \( [0, 6] \) is two triangles, so \( \int_0^6 |x-2|\,dx = 2 + 8 = 10 \). And for an odd function such as \( x^5 \), the areas either side of 0 cancel exactly: \( \int_{-2}^{2} x^5\,dx = 0 \).
The same thinking gives a first look at consumer surplus. If demand is \( P = 60-2Q \) and the price is $20, then 20 units are bought, and buyers gain the gap between what they would have paid and what they did pay. That gain is the area between the demand line and the price line, \( \int_0^{20} (40-2Q)\,dQ \), a triangle of area \( \tfrac12(20)(40) = \$400 \). Step 22 handles curved demand curves.
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. A tap fills a bath at 8 litres per minute for 3 minutes, then at 5 litres per minute for 4 minutes. Sketch the rate graph and find the total volume of water. Show worked answer
Areas: \( 8 \times 3 = 24 \) and \( 5 \times 4 = 20 \).
Total volume \( = 24 + 20 = 44 \) litres (litres per minute \( \times \) minutes).
EasyQ2. For \( \int_0^2 (x^2 + 1)\,dx \) with two strips of width 1, find the left sum, the right sum and the trapezoidal sum. Show worked answer
Left sum: \( 1(1) + 1(2) = 3 \).
Right sum: \( 1(2) + 1(5) = 7 \).
Trapezoidal sum: \( \tfrac12(1)[1 + 2(2) + 5] = 5 \), the average of 3 and 7.
(The exact value is \( \tfrac{14}{3} \approx 4.67 \): the curve is increasing and concave up, so left is under and right and trapezoidal are over.)
MediumQ3. Use the trapezium rule with 4 intervals to estimate \( \int_0^4 2^x\,dx \). State, with a reason, whether your answer is an overestimate or an underestimate. Show worked answer
Estimate \( = \tfrac12(1)[1 + 16 + 2(2 + 4 + 8)] = \tfrac12(45) = 22.5 \).
\( y = 2^x \) has second derivative \( (\ln 2)^2\,2^x > 0 \), so the curve is concave up and lies below every chord.
So 22.5 is an overestimate. (The exact value is \( \tfrac{15}{\ln 2} \approx 21.64 \).)
MediumQ4. Write \( \displaystyle\lim_{n \to \infty} \sum_{i=1}^{n} \left(1 + \frac{3i}{n}\right)^3 \frac{3}{n} \) as a definite integral with lower limit 1. Show worked answer
Points \( x_i = 1 + \tfrac{3i}{n} \) run from 1 (at \( i = 0 \)) to 4 (at \( i = n \)).
The function cubes \( x_i \).
So the limit is \( \displaystyle\int_1^4 x^3\,dx \). (Equivalently \( \int_0^3 (1 + x)^3\,dx \).)
MediumQ5. Given \( \int_{-2}^{4} f(x)\,dx = 10 \) and \( \int_{-2}^{1} f(x)\,dx = 3 \), find (a) \( \int_4^1 f(x)\,dx \) and (b) \( \int_1^4 [2f(x) + 3]\,dx \). Show worked answer
(a) Reverse the limits: \( \int_4^1 f(x)\,dx = -7 \).
(b) \( 2(7) + 3 \times (4-1) = 14 + 9 = 23 \).
ExamQ6. Water flows into a reservoir at a rate \( R(t) \) cubic metres per hour, where \( R \) is differentiable. Selected values are shown.
\( t \) (hours): 0, 2, 5, 6, 10
\( R(t) \) (m³/h): 12, 18, 22, 20, 14
(a) Use a trapezoidal sum with the four subintervals in the table to approximate \( \int_0^{10} R(t)\,dt \). [2] (b) Interpret the meaning of \( \int_0^{10} R(t)\,dt \) in context, with units. [1] (c) Use a left Riemann sum with the two subintervals in the table to approximate \( \int_0^5 R(t)\,dt \). Given that \( R \) is increasing on \( 0 \le t \le 5 \), is this an overestimate or an underestimate? Give a reason. [3] Show worked answer
\( = 30 + 60 + 21 + 68 = 179 \) m³. [A1]
(b) \( \int_0^{10} R(t)\,dt \) is the total volume of water, in cubic metres, that flows into the reservoir over the 10 hours from \( t = 0 \) to \( t = 10 \). [B1]
(c) \( 2(12) + 3(18) = 24 + 54 = 78 \) m³. [M1 A1]
Underestimate: \( R \) is increasing on \( [0, 5] \), so on each subinterval the left endpoint gives the smallest value of \( R \), and each rectangle lies below the graph. [B1]
Total: 6 marks.
Check yourself
1. \( f \) is increasing and concave down on \( [a, b] \). Which of these must overestimate \( \int_a^b f(x)\,dx \)?
2. If \( \int_1^5 f(x)\,dx = 6 \) and \( \int_1^3 f(x)\,dx = 10 \), what is \( \int_3^5 f(x)\,dx \)?
3. Which integral equals \( \displaystyle\lim_{n \to \infty} \sum_{i=1}^{n} \left(3 + \frac{2i}{n}\right)^2 \frac{2}{n} \)?
Your score: 0 out of 3
The short version
- The area under a rate graph is the total (net) change; area below the axis counts as negative. Displacement is \( \int v\,dt \); distance is \( \int |v|\,dt \).
- Left, right and midpoint sums use rectangles; the trapezoidal sum is \( \tfrac12(L_n + R_n) \). Increasing: left under, right over. Concave up: trapezoidal over, midpoint under (reverse both for decreasing or concave down).
- With unequal widths, work strip by strip and give units.
- \( \int_a^b f(x)\,dx = \lim_{n \to \infty} \sum f(x_i)\,\Delta x \). To read a limit of a sum as an integral, find \( \Delta x \), the starting point and the function.
- Reversing the limits changes the sign; integrals over joining intervals add; constants and sums come out of the integral.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
