Unit 1, chapter 2

The Riemann-sum limit for a changing height

How Riemann sums over a regular partition estimate the area under a changing height, how left-endpoint and right-endpoint sums bracket it, and how their limit as the mesh width shrinks gives the integral.

  • Chapter 2
  • Area, Riemann sums, the fundamental theorem and linearity

Under the line y=xy = x from 00 to 11 the height changes at every point, so no single rectangle fits the region. A rectangle of height 11 covers the region and the empty space above the line, and a rectangle of height 00 misses the region entirely, which only shows that

0≤∫01x dx≤1.0 \le \int_0^1 x\,dx \le 1.

This page cuts the interval into nn equal strips, adds the areas of rectangles whose heights come from the ends of the strips, and takes the limit as the strips get thinner. The limit is exactly 12\tfrac12, and the same construction defines the integral when the graph is curved.

Key terms

Riemann sum

Definition Let ff be a function on [a,b][a, b] with a<ba < b. A partition of [a,b][a, b] is a finite list of points

a=x0<x1<⋯<xn=b,a = x_0 < x_1 < \dots < x_n = b,

which cuts [a,b][a, b] into the nn pieces [xk−1,xk][x_{k-1}, x_k] with widths Δxk=xk−xk−1\Delta x_k = x_k - x_{k-1}. Choose a sample point xk∗x_k^{*} in each piece [xk−1,xk][x_{k-1}, x_k]. The number

∑k=1nf(xk∗) Δxk\sum_{k=1}^{n} f(x_k^{*})\,\Delta x_k

is a Riemann sum of ff for this partition and these sample points.

In plain words Replace the region by a row of rectangles, each as wide as its piece and as tall as the graph at the chosen point, and add their areas. Where ff is negative the rectangle hangs below the axis and its term is negative, which matches the signed area that an integral measures.

Example For f(x)=xf(x) = x on [0,1][0, 1], take the partition 0<14<12<10 < \tfrac14 < \tfrac12 < 1 and the sample points 14\tfrac14, 12\tfrac12 and 34\tfrac34, one in each piece. The widths are 14\tfrac14, 14\tfrac14 and 12\tfrac12, so the Riemann sum is

14⋅14+12⋅14+34⋅12=116+216+616=916.\begin{aligned} &\tfrac14 \cdot \tfrac14 + \tfrac12 \cdot \tfrac14 + \tfrac34 \cdot \tfrac12 \\[0.4em] &\quad = \tfrac{1}{16} + \tfrac{2}{16} + \tfrac{6}{16} = \tfrac{9}{16}. \end{aligned}

This estimate, 0.56250.5625, is close to the area 12\tfrac12 of the triangle under the line but not equal to it.

Regular partition and mesh width

Definition The mesh width of a partition is the width of its widest piece,

max⁡1≤k≤nΔxk.\max_{1 \le k \le n} \Delta x_k.

A regular partition of [a,b][a, b] into nn pieces uses the equal width Δx=(b−a)/n\Delta x = (b - a)/n and the points xk=a+k Δxx_k = a + k\,\Delta x for k=0,1,…,nk = 0, 1, \dots, n. Its mesh width is Δx\Delta x itself, so for regular partitions the mesh width approaches 00 exactly when n→∞n \to \infty.

In plain words The mesh width measures how coarse a partition is at its coarsest place. Equal pieces are the simplest way to make every piece thin at once. With unequal pieces, adding more pieces does not by itself shrink the mesh width. A partition that keeps [0,12][0, \tfrac12] as one piece and cuts [12,1][\tfrac12, 1] into a thousand pieces still has mesh width 12\tfrac12.

Example The regular partition of [0,1][0, 1] into nn pieces has width Δx=1n\Delta x = \tfrac1n and points xk=knx_k = \tfrac{k}{n}. For n=4n = 4 the points are 00, 14\tfrac14, 12\tfrac12, 34\tfrac34 and 11, and the mesh width is 14\tfrac14. The partition 0<14<12<10 < \tfrac14 < \tfrac12 < 1 of the Riemann sum example has two pieces of width 14\tfrac14, but its mesh width is 12\tfrac12. In this notation nn counts the pieces, while kk labels one point or one piece.

Right-endpoint sum

Definition For the regular partition of [a,b][a, b] into nn pieces, the right-endpoint sum uses the right end xkx_k of each piece [xk−1,xk][x_{k-1}, x_k] as its sample point,

Rn=∑k=1nf(xk) Δx.R_n = \sum_{k=1}^{n} f(x_k)\,\Delta x.

If ff is nondecreasing on [a,b][a, b], each right end gives the largest height on its piece, so Rn≥∫abf(x) dxR_n \ge \int_a^b f(x)\,dx. If ff is nonincreasing, each right end gives the smallest height, so Rn≤∫abf(x) dxR_n \le \int_a^b f(x)\,dx.

