Chapter VII · Additional theorems in the differential and integral calculus

The integral as the limit of a sum

§164 35 min

Computing integrals straight from the definition, with equal and with unequal pieces, and reading limits of sums as integrals.

Why this matters

The definition of §161 says that ∫abf(x) dx\int_a^b f(x)\,dx is the limit of sums ∑fv δv\sum f_v\,\delta_v as the pieces shrink. Usually we never use this directly: an antiderivative is far quicker. §164 shows that for a few functions the limit can be computed by hand, which makes the definition concrete. More importantly, the same identity can be read backwards: a complicated limit of a sum is sometimes recognisable as an integral, and then it is easy. That second use will reappear whenever we meet a sum that “looks like” a Riemann sum.

The idea

Two things in the definition are free for us to choose, because the theorem of §161 guarantees the same limit for every choice:

  • the division points, as long as the longest piece tends to 00;
  • the sample point in each piece, where fvf_v is evaluated.

Equal pieces are the obvious choice, and they work well for polynomials, since sums of powers of integers have closed forms. But equal pieces are not always the convenient ones. For xkx^k (with kk not a positive integer) Hardy divides [a,b][a, b] in geometric progression: the points a,ar,ar2,…,arn=ba, ar, ar^2, \dots, ar^n = b. Then the left-hand sum is a geometric series, which can always be summed.

Explore Unequal pieces that make the sum easy

Try this. Start with k=2k = 2 and n=4n = 4, and double nn a few times. Watch the factor (r−1)/(rk+1−1)(r-1)/(r^{k+1}-1) in the read-out. Then choose k=−1k = -1.

∫14x2 dx\int_{1}^{4} x^{2}\,dx with division points 1,r,r2,…,r4=41, r, r^2, \dots, r^{4} = 4, so r=1.4142r = 1.4142
xy
  • y = x²
  • rectangle on [arᵛ, arᵛ⁺¹] with height f(arᵛ)
  • division points: each is r times the last
power k
Sum of the rectangles =14.272078= 14.272078; in closed form it is (bk+1−ak+1) r−1rk+1−1=14.272078(b^{k+1}-a^{k+1})\,\dfrac{r-1}{r^{k+1}-1} = 14.272078.
The only part that depends on nn is r−1rk+1−1=0.226541\dfrac{r-1}{r^{k+1}-1} = 0.226541, which tends to 1k+1=0.333333\dfrac{1}{k+1} = 0.333333; the limit is bk+1−ak+1k+1=21\dfrac{b^{k+1}-a^{k+1}}{k+1} = 21. Error now −6.73-6.73.
What to notice

The pieces are narrow near aa and wide near bb, yet all of them shrink as nn grows, which is all the definition asks. The whole dependence on nn sits in one factor, which tends to 1/(k+1)1/(k+1). For k=−1k = -1 that formula breaks down, and the sum becomes n{(b/a)1/n−1}n\{(b/a)^{1/n} - 1\}, which tends to log⁡(b/a)\log(b/a): the logarithm appears as an area, as it should.

Precise statements

The theorem behind every calculation in this lesson is the existence theorem of Definite integrals and areas, read as a statement about limits.

Theorem Riemann sums with any points Hardy: §§161, 164

Let ff be continuous on [a,b][a, b]. For each nn let a=x0(n)<x1(n)<⋯<xkn(n)=ba = x_0^{(n)} < x_1^{(n)} < \dots < x_{k_n}^{(n)} = b be a partition whose longest piece tends to 00 as n→∞n \to \infty, and let ξv(n)\xi_v^{(n)} be any point of the vv-th piece. Then

∑vf(ξv(n))(xv+1(n)−xv(n))→∫abf(x) dx(n→∞).\sum_{v} f\big(\xi_v^{(n)}\big)\big(x_{v+1}^{(n)} - x_v^{(n)}\big) \to \int_a^b f(x)\,dx \qquad (n \to \infty).

Two special cases are used constantly:

