Book 2A

© 2026 Neckpinch · www.neckpinch.com · All rights reserved.

Course 2Book 2A: Numbers, Limits and the IntegralChapter 11

The Riemann Integral

Upper and lower sums, the fundamental theorem, integration by parts, and where Riemann’s integral fails.

61 min read · Updated Nov 6, 2026

Read with Tao, Analysis I, chapter "The Riemann integral" (partitions, piecewise constant functions, upper and lower Riemann integrals, basic properties, integrability of continuous and monotone functions, a non-integrable function, Riemann–Stieltjes integrals, the fundamental theorems of calculus, integration by parts and change of variables). The Riemann–Stieltjes section can be skimmed.

In this chapter · 8 sections
  1. 11.1Area by rectangles
  2. 11.1.1What the definition does
  3. 11.1.2Which functions are integrable
  4. 11.1.3Infinitely many discontinuities can be harmless
  5. 11.2Properties of the integral
  6. 11.2.1Riemann sums and two useful facts
  7. 11.3The fundamental theorem of calculus
  8. 11.3.1Integration by parts
  9. 11.3.2Change of variables
  10. 11.4Improper integrals
  11. 11.5Sums and integrals
  12. 11.6Riemann–Stieltjes integrals, briefly
  13. 11.7Where Riemann's integral fails
  14. 11.8Exercises
  15. ↗Free resources

Derivatives measure rates. Integrals measure totals: area under a curve, distance from speed, work from force, mass from density. This last chapter of Book 2A defines the integral as Riemann did in 1854, by squeezing the area between sums of rectangles from below and above. It proves that continuous functions can be integrated, and proves the fundamental theorem of calculus, which says that integration and differentiation undo each other.

Two consequences of the fundamental theorem matter more than any other for this guidebook. Integration by parts is the single most-used computation from here to Perelman: every energy estimate for the heat equation and every monotonicity formula for Ricci flow is an integration by parts. And the chapter ends by showing where Riemann's integral breaks down. It does not cope with limits, and that failure is the starting point of Course 3.

By the end of this chapter you will be able to:

  • define the Riemann integral by upper and lower sums, and prove a function is or isn't integrable;
  • prove that continuous and monotone functions are integrable, and prove the basic properties of the integral from the definition;
  • compute integrals with the fundamental theorem, by parts and by substitution, and handle improper integrals;
  • prove and use both halves of the fundamental theorem of calculus;
  • integrate by parts and change variables, and use integration by parts to prove that an energy decreases;
  • explain, with examples, why the Riemann integral is not good enough for analysis with limits.

Area by rectangles

The idea is ancient. Archimedes, in the third century BCE, found the area of a parabolic segment by filling it with triangles and summing a geometric series (2A.7 Series). What Riemann supplied in 1854, in the same habilitation thesis as his rearrangement theorem, was a precise definition that works for a large class of functions at once.

Work on a closed interval [a,b][a, b] with a bounded function ff. A partition PP of [a,b][a, b] cuts it into finitely many subintervals [xk−1,xk][x_{k-1}, x_k] with a=x0<x1<⋯<xn=ba = x_0 < x_1 < \cdots < x_n = b. On each piece, the smallest and largest heights of ff are mk=inf⁡[xk−1,xk]fm_k = \inf_{[x_{k-1}, x_k]} f and Mk=sup⁡[xk−1,xk]fM_k = \sup_{[x_{k-1}, x_k]} f. Rectangles of those heights give an area that is certainly too small and one that is certainly too big:

L(f,P)=∑k=1nmk (xk−xk−1),U(f,P)=∑k=1nMk (xk−xk−1).L(f, P) = \sum_{k=1}^n m_k\,(x_k - x_{k-1}), \qquad U(f, P) = \sum_{k=1}^n M_k\,(x_k - x_{k-1}).
Figure 11.1. Lower and upper sums for f(x)=x2f(x) = x^2 on [0,1][0, 1] with 88 equal pieces: L=0.2734L = 0.2734, U=0.3984U = 0.3984. The true area, 13\tfrac13, is squeezed between them. Refining the partition shrinks the gap, the total area of the thin strips.
Lemma 11.1 Refining a partition

If the partition P′P' contains all the points of PP (it refines PP), then L(f,P)≤L(f,P′)L(f, P) \leq L(f, P') and U(f,P′)≤U(f,P)U(f, P') \leq U(f, P). For any two partitions PP and QQ, L(f,P)≤U(f,Q)L(f, P) \leq U(f, Q).

Proof. It is enough to add one point tt, inside some piece [xk−1,xk][x_{k-1}, x_k], since any refinement is obtained by adding finitely many points one at a time. The infimum of ff over each half, [xk−1,t][x_{k-1}, t] and [t,xk][t, x_k], is at least the infimum mkm_k over the whole piece (a smaller set has a larger infimum). So the two new lower rectangles have total area at least mk(t−xk−1)+mk(xk−t)=mk(xk−xk−1)m_k(t - x_{k-1}) + m_k(x_k - t) = m_k(x_k - x_{k-1}), and every other rectangle is unchanged. Hence LL does not decrease. The upper sums are the same with suprema. For two partitions PP and QQ, let R=P∪QR = P \cup Q, which refines both. Then L(f,P)≤L(f,R)≤U(f,R)≤U(f,Q)L(f, P) \leq L(f, R) \leq U(f, R) \leq U(f, Q).

So the following definition makes sense.

Definition 11.2 Riemann integral

The lower and upper Riemann integrals of a bounded ff on [a,b][a, b] are

∫ab‾f=sup⁡PL(f,P),∫ab‾f=inf⁡PU(f,P).\underline{\int_a^b} f = \sup_P L(f, P), \qquad \overline{\int_a^b} f = \inf_P U(f, P).

Always ∫‾f≤∫‾f\underline{\int} f \leq \overline{\int} f. If they are equal, ff is Riemann integrable, and the common value is ∫abf\int_a^b f, or ∫abf(x) dx\int_a^b f(x)\,dx.

The two integrals exist because of the least upper bound property (2A.4 The Real Numbers), which keeps appearing: the lower sums are bounded above by any upper sum (Lemma 11.1), so their supremum exists, and it is at most every upper sum, so it is at most their infimum. The working criterion is a single ε statement.

Proposition 11.3 Riemann's criterion

A bounded ff is integrable on [a,b][a, b] if and only if for every ε>0\varepsilon > 0 there is a partition PP with U(f,P)−L(f,P)≤εU(f, P) - L(f, P) \leq \varepsilon.

Proof. Suppose ff is integrable, with integral II. Given ε\varepsilon, the ε\varepsilon-characterisations of supremum and infimum (2A.4 The Real Numbers) give partitions P1P_1 with L(f,P1)>I−ε/2L(f, P_1) > I - \varepsilon/2 and Q1Q_1 with U(f,Q1)<I+ε/2U(f, Q_1) < I + \varepsilon/2. Their common refinement RR has U(f,R)−L(f,R)≤U(f,Q1)−L(f,P1)<εU(f, R) - L(f, R) \leq U(f, Q_1) - L(f, P_1) < \varepsilon, by Lemma 11.1.

Conversely, for any PP, L(f,P)≤∫‾f≤∫‾f≤U(f,P)L(f, P) \leq \underline{\int} f \leq \overline{\int} f \leq U(f, P). If U−L≤εU - L \leq \varepsilon for some PP, then 0≤∫‾f−∫‾f≤ε0 \leq \overline{\int} f - \underline{\int} f \leq \varepsilon. As ε\varepsilon was arbitrary, the two are equal (2A.5 Quantifiers and the Shape of a Proof).

In words, the thin strips in Figure 11.1 can be given total area as small as you like. Every integrability proof below is a construction of such partitions.

What the definition does

Three remarks help in reading the definition.

It defines area; it does not compute something already known. Before Riemann, "the area under a curve" was taken as a given quantity that integration computes. For a curve as wild as the graphs of 2A.9 Continuous Functions, it is not clear what area could mean. Riemann's definition turns the question around: a region has an area when inner and outer approximations by rectangles squeeze to a single number, and that number is its area. For the polygons and circles of geometry it agrees with the old notion; for the graphs where the approximations do not squeeze, it declines to give an answer.

The area is signed. Where ff is negative, mkm_k and MkM_k are negative, and the rectangles count negatively. So ∫−11x dx=0\int_{-1}^1 x\,dx = 0: the area below the axis cancels the area above it. The geometric area between the graph and the axis is ∫∣f∣\int|f|. For totals with a sign, such as net displacement from a velocity that changes direction, the signed integral is the right one.

Why squeeze from both sides? A simpler-looking definition would take a single Riemann sum ∑kf(tk)(xk−xk−1)\sum_kf(t_k)(x_k - x_{k-1}), with a sample point tkt_k in each piece, and let the pieces shrink. For bounded functions on [a,b][a, b] this gives the same integral, and the next section shows how. But the upper and lower sums have an advantage that matters in proofs: they need no choice of sample points, and they come with an error bound built in. Any number between L(f,P)L(f, P) and U(f,P)U(f, P), including the integral and every Riemann sum, is pinned down to within U−LU - L. That is the form in which this chapter's proofs work, and the form in which numerical analysts state error guarantees.

Example 11.4 The area under x2x^2

With nn equal pieces of [0,1][0, 1], the function x2x^2 is increasing, so on the kk-th piece mk=(k−1n)2m_k = \big(\tfrac{k-1}{n}\big)^2 and Mk=(kn)2M_k = \big(\tfrac{k}{n}\big)^2. Using ∑k=1nk2=n(n+1)(2n+1)6\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6},