In plain words Each rectangle touches the graph at its upper right corner. On a rising graph the rest of its top sits on or above the graph, so the right-endpoint rectangles cover the region and overestimate its area.

Example For the integral ∫01x dx\int_0^1 x\,dx, use nn equal strips and right endpoints, so the mesh width is 1n\tfrac1n. The kkth strip has height f(kn)=knf(\tfrac{k}{n}) = \tfrac{k}{n} and width 1n\tfrac1n, so

Rn=∑k=1nkn⋅1n=1n2 (1+2+⋯+n).\begin{aligned} R_n &= \sum_{k=1}^{n} \frac{k}{n} \cdot \frac{1}{n} \\[0.4em] &= \frac{1}{n^2}\,(1 + 2 + \dots + n). \end{aligned}

Write 1+2+⋯+n1 + 2 + \dots + n once forward and once backward, one row above the other. Each of the nn columns adds to n+1n + 1, so twice the sum is n(n+1)n(n + 1), for odd nn as well as even nn. Hence

Rn=n(n+1)2n2=12+12n.\begin{aligned} R_n &= \frac{n(n + 1)}{2n^2} \\[0.4em] &= \frac12 + \frac{1}{2n}. \end{aligned}

The term 12n\tfrac{1}{2n} is the total overshoot. Each rectangle sticks out above the line by a small triangle with both legs 1n\tfrac1n, of area 12n2\tfrac{1}{2n^2}, and there are nn of them.

Left-endpoint sum

Definition For the same regular partition, the left-endpoint sum uses the left end xk−1x_{k-1} of each piece [xk−1,xk][x_{k-1}, x_k],

Ln=∑k=1nf(xk−1) Δx.L_n = \sum_{k=1}^{n} f(x_{k-1})\,\Delta x.

For every ff the two endpoint sums share every height except f(a)f(a), which only LnL_n uses, and f(b)f(b), which only RnR_n uses, so Rn−Ln=(f(b)−f(a)) ΔxR_n - L_n = \bigl(f(b) - f(a)\bigr)\,\Delta x. Every monotone function on [a,b][a, b] is integrable, and if ff is nondecreasing on [a,b][a, b], then

Ln≤∫abf(x) dx≤Rn.L_n \le \int_a^b f(x)\,dx \le R_n.

If ff is nonincreasing on [a,b][a, b], both inequalities reverse.

In plain words Each rectangle touches the graph at its upper left corner. On a rising graph the left rectangles fit under the graph and the right rectangles cover it, so the true area is trapped between the two sums, in a gap proportional to the strip width.

Example For f(x)=xf(x) = x on [0,1][0, 1], the left heights are 0,1n,…,n−1n0, \tfrac1n, \dots, \tfrac{n-1}{n}, so

Ln=0+1+⋯+(n−1)n2=(n−1) n2n2=12−12n.\begin{aligned} L_n &= \frac{0 + 1 + \dots + (n - 1)}{n^2} \\[0.4em] &= \frac{(n - 1)\,n}{2n^2} \\[0.4em] &= \frac12 - \frac{1}{2n}. \end{aligned}

Because f(x)=xf(x) = x is increasing, Ln≤12≤RnL_n \le \tfrac12 \le R_n, and the gap is Rn−Ln=1nR_n - L_n = \tfrac1n, which is (f(1)−f(0))⋅1n\bigl(f(1) - f(0)\bigr) \cdot \tfrac1n. For n=4n = 4 the bracket is 38≤12≤58\tfrac38 \le \tfrac12 \le \tfrac58.

Limit of Riemann sums

Definition Let ff be a function on [a,b][a, b] with a<ba < b. The Riemann sums of ff converge to a number II as the mesh width approaches 00 if for every ε>0\varepsilon > 0 there is a δ>0\delta > 0 such that

∣∑k=1nf(xk∗) Δxk−I∣<ε\Bigl\lvert \sum_{k=1}^{n} f(x_k^{*})\,\Delta x_k - I \Bigr\rvert < \varepsilon

for every partition with mesh width less than δ\delta and every choice of sample points. Then ff is integrable on [a,b][a, b] and ∫abf(x) dx=I\int_a^b f(x)\,dx = I. Every continuous function on [a,b][a, b] is integrable. For an integrable ff, the sums of regular partitions approach the integral as n→∞n \to \infty with any sample points, and in particular

∫abf(x) dx=lim⁡n→∞Rn=lim⁡n→∞Ln.\begin{aligned} \int_a^b f(x)\,dx &= \lim_{n \to \infty} R_n \\[0.4em] &= \lim_{n \to \infty} L_n. \end{aligned}

Convergent endpoint sums alone do not prove that a function is integrable. On [0,1][0, 1], the function equal to 11 at rational numbers and 00 at irrational numbers has Ln=Rn=1L_n = R_n = 1 for every nn, because every point kn\tfrac{k}{n} is rational, yet sample points chosen irrational give sums equal to 00, so the function is not integrable.