b−an∑v=0n−1f ⁣(a+v b−an)→∫abf(x) dx,1n∑r=0n−1f ⁣(rn)→∫01f(x) dx.\frac{b-a}{n}\sum_{v=0}^{n-1} f\!\left(a + v\,\frac{b-a}{n}\right) \to \int_a^b f(x)\,dx, \qquad \frac1n\sum_{r=0}^{n-1} f\!\left(\frac rn\right) \to \int_0^1 f(x)\,dx .

The second is the one to look for when you meet a limit of a sum: try to write the rr-th term as 1nf(r/n)\tfrac1n f(r/n).

Proofs

The theorem is a restatement of §161: given ε\varepsilon, take the δ\delta of the existence theorem; once the longest piece is shorter than δ\delta (which happens for all large nn) every Riemann sum is within ε\varepsilon of the integral. Here instead is the model calculation, Hardy’s first example, as a step-through proof.

Proof ∫abx dx=12(b2−a2)\int_a^b x\,dx = \tfrac12(b^2 - a^2) from the definition
Strategy

Use nn equal pieces and left endpoints, so the sum is an arithmetic series. Sum it in closed form, then let n→∞n \to \infty. The theorem above guarantees that the limit of these particular sums is the integral.

Set up the sum

With h=(b−a)/nh = (b-a)/n the points are xv=a+vhx_v = a + vh, and the left-endpoint sum is

∑v=0n−1h (a+vh)=nh a+h2 {0+1+⋯+(n−1)}.\sum_{v=0}^{n-1} h\,(a + vh) = nh\,a + h^2\,\{0 + 1 + \dots + (n-1)\}.

Sum the arithmetic series

0+1+⋯+(n−1)=12n(n−1)0 + 1 + \dots + (n-1) = \tfrac12 n(n-1), and nh=b−anh = b - a, so the sum is

(b−a){a+(b−a)n(n−1)2n2}.(b - a)\left\{a + (b - a)\frac{n(n-1)}{2n^2}\right\}.

Let n→∞n \to \infty

n(n−1)/(2n2)=12(1−1/n)→12n(n-1)/(2n^2) = \tfrac12(1 - 1/n) \to \tfrac12, so the sum tends to (b−a){a+12(b−a)}=12(b−a)(b+a)=12(b2−a2)(b - a)\{a + \tfrac12(b-a)\} = \tfrac12(b-a)(b+a) = \tfrac12(b^2 - a^2).

Check by a picture

The region under y=xy = x from aa to bb (for 0≤a<b0 \le a < b) is a trapezium with parallel sides aa and bb and width b−ab - a, of area 12(a+b)(b−a)\tfrac12(a + b)(b - a). The same answer, as it must be.

Proof ∫abxk dx\int_a^b x^k\,dx by a geometric partition (0<a<b0 < a < b, k≠−1k \ne -1)
Strategy

With points in geometric progression, the left-endpoint terms form a geometric progression too. Sum it exactly; all the dependence on nn collapses into a single factor whose limit is a derivative in disguise.

The terms

Let r=(b/a)1/nr = (b/a)^{1/n} and xv=arvx_v = ar^v. The vv-th piece has length arv(r−1)ar^v(r - 1) and left value (arv)k(ar^v)^k, so its term is ak+1(r−1) (rk+1)va^{k+1}(r - 1)\,(r^{k+1})^v.

Sum the geometric series

Summing for v=0,…,n−1v = 0, \dots, n-1 and using rn(k+1)=(b/a)k+1r^{n(k+1)} = (b/a)^{k+1},

ak+1(r−1) rn(k+1)−1rk+1−1=(bk+1−ak+1) r−1rk+1−1.a^{k+1}(r-1)\,\frac{r^{n(k+1)} - 1}{r^{k+1} - 1} = \big(b^{k+1} - a^{k+1}\big)\,\frac{r - 1}{r^{k+1} - 1}.

The pieces do shrink

The longest piece is the last, arn−1(r−1)<b(r−1)ar^{n-1}(r - 1) < b(r - 1), and r=(b/a)1/n→1r = (b/a)^{1/n} \to 1 (§74), so the longest piece tends to 00 and the theorem applies.

The limit of the factor