U=(n+1)(2n+1)6n2,L=(n−1)(2n−1)6n2,U−L=1n.U = \frac{(n+1)(2n+1)}{6n^2}, \qquad L = \frac{(n-1)(2n-1)}{6n^2}, \qquad U - L = \frac{1}{n}.

Both tend to 13\tfrac13, and the gap 1n\tfrac1n can be made as small as you like. So ∫01x2 dx=13\int_0^1 x^2\,dx = \tfrac13, Archimedes' result, now from a definition.

Which functions are integrable

Theorem 11.5 Continuous functions are integrable

Every continuous function on [a,b][a, b] is Riemann integrable.

Proof. By Heine–Cantor (2A.9 Continuous Functions), ff is uniformly continuous: given ε>0\varepsilon > 0 there is δ>0\delta > 0 with ∣f(x)−f(y)∣≤εb−a|f(x) - f(y)| \leq \frac{\varepsilon}{b - a} whenever ∣x−y∣<δ|x - y| < \delta. Take a partition into pieces shorter than δ\delta. On each piece the maximum and minimum (which are attained, by the maximum principle) differ by at most εb−a\frac{\varepsilon}{b-a}, so U−L≤εb−a(b−a)=εU - L \leq \frac{\varepsilon}{b - a}(b - a) = \varepsilon.

Here is the payoff of uniform continuity: one δ\delta for the whole interval means one mesh size controls every strip at once. With mere continuity, the mesh needed would vary from place to place, and the argument would fail.

Monotone functions are integrable too, even with jumps: for nn equal pieces of an increasing function, U−L=b−an(f(b)−f(a))U - L = \frac{b - a}{n}\big(f(b) - f(a)\big), because the strips telescope (Exercise 11.21). And a bounded function with finitely many discontinuities is integrable, by putting the discontinuities in tiny intervals. Here is the argument for one discontinuity at an interior point cc, with ∣f∣≤M|f| \leq M. Given ε\varepsilon, take an interval [c−η,c+η][c - \eta, c + \eta] with 4Mη≤ε/34M\eta \leq \varepsilon/3: on it the strip has height at most 2M2M and width 2η2\eta, so area at most ε/3\varepsilon/3. On [a,c−η][a, c - \eta] and [c+η,b][c + \eta, b], ff is continuous, so each has a partition with U−L≤ε/3U - L \leq \varepsilon/3. Put the three together: U−L≤εU - L \leq \varepsilon. The same works for finitely many discontinuities, one small interval each.

But not every bounded function is integrable.

Example 11.6 Dirichlet's function is not integrable

Let f(x)=1f(x) = 1 if xx is rational and 00 if not, on [0,1][0, 1]. Every interval, however small, contains rationals and irrationals (2A.4 The Real Numbers), so on every piece of every partition mk=0m_k = 0 and Mk=1M_k = 1. Every lower sum is 00 and every upper sum is 11, so ∫‾f=0≠1=∫‾f\underline{\int} f = 0 \neq 1 = \overline{\int} f.

Riemann's integral cannot assign an area to this function. That would be a curiosity, except that the function arises naturally as a limit of perfectly good integrable functions, as the last section of this chapter shows.

Infinitely many discontinuities can be harmless

Finitely many jumps are harmless, and Dirichlet's function, discontinuous everywhere, is fatal. Between the two lies a question worth asking: how many discontinuities can an integrable function have? The answer is "many, as long as they take up no room", and two examples show what that means.

Example 11.7 Thomae's function is integrable

Thomae's function from 2A.9 Continuous Functions is 1q\frac1q at a rational pq\frac pq in lowest terms and 00 at irrationals. On [0,1][0, 1] it is discontinuous at every rational, infinitely many points, densely spread. Yet it is integrable, with integral 00.

Every lower sum is 00, since every piece contains irrationals. For the upper sums, let ε>0\varepsilon > 0. Only finitely many points of [0,1][0, 1] have f≥εf \geq \varepsilon: the rationals with denominator q≤1εq \leq \frac1\varepsilon, say KK of them. Choose a partition in which each of these KK points lies in a piece of length at most εK\frac{\varepsilon}{K} (two pieces, if the point is a partition point), and the rest of [0,1][0, 1] is covered by the other pieces. On the pieces containing those points, Mk≤1M_k \leq 1, and their total length is at most 2ε2\varepsilon, so they contribute at most 2ε2\varepsilon. On every other piece, f<εf < \varepsilon everywhere, so Mk≤εM_k \leq \varepsilon, and these pieces, of total length at most 11, contribute at most ε\varepsilon. So U(f,P)≤3εU(f, P) \leq 3\varepsilon, and by Proposition 11.3, ff is integrable with ∫01f=0\int_0^1f = 0.

The proof shows the mechanism. A point where ff jumps by a lot can be isolated in a tiny interval, and only finitely many points have a jump bigger than any given ε\varepsilon. What Dirichlet's function does differently is to jump by 11 everywhere, so the bad points cannot be enclosed in intervals of small total length. The precise criterion was found by Henri Lebesgue in 1902: a bounded function on [a,b][a, b] is Riemann integrable exactly when its set of discontinuities has length zero, in the sense of 3A.2 Lebesgue Measure. The rationals have length zero, which is why Thomae's function passes, and the good-and-bad pieces argument in the proof below is a first glimpse of the same idea.

Properties of the integral

For integrable ff and gg on [a,b][a, b]:

  • Linearity: ∫(f+g)=∫f+∫g\int (f + g) = \int f + \int g and ∫cf=c∫f\int cf = c\int f.
  • Monotonicity: if f≤gf \leq g then ∫f≤∫g\int f \leq \int g. In particular ∣∫f∣≤∫∣f∣\big|\int f\big| \leq \int |f| (and ∣f∣|f| is integrable).
  • Additivity: for a<c<ba < c < b, ∫abf=∫acf+∫cbf\int_a^b f = \int_a^c f + \int_c^b f.
  • Products and compositions: fgfg is integrable, and so is ϕ∘f\phi \circ f for continuous ϕ\phi.

Each is proved by comparing upper and lower sums. The second property gives the estimate used constantly: if ∣f∣≤M|f| \leq M on [a,b][a, b], then ∣∫abf∣≤M(b−a)\big|\int_a^b f\big| \leq M(b - a).

Proof (Linearity, monotonicity, the absolute value and additivity). Sums. On any piece, inf⁡(f+g)≥inf⁡f+inf⁡g\inf(f + g) \geq \inf f + \inf g and sup⁡(f+g)≤sup⁡f+sup⁡g\sup(f + g) \leq \sup f + \sup g (each value f(x)+g(x)f(x) + g(x) lies between those bounds). So for every partition,