In plain words The integral is the number the rectangle sums settle on as every strip becomes thin, whichever heights inside the strips are used. No sum with finitely many strips has to equal it, and no strip of width zero is ever drawn. The dxdx of the integral takes the place of the positive widths Δx\Delta x of the sums.

Example The function f(x)=xf(x) = x is continuous on [0,1][0, 1], so it is integrable, and the regular partitions with right endpoints have mesh width 1n\tfrac1n, which approaches 00. The right-endpoint sums R4=0.625R_4 = 0.625, R10=0.55R_{10} = 0.55 and R100=0.505R_{100} = 0.505 are each above 12\tfrac12 by 12n\tfrac{1}{2n}. Since 12n→0\tfrac{1}{2n} \to 0,

∫01x dx=lim⁡n→∞(12+12n)=12.\begin{aligned} \int_0^1 x\,dx &= \lim_{n \to \infty} \left(\frac12 + \frac{1}{2n}\right) \\[0.4em] &= \frac12. \end{aligned}

The left-endpoint sums 12−12n\tfrac12 - \tfrac{1}{2n} have the same limit. The triangle with base 11 and height 11 has area 12⋅1⋅1=12\tfrac12 \cdot 1 \cdot 1 = \tfrac12, which confirms the value.

Check yourself

  1. Compute the right-endpoint sum R4R_4 and the left-endpoint sum L4L_4 for ∫02x dx\int_0^2 x\,dx. Between which two numbers must the integral lie?
Show the answer

The width is Δx=24=12\Delta x = \tfrac24 = \tfrac12 and the points are 00, 12\tfrac12, 11, 32\tfrac32 and 22. The right heights 12\tfrac12, 11, 32\tfrac32 and 22 add to 55, so R4=12⋅5=52R_4 = \tfrac12 \cdot 5 = \tfrac52. The left heights 00, 12\tfrac12, 11 and 32\tfrac32 add to 33, so L4=12⋅3=32L_4 = \tfrac12 \cdot 3 = \tfrac32. Because f(x)=xf(x) = x is increasing,

32≤∫02x dx≤52.\tfrac32 \le \int_0^2 x\,dx \le \tfrac52.

The gap is (f(2)−f(0))⋅12=1\bigl(f(2) - f(0)\bigr) \cdot \tfrac12 = 1. The triangle with base 22 and height 22 has area 22, which lies inside the bracket.

  1. Use right-endpoint sums of regular partitions to find ∫023x dx\int_0^2 3x\,dx as a limit.
Show the answer

With nn pieces, Δx=2n\Delta x = \tfrac2n and xk=2knx_k = \tfrac{2k}{n}, so the kkth height is f(xk)=6knf(x_k) = \tfrac{6k}{n}. Then

Rn=∑k=1n6kn⋅2n=12n2⋅n(n+1)2=6+6n.\begin{aligned} R_n &= \sum_{k=1}^{n} \frac{6k}{n} \cdot \frac{2}{n} \\[0.4em] &= \frac{12}{n^2} \cdot \frac{n(n + 1)}{2} \\[0.4em] &= 6 + \frac{6}{n}. \end{aligned}

The function 3x3x is continuous on [0,2][0, 2], so it is integrable, and the mesh width 2n\tfrac2n approaches 00. Hence

∫023x dx=lim⁡n→∞(6+6n)=6.\begin{aligned} \int_0^2 3x\,dx &= \lim_{n \to \infty} \left(6 + \frac{6}{n}\right) \\[0.4em] &= 6. \end{aligned}

The triangle with base 22 and height 66 has area 66 as well.

  1. A classmate says that right-endpoint sums always overestimate an integral. Test the claim on ∫01(1−x) dx\int_0^1 (1 - x)\,dx by finding RnR_n and LnL_n.
Show the answer

The right heights are 1−kn1 - \tfrac{k}{n} for k=1,…,nk = 1, \dots, n, so

Rn=1n∑k=1n(1−kn)=1−n+12n=12−12n.\begin{aligned} R_n &= \frac1n \sum_{k=1}^{n} \left(1 - \frac{k}{n}\right) \\[0.4em] &= 1 - \frac{n + 1}{2n} \\[0.4em] &= \frac12 - \frac{1}{2n}. \end{aligned}

The left heights are 1−k−1n1 - \tfrac{k-1}{n}, and the same steps give Ln=12+12nL_n = \tfrac12 + \tfrac{1}{2n}. Both sums approach 12\tfrac12, the area of the triangle under y=1−xy = 1 - x, but here Rn<12<LnR_n < \tfrac12 < L_n for every nn. The function is decreasing, so each right end gives the smallest height on its piece and the right rectangles fit under the graph. The claim is false. Whether a right-endpoint sum overestimates depends on how the function behaves on each piece, and for a function that rises and then falls it can go either way.

How this lesson connects

It also uses arithmetic series sums and limits as n increases.