rk+1−1r−1\dfrac{r^{k+1} - 1}{r - 1} is the difference quotient of t↦tk+1t \mapsto t^{k+1} between 11 and rr; as r→1r \to 1 it tends to the derivative at t=1t = 1, namely k+1k + 1. So the sum tends to bk+1−ak+1k+1\dfrac{b^{k+1} - a^{k+1}}{k + 1}.

Worked examples and exercises

Exercise The logarithm as a limit of sums ●●○ Hardy: Examples LXIV, 2 (case k=−1k = -1)

Using the geometric partition, show that ∫abdxx=lim⁡n→∞n{(b/a)1/n−1}\int_a^b \dfrac{dx}{x} = \lim_{n\to\infty} n\{(b/a)^{1/n} - 1\} for 0<a<b0 < a < b, and conclude that this limit is log⁡(b/a)\log(b/a).

Hint
With k=−1k = -1 every term is a0(r−1)r0=r−1a^0 (r-1) r^0 = r - 1.

Solution

Each piece [arv,arv+1][ar^v, ar^{v+1}] contributes (arv+1−arv)⋅1arv=r−1(ar^{v+1} - ar^v)\cdot\dfrac{1}{ar^v} = r - 1, so the left sum is n(r−1)=n{(b/a)1/n−1}n(r - 1) = n\{(b/a)^{1/n} - 1\}. The longest piece tends to 00 as before, so these sums tend to ∫abdx/x\int_a^b dx/x. By §162 that integral is log⁡b−log⁡a=log⁡(b/a)\log b - \log a = \log(b/a), where log⁡\log is defined as ∫1xdt/t\int_1^x dt/t. This gives a second proof that the limit of §75 exists, and identifies it.

Exercise x2x^2 and cos⁡mx\cos mx with equal pieces ●●○ Hardy: Examples LXIV, 3

Evaluate ∫abx2 dx\int_a^b x^2\,dx and ∫abcos⁡mx dx\int_a^b \cos mx\,dx (m≠0m \ne 0) from the definition, with nn equal pieces.

Hint
For x2x^2 you need ∑v=0n−1v=12n(n−1)\sum_{v=0}^{n-1} v = \tfrac12 n(n-1) and ∑v=0n−1v2=16(n−1)n(2n−1)\sum_{v=0}^{n-1} v^2 = \tfrac16 (n-1)n(2n-1).
Hint
For the cosine, multiply ∑v=0n−1cos⁡(α+vβ)\sum_{v=0}^{n-1}\cos(\alpha + v\beta) by 2sin⁡12β2\sin\tfrac12\beta and use 2sin⁡Bcos⁡A=sin⁡(A+B)−sin⁡(A−B)2\sin B\cos A = \sin(A+B) - \sin(A-B): the sum telescopes.

Solution

x2x^2. With h=(b−a)/nh = (b-a)/n and nh=b−anh = b - a, the left sum is

h∑v=0n−1(a+vh)2=nh a2+2ah2⋅12n(n−1)+h3⋅16(n−1)n(2n−1).h\sum_{v=0}^{n-1}(a + vh)^2 = nh\,a^2 + 2ah^2\cdot\tfrac12 n(n-1) + h^3\cdot\tfrac16(n-1)n(2n-1).

As n→∞n \to \infty, h2n(n−1)→(b−a)2h^2 n(n-1) \to (b-a)^2 and h3(n−1)n(2n−1)→2(b−a)3h^3 (n-1)n(2n-1) \to 2(b-a)^3, so the sum tends to (b−a)a2+a(b−a)2+13(b−a)3(b-a)a^2 + a(b-a)^2 + \tfrac13(b-a)^3, which simplifies to 13(b3−a3)\tfrac13(b^3 - a^3).

cos⁡mx\cos mx. The sum is h∑v=0n−1cos⁡(ma+vmh)h\sum_{v=0}^{n-1}\cos(ma + vmh). By the second hint, with α=ma\alpha = ma and β=mh\beta = mh,