L(f,P)+L(g,P)≤L(f+g,P)≤U(f+g,P)≤U(f,P)+U(g,P).L(f, P) + L(g, P) \leq L(f + g, P) \leq U(f + g, P) \leq U(f, P) + U(g, P).

Given ε\varepsilon, choose (by Proposition 11.3 and a common refinement) one PP with U−L≤ε/2U - L \leq \varepsilon/2 for both ff and gg. Then U(f+g,P)−L(f+g,P)≤εU(f + g, P) - L(f + g, P) \leq \varepsilon, so f+gf + g is integrable, and its integral and ∫f+∫g\int f + \int g both lie in an interval of length ε\varepsilon, namely [L(f,P)+L(g,P),U(f,P)+U(g,P)][L(f,P) + L(g,P), U(f,P) + U(g,P)]. So they are equal.

Multiples. For c≥0c \geq 0, the infimum and supremum of cfcf on each piece are cc times those of ff; for c<0c < 0 they swap roles. Either way LL and UU for cfcf are cc times those for ff, in some order.

Monotonicity. If f≤gf \leq g, then U(f,P)≤U(g,P)U(f, P) \leq U(g, P) for every PP, so ∫f=∫‾f≤∫‾g=∫g\int f = \overline{\int} f \leq \overline{\int} g = \int g.

Absolute value. On each piece, for any x,yx, y, ∣∣f(x)∣−∣f(y)∣∣≤∣f(x)−f(y)∣≤Mk−mk\big||f(x)| - |f(y)|\big| \leq |f(x) - f(y)| \leq M_k - m_k. So the oscillation sup⁡∣f∣−inf⁡∣f∣\sup|f| - \inf|f| on the piece is at most Mk−mkM_k - m_k, and U(∣f∣,P)−L(∣f∣,P)≤U(f,P)−L(f,P)U(|f|, P) - L(|f|, P) \leq U(f, P) - L(f, P). Hence ∣f∣|f| is integrable. Then −∣f∣≤f≤∣f∣-|f| \leq f \leq |f| and monotonicity give ∣∫f∣≤∫∣f∣\big|\int f\big| \leq \int|f|.

Additivity. Let a<c<ba < c < b. Adding the point cc to a partition of [a,b][a, b] refines it, so by Lemma 11.1 we may use only partitions containing cc. Such a partition PP is a partition P1P_1 of [a,c][a, c] followed by a partition P2P_2 of [c,b][c, b], and L(f,P)=L(f,P1)+L(f,P2)L(f, P) = L(f, P_1) + L(f, P_2), and likewise for UU. If ff is integrable on [a,b][a, b], choose PP with U−L≤εU - L \leq \varepsilon; then U−L≤εU - L \leq \varepsilon on each piece too, so ff is integrable on [a,c][a, c] and on [c,b][c, b], and both ∫abf\int_a^b f and ∫acf+∫cbf\int_a^c f + \int_c^b f lie in [L(f,P),U(f,P)][L(f, P), U(f, P)]. As ε\varepsilon is arbitrary, they are equal. (Conversely, if ff is integrable on both pieces, join two good partitions.)

Proof (Products and compositions). Squares. Let ∣f∣≤M|f| \leq M. On each piece, ∣f(x)2−f(y)2∣=∣f(x)+f(y)∣ ∣f(x)−f(y)∣≤2M(Mk−mk)|f(x)^2 - f(y)^2| = |f(x) + f(y)|\,|f(x) - f(y)| \leq 2M(M_k - m_k), so U(f2,P)−L(f2,P)≤2M(U(f,P)−L(f,P))U(f^2, P) - L(f^2, P) \leq 2M\big(U(f, P) - L(f, P)\big), and f2f^2 is integrable. Products then follow from the identity fg=14((f+g)2−(f−g)2)fg = \frac14\big((f + g)^2 - (f - g)^2\big).

Compositions. Let ϕ\phi be continuous on [−M,M][-M, M], with ∣ϕ∣≤K|\phi| \leq K there. Given ε>0\varepsilon > 0, uniform continuity (2A.9 Continuous Functions) gives δ>0\delta > 0 with ∣ϕ(s)−ϕ(t)∣≤ε|\phi(s) - \phi(t)| \leq \varepsilon when ∣s−t∣<δ|s - t| < \delta. Choose PP with U(f,P)−L(f,P)≤εδU(f, P) - L(f, P) \leq \varepsilon\delta. Call a piece good if the oscillation Mk−mkM_k - m_k of ff on it is less than δ\delta, and bad otherwise. On a good piece, ϕ∘f\phi \circ f oscillates by at most ε\varepsilon; the good pieces have total length at most b−ab - a, so they contribute at most ε(b−a)\varepsilon(b - a) to U(ϕ∘f,P)−L(ϕ∘f,P)U(\phi \circ f, P) - L(\phi \circ f, P). On a bad piece ϕ∘f\phi \circ f oscillates by at most 2K2K, and the bad pieces have total length at most 1δ∑bad(Mk−mk)(xk−xk−1)≤εδδ=ε\frac{1}{\delta}\sum_{\text{bad}}(M_k - m_k)(x_k - x_{k-1}) \leq \frac{\varepsilon\delta}{\delta} = \varepsilon. So they contribute at most 2Kε2K\varepsilon. Altogether U−L≤ε(b−a+2K)U - L \leq \varepsilon(b - a + 2K), which is as small as we like.

The good-and-bad pieces argument is a small preview of measure theory: the places where ff oscillates a lot must have small total length, and only total length matters.

Riemann sums and two useful facts

In practice integrals are approximated by Riemann sums ∑kf(tk)(xk−xk−1)\sum_k f(t_k)(x_k - x_{k-1}), where each tkt_k is any point of the kk-th piece. Such a sum always lies between L(f,P)L(f, P) and U(f,P)U(f, P). For a continuous function, the proof of Theorem 11.5 shows more: given ε\varepsilon there is δ\delta such that for every partition into pieces shorter than δ\delta, and every choice of points tkt_k, the Riemann sum is within ε\varepsilon of ∫abf\int_a^b f. (Both the sum and the integral lie between LL and UU, which differ by at most ε\varepsilon.) That is the precise statement behind every numerical approximation of an integral.

Proposition 11.8 Mean value theorem for integrals

If ff is continuous on [a,b][a, b], then ∫abf=f(c)(b−a)\int_a^b f = f(c)(b - a) for some c∈[a,b]c \in [a, b].

Proof. Let mm and MM be the minimum and maximum of ff (2A.9 Continuous Functions). By monotonicity, m(b−a)≤∫abf≤M(b−a)m(b - a) \leq \int_a^b f \leq M(b - a), so the average 1b−a∫abf\frac{1}{b - a}\int_a^b f lies in [m,M][m, M], which is the image f([a,b])f([a, b]) by the intermediate value theorem. So it equals f(c)f(c) for some cc.

The number 1b−a∫abf\frac{1}{b - a}\int_a^bf in this proof deserves a name of its own: it is the average value of ff on [a,b][a, b]. It is the limit of ordinary averages of ff at nn equally spaced points, because 1n∑kf(tk)=1b−a∑kf(tk)b−an\frac1n\sum_kf(t_k) = \frac{1}{b - a}\sum_kf(t_k)\frac{b - a}{n} is a Riemann sum divided by b−ab - a. So the proposition says that a continuous function attains its average value. Averages over small regions are how analysis turns integrals back into values: as b→ab \to a the average tends to f(a)f(a), which is part 1 of the fundamental theorem below in different words. In later courses, the mean value property of harmonic functions (6A.2 Harmonic Functions), which says that the value at the centre of a ball is the average over the ball, is a statement of exactly this kind.

Proposition 11.9 A non-negative continuous function with zero integral is zero

If ff is continuous and f≥0f \geq 0 on [a,b][a, b], and ∫abf=0\int_a^b f = 0, then f(x)=0f(x) = 0 for every x∈[a,b]x \in [a, b].

Proof. Suppose f(x0)>0f(x_0) > 0. By continuity there is η>0\eta > 0 such that f(x)≥f(x0)/2f(x) \geq f(x_0)/2 for every x∈[a,b]x \in [a, b] with ∣x−x0∣≤η|x - x_0| \leq \eta, and this set contains an interval JJ of positive length ℓ\ell. Since f≥0f \geq 0 everywhere, ∫abf≥∫Jf≥f(x0)2 ℓ>0\int_a^b f \geq \int_J f \geq \frac{f(x_0)}{2}\,\ell > 0, a contradiction.

Continuity is essential: a function that is 11 at one point and 00 elsewhere is non-negative with zero integral. Proposition 11.9 is the step that identifies the equality case of every monotonicity formula: when an integral of a square vanishes, the thing squared vanishes everywhere. It is used for exactly that purpose after Proposition 11.14 below, and in Perelman's arguments that a quantity whose derivative is an integral of a square can only stay constant on a soliton (12A.2 Ricci Flow as a Gradient Flow).

In the world Model The odometer integrates the speedometer

A car's distance travelled is the integral of its speed over time, s=∫t0t1v(t) dts = \int_{t_0}^{t_1} v(t)\,dt. A GPS tracker that logs speed once a second and adds up "speed × one second" is computing a Riemann sum for this integral, with each piece lasting one second. If the speed is continuous (it is, for a real car), Theorem 11.5 guarantees that these sums converge to the true distance as the logging interval shrinks. The same reasoning turns a fuel-flow rate into fuel used, a power reading into energy (kilowatt-hours are the integral of kilowatts over hours), and a river's flow rate into the volume that passed a gauge.

The fundamental theorem of calculus

Theorem 11.10 Fundamental theorem of calculus

Let ff be Riemann integrable on [a,b][a, b].

  1. The function F(x)=∫axfF(x) = \int_a^x f is Lipschitz (hence continuous) on [a,b][a, b]. At every point x0x_0 where ff is continuous, FF is differentiable with F′(x0)=f(x0)F'(x_0) = f(x_0).
  2. If GG is any function on [a,b][a, b] with G′=fG' = f (an antiderivative), then ∫abf=G(b)−G(a)\int_a^b f = G(b) - G(a).

Proof. (1) For x<yx < y, F(y)−F(x)=∫xyfF(y) - F(x) = \int_x^y f, and with ∣f∣≤M|f| \leq M this is at most M∣y−x∣M|y - x| in absolute value. At a continuity point x0x_0, given ε\varepsilon choose δ\delta with ∣f(t)−f(x0)∣≤ε|f(t) - f(x_0)| \leq \varepsilon for ∣t−x0∣<δ|t - x_0| < \delta. For 0<∣h∣<δ0 < |h| < \delta,

∣F(x0+h)−F(x0)h−f(x0)∣=∣1h∫x0x0+h(f(t)−f(x0)) dt∣≤ε.\left|\frac{F(x_0 + h) - F(x_0)}{h} - f(x_0)\right| = \left|\frac1h\int_{x_0}^{x_0+h}\big(f(t) - f(x_0)\big)\,dt\right| \leq \varepsilon.

(2) Take any partition PP. On each piece, the mean value theorem (2A.10 Derivatives) gives a point tkt_k with G(xk)−G(xk−1)=f(tk)(xk−xk−1)G(x_k) - G(x_{k-1}) = f(t_k)(x_k - x_{k-1}). Summing, the left side telescopes: G(b)−G(a)=∑kf(tk)(xk−xk−1)G(b) - G(a) = \sum_k f(t_k)(x_k - x_{k-1}), which lies between L(f,P)L(f, P) and U(f,P)U(f, P). Since this holds for every PP, G(b)−G(a)G(b) - G(a) lies between the lower and upper integrals, which are equal.

Figure 11.2. Why F′=fF' = f: increasing xx by hh adds a thin strip of area about f(x) hf(x)\,h to F(x)=∫axfF(x) = \int_a^x f. Dividing by hh and letting h→0h \to 0 gives F′(x)=f(x)F'(x) = f(x) wherever ff is continuous.
Example 11.11 Computing integrals with the fundamental theorem

Powers. xn+1n+1\frac{x^{n+1}}{n+1} has derivative xnx^n, so ∫01xn dx=1n+1\int_0^1 x^n\,dx = \frac{1}{n+1}, for every natural number nn. For n=2n = 2 this is Example 11.4 again, in one line instead of a page. More generally ∫abxn dx=bn+1−an+1n+1\int_a^b x^n\,dx = \frac{b^{n+1} - a^{n+1}}{n+1}.

Polynomials. By linearity, ∫02(3x2−4x+1) dx=[x3−2x2+x]02=8−8+2=2\int_0^2 (3x^2 - 4x + 1)\,dx = \big[x^3 - 2x^2 + x\big]_0^2 = 8 - 8 + 2 = 2, where [G]ab\big[G\big]_a^b means G(b)−G(a)G(b) - G(a).

A root. 23x3/2\frac23 x^{3/2} has derivative x1/2x^{1/2} (chain rule and roots, 2A.10 Derivatives), so ∫04x dx=23⋅8=163\int_0^4 \sqrt x\,dx = \frac23 \cdot 8 = \frac{16}{3}.

Careful Part 1 needs continuity at the point

Let f=sgn⁡f = \operatorname{sgn} on [−1,1][-1, 1] (−1-1 for x<0x < 0, 00 at 00, 11 for x>0x > 0). It is integrable (one jump), and F(x)=∫0xf=∣x∣F(x) = \int_0^x f = |x|. This FF is continuous, even Lipschitz, as part 1 promises. But it is not differentiable at 00, where ff is discontinuous. Elsewhere F′(x)=sgn⁡(x)=f(x)F'(x) = \operatorname{sgn}(x) = f(x), as promised. So "the derivative of the integral is the integrand" holds at continuity points, and can fail at others.

Part 2 has a hypothesis that is easy to overlook: f=G′f = G' must be integrable. A function can be differentiable everywhere with a derivative so wild that it has no Riemann integral. Take G(x)=x2sin⁡(1/x2)G(x) = x^2\sin(1/x^2) for x≠0x \neq 0, with G(0)=0G(0) = 0. At 00, ∣G(x)x∣≤∣x∣→0\big|\frac{G(x)}{x}\big| \leq |x| \to 0, so G′(0)=0G'(0) = 0; elsewhere G′(x)=2xsin⁡(1/x2)−2xcos⁡(1/x2)G'(x) = 2x\sin(1/x^2) - \frac2x\cos(1/x^2). The second term is unbounded near 00: at x=12πkx = \frac{1}{\sqrt{2\pi k}} it equals −22πk-2\sqrt{2\pi k}. So G′G' is unbounded on [0,1][0, 1], and Riemann's integral, which is defined only for bounded functions, cannot even be asked about it. The formula ∫01G′=G(1)−G(0)\int_0^1G' = G(1) - G(0) is true for a suitable improper integral, but the theorem as stated does not reach it. Even the Lebesgue integral of Course 3 cannot integrate this particular derivative: ∣G′∣|G'| is too large near 00. Integrals that recover every differentiable function from its derivative do exist, but they lie outside this route.

Reading the theorem as a statement about accumulation. Part 1 has a picture that is worth keeping: F(x)=∫axfF(x) = \int_a^xf is a running total, the amount accumulated up to xx, like the water in a tank filled at a varying rate ff. Then F′(x)=f(x)F'(x) = f(x) says that the rate at which the total grows is the current rate of filling. Part 2 runs the picture backwards: if you know the rate at every moment, the total change over the whole time is the area under the rate. Both halves say that "rate" and "total" are two descriptions of one process, and that is why the theorem governs every model of a quantity that changes in time.

Part 1 says that integration produces antiderivatives, and part 2 says that antiderivatives compute integrals. That the slope problem and the area problem are inverse to each other was the great discovery of Newton and Leibniz in the 1660s–1680s. The proofs above, using only the definitions, show how much the 19th-century foundations of 2A.4 The Real Numbers and 2A.9 Continuous Functions were needed to make it rigorous.

Integration by parts

Theorem 11.12 Integration by parts

If uu and vv are differentiable on [a,b][a, b] with integrable derivatives, then

∫abu v′ dx=[u v]ab−∫abu′ v dx.\int_a^b u\,v'\,dx = \big[u\,v\big]_a^b - \int_a^b u'\,v\,dx.