2sin⁡12β∑v=0n−1cos⁡(α+vβ)=sin⁡(α+(n−12)β)−sin⁡(α−12β).2\sin\tfrac12\beta\sum_{v=0}^{n-1}\cos(\alpha + v\beta) = \sin\big(\alpha + (n - \tfrac12)\beta\big) - \sin\big(\alpha - \tfrac12\beta\big).

Since nβ=m(b−a)n\beta = m(b - a), the right side is sin⁡(mb−12mh)−sin⁡(ma−12mh)\sin(mb - \tfrac12 mh) - \sin(ma - \tfrac12 mh). So the Riemann sum equals

h2sin⁡12mh{sin⁡(mb−12mh)−sin⁡(ma−12mh)}.\frac{h}{2\sin\frac12 mh}\Big\{\sin\big(mb - \tfrac12 mh\big) - \sin\big(ma - \tfrac12 mh\big)\Big\}.

As h→0h \to 0, h2sin⁡12mh→1m\dfrac{h}{2\sin\frac12 mh} \to \dfrac1m (because sin⁡u/u→1\sin u/u \to 1) and the bracket tends to sin⁡mb−sin⁡ma\sin mb - \sin ma. The integral is (sin⁡mb−sin⁡ma)/m(\sin mb - \sin ma)/m.

The next exercise is the “backwards” use. Here is the sum it asks about, drawn as rectangles.

Explore A limit of sums that is really an integral

Try this. This is the left-endpoint sum for 1/(1+x2)1/(1+x^2) on [0,1][0, 1] with nn equal pieces. Double nn several times and compare the sum with the exact value.

∫0111+x2 dx\int_{0}^{1} \frac{1}{1+x^2}\,dx, left rule with n=4n = 4
xy
  • y = f(x)
  • pieces above the axis count +
  • below the axis count −
Rule
Left sum S4=0.845294S_{4} = 0.845294; exact value 0.7853980.785398; error 0.05990.0599 (refine and watch how fast it shrinks).
What to notice

The exact value is 14π=0.785398…\tfrac14\pi = 0.785398\ldots, and the error roughly halves each time nn doubles: it is about 1/(4n)1/(4n). The sum is exactly n∑r=0n−11/(n2+r2)n\sum_{r=0}^{n-1} 1/(n^2 + r^2), a limit that would be hard to guess without the picture.

Exercise ●○○ Hardy: Examples LXIV, 4

Prove that n∑r=0n−11n2+r2→14πn\displaystyle\sum_{r=0}^{n-1}\frac{1}{n^2 + r^2} \to \tfrac14\pi as n→∞n \to \infty.

Hint
Divide the numerator and the denominator of each term by n2n^2.

Solution
n∑r=0n−11n2+r2=∑r=0n−11/n1+(r/n)2=1n∑r=0n−1f ⁣(rn),f(x)=11+x2.n\sum_{r=0}^{n-1}\frac{1}{n^2 + r^2} = \sum_{r=0}^{n-1}\frac{1/n}{1 + (r/n)^2} = \frac1n\sum_{r=0}^{n-1} f\!\left(\frac rn\right), \qquad f(x) = \frac{1}{1+x^2}.

This is the left-endpoint sum for ff on [0,1][0, 1] with nn equal pieces. ff is continuous, so it tends to ∫01dx1+x2=arctan⁡1=14π\int_0^1 \frac{dx}{1+x^2} = \arctan 1 = \tfrac14\pi (The measure of an angle and the circular functions).

Exercise ●○○ Hardy: Examples LXIV, 5

Prove that 1n2∑r=0n−1n2−r2→14π\dfrac{1}{n^2}\displaystyle\sum_{r=0}^{n-1}\sqrt{n^2 - r^2} \to \tfrac14\pi.

Hint
Take nn out of the square root: n2−r2=n1−(r/n)2\sqrt{n^2 - r^2} = n\sqrt{1 - (r/n)^2}.

Solution