Proof. (uv)′=u′v+uv′(uv)' = u'v + uv' by the product rule (2A.10 Derivatives). Integrate both sides and use part 2 of the fundamental theorem on the left.

Figure 11.3. Integration by parts as an exchange of areas. Following a curve from (u(a),v(a))(u(a), v(a)) to (u(b),v(b))(u(b), v(b)), the area "beside" it (∫u dv\int u\,dv) plus the area "under" it (∫v du\int v\,du) is the difference of the two rectangles, u(b)v(b)−u(a)v(a)u(b)v(b) - u(a)v(a).
Example 11.13 Repeated integration by parts: ∫01xn(1−x)m dx\int_0^1x^n(1 - x)^m\,dx

For natural numbers nn and mm, let I(n,m)=∫01xn(1−x)m dxI(n, m) = \int_0^1x^n(1 - x)^m\,dx. Integrate by parts with u=(1−x)mu = (1 - x)^m and v′=xnv' = x^n, so v=xn+1n+1v = \frac{x^{n+1}}{n + 1}. For m≥1m \geq 1 the boundary term [xn+1n+1(1−x)m]01\big[\frac{x^{n+1}}{n + 1}(1 - x)^m\big]_0^1 vanishes at both ends, and u′=−m(1−x)m−1u' = -m(1 - x)^{m-1}, so

I(n,m)=mn+1 I(n+1,m−1).I(n, m) = \frac{m}{n + 1}\,I(n + 1, m - 1).

Each step moves one power from (1−x)(1 - x) to xx. After mm steps the second power is gone:

I(n,m)=mn+1⋅m−1n+2⋯1n+m I(n+m,0)=m! n!(n+m)!⋅1n+m+1=n! m!(n+m+1)!.I(n, m) = \frac{m}{n + 1}\cdot\frac{m - 1}{n + 2}\cdots\frac{1}{n + m}\,I(n + m, 0) = \frac{m!\,n!}{(n + m)!}\cdot\frac{1}{n + m + 1} = \frac{n!\,m!}{(n + m + 1)!}.

For n=1n = 1, m=5m = 5 this gives 1! 5!7!=142\frac{1!\,5!}{7!} = \frac{1}{42}, the value found by substitution in Example 11.16 below: two methods, one answer. Notice the strategy. Integration by parts did not evaluate the integral; it related it to a simpler one of the same family, and repetition did the rest. Reduction formulas of this kind are how integration by parts is most often used in practice, and the same family of integrals reappears in probability as the Beta distribution.

The formula moves a derivative from one factor to the other at the cost of a boundary term. When the boundary term vanishes, as it does for periodic functions or for functions that vanish at the ends, the derivative simply moves across with a change of sign. That one move drives a remarkable amount of mathematics. Here is the first example.

Proposition 11.14 Energy decreases under the heat equation

Let ff be twice continuously differentiable on [0,1][0, 1], with ff and f′f' taking the same values at 00 and 11 (for example, ff periodic). Then

∫01f f′′ dx=−∫01(f′)2 dx≤0.\int_0^1 f\,f''\,dx = -\int_0^1 (f')^2\,dx \leq 0.

Proof. Integrate by parts with u=fu = f and v=f′v = f': ∫01ff′′=[ff′]01−∫01(f′)2\int_0^1 f f'' = [f f']_0^1 - \int_0^1 (f')^2. The boundary term is f(1)f′(1)−f(0)f′(0)=0f(1)f'(1) - f(0)f'(0) = 0 by the hypothesis.

Why "energy"? If u(x,t)u(x, t) is the temperature in a ring of metal, it obeys the heat equation ∂tu=∂x2u\partial_t u = \partial_x^2 u. Differentiating ∫u2\int u^2 under the integral sign (justified later, in 3A.3 The Lebesgue Integral) and applying the proposition at each time gives

ddt∫01u2 dx=2∫01u ∂x2u dx=−2∫01(∂xu)2 dx≤0.\frac{d}{dt}\int_0^1 u^2\,dx = 2\int_0^1 u\,\partial_x^2 u\,dx = -2\int_0^1 (\partial_x u)^2\,dx \leq 0.

The quantity ∫u2\int u^2 can only decrease, and it stays constant only if ∂xu≡0\partial_x u \equiv 0, that is, when the temperature is uniform. (That last step is Proposition 11.9 applied to the continuous, non-negative function (∂xu)2(\partial_x u)^2: if its integral is 00, it vanishes everywhere.) This is the first monotonicity formula of the guidebook: a quantity that changes in one direction only, with a rate given by a square that vanishes exactly in the equilibrium state. It is proved by integration by parts. Fourier's solution of the heat equation (2B.7 Fourier Series and the First Heat Equation) shows the same decay frequency by frequency.

Where this goes Integration by parts, all the way to Perelman

Every monotonicity formula in this guidebook is this proposition in disguise: differentiate an integral, integrate by parts on a space without boundary, and recognise a sum of squares. On a closed Riemannian manifold, integration by parts reads ∫⟨∇u,∇v⟩=−∫u Δv\int \langle \nabla u, \nabla v\rangle = -\int u\,\Delta v, with no boundary term (8A.8 Differential Forms and Stokes’ Theorem, 9A.6 The Laplacian and the Bochner Formula). Perelman's F\mathcal{F}-functional (12A.2 Ricci Flow as a Gradient Flow) satisfies

ddtF=2∫∣Ric+∇2f∣2e−f dV≥0,\frac{d}{dt}\mathcal{F} = 2\int \big|\mathrm{Ric} + \nabla^2 f\big|^2 e^{-f}\,dV \geq 0,

and the computation behind it is a page of integrations by parts that turns a mess of curvature terms into one perfect square. The structure is the same as Proposition 11.14: monotone, with equality exactly at the special solutions (here, steady solitons).

Change of variables

Theorem 11.15 Change of variables

If ϕ:[a,b]→R\phi : [a, b] \to \mathbb{R} is continuously differentiable and ff is continuous on an interval containing ϕ([a,b])\phi([a, b]), then

∫ϕ(a)ϕ(b)f(y) dy=∫abf(ϕ(x)) ϕ′(x) dx.\int_{\phi(a)}^{\phi(b)} f(y)\,dy = \int_a^b f(\phi(x))\,\phi'(x)\,dx.

Proof. Let FF be an antiderivative of ff (part 1 of the fundamental theorem). By the chain rule, F∘ϕF \circ \phi is an antiderivative of (f∘ϕ) ϕ′(f \circ \phi)\,\phi'. Apply part 2 to both sides: each equals F(ϕ(b))−F(ϕ(a))F(\phi(b)) - F(\phi(a)).

Example 11.16 Two substitutions, used in both directions

Recognising f(ϕ(x))ϕ′(x)f(\phi(x))\phi'(x). In ∫012x1+x2 dx\int_0^1 2x\sqrt{1 + x^2}\,dx, the factor 2x2x is the derivative of ϕ(x)=1+x2\phi(x) = 1 + x^2. So with f(y)=yf(y) = \sqrt y, the integral is ∫ϕ(0)ϕ(1)y dy=∫12y dy=23(23/2−1)≈1.219\int_{\phi(0)}^{\phi(1)} \sqrt y\,dy = \int_1^2 \sqrt y\,dy = \frac23\big(2^{3/2} - 1\big) \approx 1.219.

Substituting to simplify. In ∫01x(1−x)5 dx\int_0^1 x(1 - x)^5\,dx, substitute y=1−xy = 1 - x, so x=1−yx = 1 - y; as xx runs from 00 to 11, yy runs from 11 to 00, and dx=−dydx = -dy. The integral becomes ∫10(1−y)y5 (−dy)=∫01(y5−y6) dy=16−17=142\int_1^0 (1 - y)y^5\,(-dy) = \int_0^1 (y^5 - y^6)\,dy = \frac16 - \frac17 = \frac{1}{42}. Formally this is Theorem 11.15 with ϕ(y)=1−y\phi(y) = 1 - y, read from right to left: the minus sign from ϕ′=−1\phi' = -1 is cancelled by the reversed limits.

The factor ϕ′(x)\phi'(x) records how much the substitution stretches lengths. In several variables it becomes the Jacobian determinant (1A.9 Multiple Integrals and Change of Variables, 3A.5 Product Measures and Change of Variables), and on a manifold it becomes the way volumes transform under a change of coordinates (8A.8 Differential Forms and Stokes’ Theorem).

Improper integrals

Riemann's integral is defined for bounded functions on bounded intervals. Two kinds of integral that come up constantly break one of those rules: ∫1∞dxx2\int_1^\infty \frac{dx}{x^2} (unbounded interval) and ∫01dxx\int_0^1 \frac{dx}{\sqrt x} (unbounded function). Both are defined as limits.

Definition 11.17 Improper integrals

If ff is integrable on [a,N][a, N] for every N>aN > a, then ∫a∞f=lim⁡N→∞∫aNf\int_a^\infty f = \lim_{N \to \infty}\int_a^N f when the limit exists, and the integral is said to converge. If ff is integrable on [η,b][\eta, b] for every η∈(a,b)\eta \in (a, b), then ∫abf=lim⁡η→a+∫ηbf\int_a^b f = \lim_{\eta \to a^+}\int_\eta^b f when the limit exists.

Example 11.18 The p-integrals

Let p>0p > 0 be rational, p≠1p \neq 1. An antiderivative of x−px^{-p} on (0,∞)(0, \infty) is x1−p1−p\frac{x^{1-p}}{1 - p}.

  • At infinity: ∫1Nx−p dx=N1−p−11−p\int_1^N x^{-p}\,dx = \frac{N^{1-p} - 1}{1 - p}. If p>1p > 1, N1−p→0N^{1-p} \to 0, and the integral converges to 1p−1\frac{1}{p - 1}. If p<1p < 1, N1−p→∞N^{1-p} \to \infty and it diverges. For p=1p = 1, ∫1Ndxx=ln⁡N→∞\int_1^N \frac{dx}{x} = \ln N \to \infty (with the logarithm of the next section): divergent.
  • At zero: ∫η1x−p dx=1−η1−p1−p\int_\eta^1 x^{-p}\,dx = \frac{1 - \eta^{1-p}}{1 - p}. If p<1p < 1, η1−p→0\eta^{1-p} \to 0 and the integral converges to 11−p\frac{1}{1 - p}; for example ∫01dxx=2\int_0^1 \frac{dx}{\sqrt x} = 2. If p≥1p \geq 1 it diverges.

So ∫1∞x−p\int_1^\infty x^{-p} converges exactly when p>1p > 1, matching the pp-series of 2A.7 Series, and ∫01x−p\int_0^1 x^{-p} converges exactly when p<1p < 1: the opposite condition. Large pp means fast decay at infinity but a severe spike at zero. In nn dimensions the threshold at zero moves from 11 to nn (3A.5 Product Measures and Change of Variables), and that one change of threshold is what decides which functions in Sobolev spaces are continuous (4A.11 Sobolev Embeddings and Critical Exponents).

Sums and integrals

Integrals and sums can be compared directly, which settles the question left open in 2A.7 Series about how fast the harmonic series grows.

Proposition 11.19 Integral test

Let ff be positive and decreasing on [1,∞)[1, \infty). Then for every nn,

∫1n+1f(x) dx≤∑k=1nf(k)≤f(1)+∫1nf(x) dx.\int_1^{n+1} f(x)\,dx \leq \sum_{k=1}^n f(k) \leq f(1) + \int_1^n f(x)\,dx.

So ∑f(k)\sum f(k) converges if and only if ∫1Nf\int_1^N f stays bounded as N→∞N \to \infty.

Proof. On [k,k+1][k, k+1], f(k+1)≤f(x)≤f(k)f(k+1) \leq f(x) \leq f(k) because ff is decreasing. Integrate over [k,k+1][k, k+1] and sum over kk.

For f(x)=1/xf(x) = 1/x, define ln⁡x=∫1xdtt\ln x = \int_1^x \frac{dt}{t}, which is the natural logarithm (2B.6 Power Series, Exponentials and Bump Functions shows it agrees with the inverse of the exponential). The integral test gives ln⁡(n+1)≤Hn≤1+ln⁡n\ln(n + 1) \leq H_n \leq 1 + \ln n. The difference Hn−ln⁡nH_n - \ln n is decreasing and bounded below by 00, so by monotone convergence (2A.6 Sequences) it converges. Its limit is the Euler–Mascheroni constant γ=0.5772…\gamma = 0.5772\ldots, which explains the estimate Hn≈ln⁡n+0.5772H_n \approx \ln n + 0.5772 used in 2A.7 Series.

Figure 11.4. The rectangles of heights 1,12,…,1n1, \tfrac12, \dots, \tfrac1n sum to HnH_n, and the area under 1/x1/x from 11 to n+1n+1 is ln⁡(n+1)\ln(n+1). The shaded slivers between them add up to Hn−ln⁡(n+1)H_n - \ln(n+1), which increases to γ=0.5772…\gamma = 0.5772\ldots; and Hn−ln⁡nH_n - \ln n decreases to the same limit.
In the world In use Numerical integration, with a guaranteed error

Most integrals that arise in engineering can't be done in closed form, and are computed numerically from function values. The trapezoid rule replaces ff on each of nn equal pieces by the straight line through its endpoint values. If ∣f′′∣≤K|f''| \leq K on [a,b][a, b], its error is at most K(b−a)312n2\frac{K(b - a)^3}{12 n^2} (Exercise 11.24). Halving the step divides the error bound by four. This is a typical calculus fact with direct practical use: a bound on a derivative guarantees the accuracy of an approximation. Refinements of the same idea (Simpson's rule, Gaussian quadrature, adaptive methods that place more points where ∣f′′∣|f''| is large) are the workhorses of scientific computing.

Figure 11.5. The trapezoid rule with 44 pieces. The error is the total of the thin shaded regions. Each is controlled by how much ff bends, that is, by f′′f'', and shrinks like the square of the step.

Riemann–Stieltjes integrals, briefly

Tao's chapter includes a generalisation that is worth knowing exists, even if it can be skimmed now. Replace the length xk−xk−1x_k - x_{k-1} of each piece by the increase α(xk)−α(xk−1)\alpha(x_k) - \alpha(x_{k-1}) of an increasing function α\alpha. The resulting ∫abf dα\int_a^b f\,d\alpha weights different parts of the interval differently. If α\alpha has a jump, that point gets a positive weight of its own.

In the world Model Insurance with a deductible

An insurer models a claim size XX as a random quantity whose distribution has two parts: a probability p0p_0 of no claim at all (an atom at 00), and a density ρ(x)\rho(x) for positive claims. A policy with deductible dd pays max⁡(X−d,0)\max(X - d, 0). Its expected cost is a Riemann–Stieltjes integral ∫max⁡(x−d,0) dF(x)\int \max(x - d, 0)\,dF(x) against the cumulative distribution FF. The jump of FF at 00 contributes a term 0⋅p00 \cdot p_0 (no payout), and the continuous part contributes ∫d∞(x−d) ρ(x) dx\int_d^\infty (x - d)\,\rho(x)\,dx. One integral handles the discrete and the continuous parts together. That unification of sums and integrals is exactly what measure theory makes systematic (3A.4 Measures, Probability and Weights), where "integrating against dFdF" becomes "integrating against a measure".

Where Riemann's integral fails

Here is the problem that drives Course 3. Integrals and limits should be interchangeable in reasonable situations: if fn→ff_n \to f, we would like ∫fn→∫f\int f_n \to \int f. Riemann's integral fails at this in two distinct ways.

The limit may not be integrable. List the rationals in [0,1][0, 1] as q1,q2,q3,…q_1, q_2, q_3, \dots (2A.8 Infinite Sets), and let fnf_n be 11 at q1,…,qnq_1, \dots, q_n and 00 elsewhere. Each fnf_n differs from 00 at finitely many points, so it is integrable with ∫fn=0\int f_n = 0. The sequence increases to Dirichlet's function at every point, and Dirichlet's function has no Riemann integral at all (Example 11.6).