The sum is 1n∑r=0n−11−(r/n)2\dfrac1n\sum_{r=0}^{n-1}\sqrt{1 - (r/n)^2}, the left-endpoint sum for 1−x2\sqrt{1-x^2} on [0,1][0,1], so it tends to ∫011−x2 dx=14π\int_0^1\sqrt{1-x^2}\,dx = \tfrac14\pi, the area of a quarter of the unit disc. Geometrically, the sum counts the area of nn columns standing under the quarter circle; each column reaches up to the circle at its left edge, so the columns cover the quarter disc. (Since 1−x2\sqrt{1-x^2} is decreasing, these are the upper sums.)

Exercise Spotting the integral ●●○ Hardy: §164

Find lim⁡n→∞(1n+1+1n+2+⋯+12n)\displaystyle\lim_{n\to\infty}\left(\frac{1}{n+1} + \frac{1}{n+2} + \dots + \frac{1}{2n}\right).

Hint
Write the rr-th term as 1n⋅11+r/n\dfrac1n\cdot\dfrac{1}{1 + r/n}.

Solution

The sum is 1n∑r=1n11+r/n\dfrac1n\sum_{r=1}^{n}\dfrac{1}{1 + r/n}, the right-endpoint sum for 1/(1+x)1/(1+x) on [0,1][0, 1] with nn equal pieces. It tends to ∫01dx1+x=log⁡2≈0.6931\int_0^1\frac{dx}{1+x} = \log 2 \approx 0.6931. (For n=10n = 10 the sum is 0.66880.6688; the right-endpoint sum of a decreasing function is too small.)

Check yourself

Check yourself Choose one

In computing ∫abf\int_a^b f for continuous ff as a limit of sums ∑fv δv\sum f_v\,\delta_v, which of these must we take care to ensure?

Why

By the existence theorem, every choice of division points and sample points gives the same limit, provided the longest piece shrinks to 00. Making the number of pieces tend to infinity is not enough: one piece could stay long.

Check yourself Enter a number

Find lim⁡n→∞∑r=1n1n+r\displaystyle\lim_{n\to\infty}\sum_{r=1}^{n}\frac{1}{n + r} to three decimal places.

Why

∑r=1n1n+r=1n∑r=1n11+r/n→∫01dx1+x=log⁡2≈0.693\sum_{r=1}^n \frac{1}{n+r} = \frac1n\sum_{r=1}^n\frac{1}{1 + r/n} \to \int_0^1\frac{dx}{1+x} = \log 2 \approx 0.693.

Check yourself True or false?

Hardy’s division of [a,b][a, b] at a,ar,…,arna, ar, \dots, ar^n is only a heuristic, because the definite integral is defined using equal pieces.

Why

False. The definition of §161 allows any partition; the theorem says that all partitions whose longest piece tends to 00 give the same limit. The geometric partition qualifies, since its longest piece arn−1(r−1)ar^{n-1}(r-1) tends to 00.

Check yourself Choose one

The limit lim⁡n→∞1n∑r=1n(rn)3\displaystyle\lim_{n\to\infty}\frac{1}{n}\sum_{r=1}^{n}\left(\frac{r}{n}\right)^{3} equals which integral?

Why

The term is 1nf(r/n)\tfrac1n f(r/n) with f(x)=x3f(x) = x^3, a right-endpoint sum on [0,1][0, 1], so the limit is 14\tfrac14. Directly: ∑r=1nr3=14n2(n+1)2\sum_{r=1}^n r^3 = \tfrac14 n^2(n+1)^2, and dividing by n4n^4 gives a quantity tending to 14\tfrac14; the n4n^4 growth is exactly cancelled.

Hardy’s language

Summary

Summary
  • The definition leaves both the division points and the sample points free; only the longest piece must tend to 00.
  • Equal pieces turn ∫x dx\int x\,dx and ∫x2 dx\int x^2\,dx into sums of powers of integers; a geometric partition turns ∫xk dx\int x^k\,dx into a geometric series, for any kk.
  • For k=−1k = -1 the geometric partition gives log⁡(b/a)=lim⁡n{(b/a)1/n−1}\log(b/a) = \lim n\{(b/a)^{1/n} - 1\}.
  • Read backwards: a limit of the form lim⁡1n∑f(r/n)\lim \frac1n\sum f(r/n) is ∫01f\int_0^1 f, which turns hard limits into easy integrals.