The integrals may not converge to the integral of the limit. Let fnf_n be a narrow triangular spike of height nn on [0,2n][0, \tfrac2n], peaking at 1n\tfrac1n, and zero elsewhere (Figure 11.6). For each fixed xx, eventually the spike has moved past xx (or x=0x = 0, where every fnf_n is 00), so fn(x)→0f_n(x) \to 0 for every xx. But every spike has area 12⋅2n⋅n=1\tfrac12 \cdot \tfrac2n \cdot n = 1. So

lim⁡n→∞∫01fn=1≠0=∫01lim⁡n→∞fn.\lim_{n\to\infty}\int_0^1 f_n = 1 \neq 0 = \int_0^1 \lim_{n\to\infty} f_n.

The area hasn't disappeared. It has concentrated into an ever thinner spike and escaped through the limit.

Figure 11.6. Spikes of height nn and width 2n\tfrac2n: each has area 11, but at each point they eventually vanish. The pointwise limit is 00, whose integral is 00. Area can escape in a limit by concentrating, here at the point 00.

The second failure is not really the integral's fault. The spikes show something true about limits, which any integral must respect, and the theorems of 3A.3 The Lebesgue Integral say exactly when it can't happen: when the functions are dominated by a single integrable function. The first failure is the integral's fault, and it is fixed by building a better one.

Where this goes Completing the space of integrable functions

Measure the distance between two integrable functions by d(f,g)=∫ab∣f−g∣d(f, g) = \int_a^b |f - g|. With this distance, the Riemann-integrable functions behave like the rationals of 2A.3 Integers and Rationals: there are Cauchy sequences with no limit among them. The increasing sequence above, built from the rationals, is one kind of example; there are worse ones. The remedy is the one used to build the reals from the rationals (2A.4 The Real Numbers): complete the space. The result is the space L1L^1 of Lebesgue-integrable functions (3A.3 The Lebesgue Integral), which contains the limits of all such Cauchy sequences, and in which the convergence theorems that analysis needs are true. So Book 2A ends where it began: a number system (here, a space of functions) that looks complete but has holes, and the same construction to fill them.

Recall Book 2A in one paragraph

From five axioms we built the natural numbers, then the integers and rationals as quotients, then the reals as the completion of the rationals. With the logic of quantifiers in hand, we studied sequences (monotone convergence, Bolzano–Weierstrass, completeness), series (absolute and conditional convergence), infinite sets (countable and uncountable), continuous functions (the maximum principle and the intermediate value theorem, both resting on completeness), derivatives (the mean value theorem, Hamilton's trick, blow-up) and integrals (the fundamental theorem and integration by parts). Book 2B, starting with 2B.1 Metric Spaces, replaces the real line by general spaces, where distance, completeness and compactness become the main ideas.

Exercises

Exercise 11.20 Refinement

Show that if P′P' is obtained from PP by adding one point, then L(f,P)≤L(f,P′)L(f, P) \leq L(f, P') and U(f,P′)≤U(f,P)U(f, P') \leq U(f, P). Deduce that every lower sum is at most every upper sum (compare both with their common refinement).

Solution

This is Lemma 11.1 and its proof: an infimum over half a piece is at least the infimum over the whole piece, so splitting a piece can only raise the lower rectangles; and L(f,P)≤L(f,P∪Q)≤U(f,P∪Q)≤U(f,Q)L(f, P) \leq L(f, P \cup Q) \leq U(f, P \cup Q) \leq U(f, Q).

Exercise 11.21 Monotone functions are integrable

Let ff be increasing on [a,b][a, b]. For the partition into nn equal pieces, show that U(f,P)−L(f,P)=b−an(f(b)−f(a))U(f, P) - L(f, P) = \frac{b - a}{n}\big(f(b) - f(a)\big). Conclude that ff is integrable, even if it has infinitely many jumps.

Solution

Because ff is increasing, on the kk-th piece Mk=f(xk)M_k = f(x_k) and mk=f(xk−1)m_k = f(x_{k-1}). The sum ∑k(f(xk)−f(xk−1))b−an\sum_k (f(x_k) - f(x_{k-1}))\frac{b-a}{n} telescopes to b−an(f(b)−f(a))\frac{b-a}{n}(f(b) - f(a)), which tends to 00.

Exercise 11.22 Using the fundamental theorem

Compute ddx∫0x21+t3 dt\frac{d}{dx}\int_0^{x^2} \sqrt{1 + t^3}\,dt. (Combine part 1 with the chain rule.)

Solution

With F(y)=∫0y1+t3 dtF(y) = \int_0^y \sqrt{1 + t^3}\,dt, the expression is F(x2)F(x^2), whose derivative is F′(x2)⋅2x=2x1+x6F'(x^2)\cdot 2x = 2x\sqrt{1 + x^6}.

Exercise 11.23 Integration by parts

(a) Compute ∫01xe−x dx\int_0^1 x e^{-x}\,dx. (b) Show that ∫0πsin⁡2x dx=∫0πcos⁡2x dx\int_0^\pi \sin^2 x\,dx = \int_0^\pi \cos^2 x\,dx by integrating by parts, and deduce that both equal π2\tfrac{\pi}{2}. (Take the derivatives of exe^x, sin⁡\sin and cos⁡\cos for granted; they are constructed in 2B.6 Power Series, Exponentials and Bump Functions.)

Solution

(a) With u=xu = x and v′=e−xv' = e^{-x}, v=−e−xv = -e^{-x}: ∫01xe−x dx=[−xe−x]01+∫01e−x dx=−e−1+(1−e−1)=1−2e≈0.264\int_0^1 xe^{-x}\,dx = \big[-xe^{-x}\big]_0^1 + \int_0^1 e^{-x}\,dx = -e^{-1} + (1 - e^{-1}) = 1 - \frac2e \approx 0.264. (b) With u=sin⁡xu = \sin x, v′=sin⁡xv' = \sin x, v=−cos⁡xv = -\cos x: ∫0πsin⁡2x dx=[−sin⁡xcos⁡x]0π+∫0πcos⁡2x dx=∫0πcos⁡2x dx\int_0^\pi \sin^2 x\,dx = \big[-\sin x\cos x\big]_0^\pi + \int_0^\pi \cos^2 x\,dx = \int_0^\pi \cos^2 x\,dx. Their sum is ∫0π1 dx=π\int_0^\pi 1\,dx = \pi, so each is π2\frac\pi2.

Exercise 11.24 The trapezoid rule's error

Let ff be twice continuously differentiable on [0,h][0, h], and let E=∫0hf−h2(f(0)+f(h))E = \int_0^h f - \tfrac h2\big(f(0) + f(h)\big). Show that E=−12∫0ht(h−t)f′′(t) dtE = -\tfrac12\int_0^h t(h - t) f''(t)\,dt by integrating by parts twice, and deduce ∣E∣≤h312max⁡∣f′′∣|E| \leq \tfrac{h^3}{12}\max|f''|. Summing over nn pieces of length h=(b−a)/nh = (b-a)/n gives the bound quoted in the chapter.

Solution

First, with u=fu = f and v=t−h2v = t - \frac h2 (so v′=1v' = 1): ∫0hf=[(t−h2)f]0h−∫0h(t−h2)f′(t) dt=h2(f(h)+f(0))−∫0h(t−h2)f′(t) dt\int_0^h f = \big[(t - \tfrac h2)f\big]_0^h - \int_0^h (t - \tfrac h2)f'(t)\,dt = \frac h2\big(f(h) + f(0)\big) - \int_0^h (t - \tfrac h2) f'(t)\,dt. So E=−∫0h(t−h2)f′(t) dtE = -\int_0^h (t - \frac h2)f'(t)\,dt. Next, with u=f′u = f' and w(t)=−12t(h−t)w(t) = -\frac12 t(h - t), which has w′=t−h2w' = t - \frac h2 and vanishes at 00 and hh: ∫0h(t−h2)f′=[wf′]0h−∫0hwf′′=12∫0ht(h−t)f′′(t) dt\int_0^h (t - \tfrac h2)f' = \big[wf'\big]_0^h - \int_0^h w f'' = \frac12\int_0^h t(h - t)f''(t)\,dt. So E=−12∫0ht(h−t)f′′(t) dtE = -\frac12\int_0^h t(h-t)f''(t)\,dt, and ∣E∣≤12max⁡∣f′′∣∫0ht(h−t) dt=12max⁡∣f′′∣⋅h36|E| \leq \frac12 \max|f''|\int_0^h t(h - t)\,dt = \frac12\max|f''|\cdot\frac{h^3}{6}. Over nn pieces the errors add up to at most n⋅h312K=K(b−a)312n2n\cdot\frac{h^3}{12}K = \frac{K(b-a)^3}{12n^2}.

Exercise 11.25 Euler's constant

Show that an=Hn−ln⁡na_n = H_n - \ln n is decreasing and that an≥ln⁡(n+1)−ln⁡n>0a_n \geq \ln(n+1) - \ln n > 0, so γ=lim⁡an\gamma = \lim a_n exists. Then show 0<an−γ≤1n0 < a_n - \gamma \leq \frac1n, which says how fast the estimate Hn≈ln⁡n+γH_n \approx \ln n + \gamma becomes accurate.

Solution

ak−ak+1=ln⁡(k+1)−ln⁡k−1k+1=∫kk+1(1x−1k+1) dxa_k - a_{k+1} = \ln(k+1) - \ln k - \frac{1}{k+1} = \int_k^{k+1}\big(\frac1x - \frac{1}{k+1}\big)\,dx. On [k,k+1][k, k+1] the integrand lies between 00 and 1k−1k+1\frac1k - \frac1{k+1}, and is positive except at k+1k + 1, so 0<ak−ak+1≤1k−1k+10 < a_k - a_{k+1} \leq \frac1k - \frac{1}{k+1}. The first inequality says (an)(a_n) decreases strictly. By the integral test, Hn≥ln⁡(n+1)H_n \geq \ln(n + 1), so an≥ln⁡(n+1)−ln⁡n>0a_n \geq \ln(n+1) - \ln n > 0; monotone convergence gives γ\gamma. Summing the upper bound from k=nk = n to m−1m - 1 telescopes: an−am≤1n−1m<1na_n - a_m \leq \frac1n - \frac1m < \frac1n. Letting m→∞m \to \infty, an−γ≤1na_n - \gamma \leq \frac1n; and an−γ>0a_n - \gamma > 0 because the sequence decreases strictly to γ\gamma.

Exercise 11.26 Three ways to escape

For each sequence on [0,∞)[0, \infty), find the pointwise limit and the limit of the integrals: (a) a spike of height nn on [0,2n][0, \tfrac2n] (this chapter); (b) a block of height 11 on [n,n+1][n, n+1]; (c) a block of height 1n\tfrac1n on [0,n][0, n]. In each case the area escapes, but in a different way: concentrating at a point, moving off to infinity, or spreading out thinly. 3A.3 The Lebesgue Integral names these three modes of escape. In Ricci flow, curvature that concentrates at a point as time increases is exactly a singularity forming (11B.5 Singularities).

Solution

In all three, the pointwise limit is 00 and every integral is 11. (a) For x>0x > 0, fn(x)=0f_n(x) = 0 once 2n<x\frac2n < x; and fn(0)=0f_n(0) = 0. (b) For each xx, fn(x)=0f_n(x) = 0 once n>xn > x. (c) 0≤fn≤1n0 \leq f_n \leq \frac1n everywhere. The integrals are 12⋅2n⋅n\frac12\cdot\frac2n\cdot n, 1⋅11 \cdot 1 and 1n⋅n\frac1n \cdot n. (In (b) and (c) the domain [0,∞)[0, \infty) is unbounded, so these are improper integrals; each fnf_n vanishes outside a bounded interval, so nothing subtle happens.)

Exercise 11.27 The area under x³ by rectangles

Using ∑k=1nk3=(n(n+1)2)2\sum_{k=1}^n k^3 = \big(\frac{n(n+1)}{2}\big)^2, compute the upper and lower sums of x3x^3 on [0,1][0, 1] for nn equal pieces, and show directly that ∫01x3 dx=14\int_0^1 x^3\,dx = \frac14. Then check it with the fundamental theorem.

Solution

x3x^3 is increasing, so U=1n4∑k=1nk3=(n+1)24n2U = \frac{1}{n^4}\sum_{k=1}^n k^3 = \frac{(n+1)^2}{4n^2} and L=1n4∑k=1n−1k3=(n−1)24n2L = \frac{1}{n^4}\sum_{k=1}^{n-1}k^3 = \frac{(n-1)^2}{4n^2}. Both tend to 14\frac14, and U−L=1n→0U - L = \frac{1}{n} \to 0. By the fundamental theorem, [x44]01=14\big[\frac{x^4}{4}\big]_0^1 = \frac14.

Exercise 11.28 Improper integrals

Decide which converge, and evaluate those that do: (a) ∫1∞dxx3\int_1^\infty \frac{dx}{x^3}; (b) ∫01dxx1/3\int_0^1 \frac{dx}{x^{1/3}}; (c) ∫01dxx2\int_0^1 \frac{dx}{x^2}; (d) ∫1∞dxx\int_1^\infty \frac{dx}{\sqrt x}.

Solution

(a) p=3>1p = 3 > 1: converges to 12\frac12. (b) p=13<1p = \frac13 < 1 at zero: converges to 11−1/3=32\frac{1}{1 - 1/3} = \frac32. (c) p=2≥1p = 2 \geq 1 at zero: diverges, since ∫η1x−2=1η−1→∞\int_\eta^1 x^{-2} = \frac1\eta - 1 \to \infty. (d) p=12<1p = \frac12 < 1 at infinity: diverges, since ∫1Nx−1/2=2N−2→∞\int_1^N x^{-1/2} = 2\sqrt N - 2 \to \infty.

Exercise 11.29 When a zero integral forces a zero function

(a) Give a non-negative integrable function on [0,1][0, 1], not identically zero, with integral 00. (b) Let ff be continuous on [a,b][a, b] with ∫abf g=0\int_a^b f\,g = 0 for every continuous gg. Prove that f=0f = 0. (Choose gg well.)

Solution

(a) f(12)=1f(\tfrac12) = 1 and f=0f = 0 elsewhere: one discontinuity, so integrable, and every lower sum is 00 while upper sums can be made as small as we like. (b) Take g=fg = f: then ∫abf2=0\int_a^b f^2 = 0, and f2f^2 is continuous and non-negative, so f2=0f^2 = 0 by Proposition 11.9. This "choose g=fg = f" step is how the uniqueness of weak solutions and the fundamental lemma of the calculus of variations (6A.11 Calculus of Variations and Gradient Flows) begin.

Exercise 11.30 Rehearsal: a monotone energy

Let u(x,t)u(x, t) be smooth and 11-periodic in xx, with ∂tu=∂x2u\partial_t u = \partial_x^2 u. (a) Show that E(t)=∫01u2 dxE(t) = \int_0^1 u^2\,dx is non-increasing. (b) Show that D(t)=∫01(∂xu)2 dxD(t) = \int_0^1 (\partial_x u)^2\,dx is also non-increasing, by computing D′(t)D'(t) and integrating by parts. (c) Show that the mean ∫01u dx\int_0^1 u\,dx is constant. Each is a small monotonicity formula, and all three are proved by integration by parts with no boundary terms. That is exactly the setting of a closed manifold, where Perelman's are proved.

Solution

(a) E′=2∫u uxx=−2∫ux2≤0E' = 2\int u\,u_{xx} = -2\int u_x^2 \leq 0. (b) D′=2∫ux uxt=2∫ux(uxx)x=−2∫uxx2≤0D' = 2\int u_x\,u_{xt} = 2\int u_x (u_{xx})_x = -2\int u_{xx}^2 \leq 0, integrating by parts once more. (c) ddt∫u=∫uxx=[ux]01=0\frac{d}{dt}\int u = \int u_{xx} = [u_x]_0^1 = 0 by periodicity.

Free resources for this chapter

Chosen for what this chapter covers, and all free to read or watch. Where a lecture covers more than this chapter, the minutes to watch are given, and the link starts there when it can. Links checked Nov 6, 2026.

Read

Watch 4 lectures and talks

© 2026 Neckpinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.