"The area under the curve" is a picture, not a definition. This post turns it into one. You trap the area between an upper sum that overestimates it and a lower sum that underestimates it, and call the function integrable when the trap can be closed as tightly as you like. From that single idea come proofs that every continuous function and every monotone function is integrable, a function that is not integrable (the Dirichlet function), a surprising one that is (Thomae's function), and both halves of the Fundamental Theorem of Calculus, the result that links this post to the derivatives of post 03. The post ends with improper integrals, Lebesgue's exact criterion for Riemann integrability, and the reason a better integral had to be invented.
Series map: 00 The Real Numbers & Completeness → 01 Sequences & Series → 02 Topology of ℝ & Continuity → 03 Differentiation & Taylor's Theorem → 04 The Riemann Integral (this post) → 05 Uniform Convergence & Power Series.
Learning Outcome
Define partitions, upper and lower Darboux sums, and the upper and lower integrals of a bounded function.
Prove the refinement lemma and deduce that every lower sum is at most every upper sum.
State and prove the Riemann criterion: f is integrable if and only if U(f,P)−L(f,P) can be made smaller than any ε>0.
Compute ∫01x2dx from the definition, with exact upper and lower sums.
Prove that continuous functions and monotone functions on [a,b] are integrable.
Show that the Dirichlet function is not integrable and that Thomae's function is integrable with integral 0.
Prove linearity, monotonicity and the triangle inequality for integrals.
State and prove both parts of the Fundamental Theorem of Calculus, and use integration by parts and substitution.
Decide convergence of the improper integrals ∫1∞x−pdx and ∫01x−pdx.
State Lebesgue's criterion and explain why the Lebesgue integral exists.
Chapter 1 — Partitions and Darboux sums
Terminology
Bounded function — throughout, f:[a,b]→R with a<b and ∣f(x)∣≤B for all x. Riemann integration is only defined for bounded functions on closed, bounded intervals; everything else is handled by improper integrals (Chapter 6).
Partition — a finite set P={x0,x1,…,xn} with a=x0<x1<⋯<xn=b. The k-th subinterval is [xk−1,xk], of length Δxk=xk−xk−1.
Mesh — the length of the longest subinterval, maxkΔxk.
Refinement — Q refines P if P⊆Q (it keeps every point of P and may add more). The common refinement of P1 and P2 is P1∪P2.
Local sup and inf — Mk=sup{f(x):x∈[xk−1,xk]} and mk=inf{f(x):x∈[xk−1,xk]}. These exist because f is bounded (completeness, post 00).
Upper and lower sums —
U(f,P)=k=1∑nMkΔxk,L(f,P)=k=1∑nmkΔxk.
Since mk≤Mk, L(f,P)≤U(f,P) for every partition. Picture tall rectangles that cover the graph and short rectangles that sit under it.
The refinement lemma
Lemma. If P⊆Q, then
L(f,P)≤L(f,Q)≤U(f,Q)≤U(f,P).
Refining can only raise lower sums and lower upper sums.
Proof. By induction it is enough to add one point z to P, inside [xk−1,xk]. Only the k-th term of the upper sum changes. It is replaced by
M′(z−xk−1)+M′′(xk−z),
where M′ and M′′ are the sups of f over [xk−1,z] and [z,xk]. A sup over a smaller set is no bigger, so M′,M′′≤Mk, and the new term is at most Mk(xk−xk−1). So U(f,Q)≤U(f,P). The argument for lower sums is the same with infs, which can only go up. ■
Corollary. For any two partitions P1,P2: L(f,P1)≤U(f,P2).
Proof. With the common refinement Q=P1∪P2: L(f,P1)≤L(f,Q)≤U(f,Q)≤U(f,P2). ■
Upper and lower integrals
Every lower sum is a lower bound for the set of upper sums, so by completeness the following exist and satisfy L(f,P)≤∫f≤∫f≤U(f,P) for every P:
∫abf=PsupL(f,P),∫abf=PinfU(f,P).
Definition. A bounded f is (Riemann) integrable on [a,b] if ∫abf=∫abf. The common value is ∫abf or ∫abf(x)dx.
Watch out: this is the Darboux form of the definition. The Riemann-sum form picks a sample point tk in each subinterval and asks that ∑f(tk)Δxk tend to a limit as the mesh tends to 0. The two definitions give the same integrable functions and the same values (Bartle and Sherbert, Section 7.4). The Darboux form is easier to prove things with, because upper and lower sums do not depend on any choice of points.
Chapter 2 — The Riemann criterion and a worked example
Theorem (Riemann criterion). A bounded f is integrable on [a,b] if and only if for every ε>0 there is a partition P with
U(f,P)−L(f,P)<ε.
Proof. (⇐) For any such P,
0≤∫f−∫f≤U(f,P)−L(f,P)<ε.
The difference is a non-negative number smaller than every ε>0, so it is 0.
(⇒) Let I be the common value and ε>0. Since I=infPU, there is P1 with U(f,P1)<I+ε/2. Since I=supPL, there is P2 with L(f,P2)>I−ε/2. For the common refinement P=P1∪P2 the refinement lemma gives
U(f,P)−L(f,P)≤U(f,P1)−L(f,P2)<ε.■
The criterion is what you use in practice: you never compute a sup over all partitions, you exhibit one good partition for each ε.
Worked example: the integral of x squared on [0, 1]
Let f(x)=x2 and let Pn be the uniform partitionxk=k/n, k=0,…,n, so every Δxk=1/n. Since f is increasing on [0,1], on [xk−1,xk] the inf is at the left end and the sup at the right end:
because the two sums share every term except the largest square n2 and the smallest 02. Given ε>0, any n>1/ε works, so f is integrable. Both sums tend to 62=31, and L(f,Pn)≤∫01x2dx≤U(f,Pn) for every n, so
∫01x2dx=31.
n
L(f,Pn)
U(f,Pn)
U−L
4
7/32=0.21875
15/32=0.46875
1/4
10
57/200=0.285
77/200=0.385
1/10
100
0.32835
0.33835
1/100
Trick: for an increasing function on a uniform partition, the gap rectangles stack into a single column of width nb−a and height f(b)−f(a). So U−L=n(f(b)−f(a))(b−a) at once. That is the whole proof of the next chapter's monotone theorem.
Chapter 3 — Which functions are integrable?
Monotone functions
Theorem. If f is monotone on [a,b], then f is integrable.
Proof. Say f is increasing (it is then bounded by f(a) and f(b)). On the uniform partition Pn, Mk=f(xk) and mk=f(xk−1), so the sum telescopes:
This is smaller than any given ε once n is large. ■
A monotone function may have infinitely many jumps (for instance one at every 1/k), and it is still integrable.
Continuous functions
Theorem. If f is continuous on [a,b], then f is integrable.
Proof. A continuous function on the compact set [a,b] is bounded (EVT) and uniformly continuous (post 02). Let ε>0. Choose δ>0 such that ∣x−y∣<δ implies ∣f(x)−f(y)∣<b−aε. Take any partition P with mesh <δ. On each subinterval, f attains its max and min (EVT again) at points sk,tk with ∣sk−tk∣<δ, so Mk−mk=f(sk)−f(tk)<b−aε. Therefore
Common pitfall: plain continuity is not enough for this proof. You need oneδ that works on every subinterval at once, which is exactly uniform continuity. That is why the theorem is stated on a closed, bounded interval.
Finitely many discontinuities
Theorem. If f is bounded on [a,b] and continuous except at finitely many points, then f is integrable.
Sketch. Say ∣f∣≤B and the bad points are c1,…,cm. Put a small interval of length η around each cj. Their total contribution to U−L is at most 2B⋅mη, which is small when η is. On the remaining closed intervals f is continuous, so the previous theorem makes their contribution as small as you like. ■
Changing a function at finitely many points does not change whether it is integrable, or the value of the integral.
A function that is not integrable: Dirichlet
Let D(x)=1 if x∈Q and D(x)=0 otherwise, on [0,1]. Every subinterval of positive length contains both rationals and irrationals (density of Q and of the irrationals, post 00), so Mk=1 and mk=0 for every k and every partition. Therefore U(D,P)=1 and L(D,P)=0 always, the upper integral is 1, the lower integral is 0, and D is not Riemann integrable.
A function that is integrable: Thomae
Thomae's function on [0,1] is
T(x)={1/q0if x=p/q in lowest terms with q≥1,if x is irrational,
with T(0)=1 (as 0=0/1). It is continuous at every irrational and discontinuous at every rational (post 02). Even so:
Claim.T is integrable on [0,1] and ∫01T=0.
Proof. Every subinterval contains an irrational, so mk=0 and L(T,P)=0 for every P. Let ε>0. The points where T(x)≥ε/2 are the fractions p/q with q≤2/ε; there are finitely many, say N. Choose a partition in which each of these N points lies in subintervals of total length less than ε/2 (for example, give each point its own interval of length less than 4Nε; a point on a boundary touches at most two). On those subintervals Mk≤1, contributing less than ε/2. On all other subintervals Mk<ε/2, contributing at most 2ε⋅1. So U(T,P)<ε. By the Riemann criterion T is integrable, and since every lower sum is 0, the integral is 0. ■
For a feel of the numbers: with ε=51, the points where T≥101 are the fractions in [0,1] with denominator at most 10, and there are exactly 33 of them.
Chapter 4 — Properties of the integral
Let f,g be integrable on [a,b] and k∈R.
Property
Statement
Linearity
f+g and kf are integrable; ∫(f+g)=∫f+∫g and ∫kf=k∫f
Monotonicity
if f≤g on [a,b] then ∫abf≤∫abg
Additivity
for a<c<b: f integrable on [a,b] iff integrable on [a,c] and [c,b], and ∫abf=∫acf+∫cbf
Triangle inequality
∣f∣ is integrable and ∣∫abf∣≤∫ab∣f∣
Bound
if m≤f≤M then m(b−a)≤∫abf≤M(b−a)
Products
fg is integrable
Proof of the sum rule. On any subinterval, sup(f+g)≤supf+supg and inf(f+g)≥inff+infg. So U(f+g,P)≤U(f,P)+U(g,P) and L(f+g,P)≥L(f,P)+L(g,P). Given ε, take a common refinement where both U−L gaps are below ε/2; then the gap for f+g is below ε, and its integral is squeezed between L(f,P)+L(g,P) and U(f,P)+U(g,P), which both lie within ε of ∫f+∫g. ■
Proof of monotonicity.g−f≥0 has every lower sum ≥0, so ∫(g−f)≥0; then use linearity. ■
Proof of the triangle inequality. On any subinterval, for x,y in it, ∣f(x)∣−∣f(y)∣≤∣f(x)−f(y)∣, so the oscillation sup∣f∣−inf∣f∣ is at most Mk−mk. Hence U(∣f∣,P)−L(∣f∣,P)≤U(f,P)−L(f,P) and ∣f∣ is integrable. Since −∣f∣≤f≤∣f∣, monotonicity gives −∫∣f∣≤∫f≤∫∣f∣. ■
Convention. Define ∫baf=−∫abf and ∫aaf=0. Then the additivity formula holds for any order of a,b,c.
Mean Value Theorem for integrals. If f is continuous on [a,b], there is c∈[a,b] with ∫abf=f(c)(b−a).
Proof. With m,M the min and max of f (EVT), the bound property gives m≤b−a1∫abf≤M, and the IVT gives a c where f takes this average value. ■
For example, ∫02x2dx=38, so c2⋅2=38, c=32: the same point as the MVT example for x3 in post 03, and that is no coincidence, because 3x3 is an antiderivative of x2.
Chapter 5 — The Fundamental Theorem of Calculus
Part 1: integrating then differentiating
Theorem (FTC, part 1). Let f be integrable on [a,b] and define
F(x)=∫axf(t)dt,x∈[a,b].
Then F is continuous on [a,b] (in fact Lipschitz). If f is continuous at c∈[a,b], then F is differentiable at c and F′(c)=f(c) (one-sided at an endpoint).
Proof. Let ∣f∣≤B. For x<y, additivity and the bound give ∣F(y)−F(x)∣=∫xyf≤B(y−x). So F is Lipschitz, hence continuous.
Now let f be continuous at c and ε>0. Choose δ with ∣f(t)−f(c)∣<ε for ∣t−c∣<δ. For 0<∣x−c∣<δ,
x−cF(x)−F(c)−f(c)=x−c1∫cx(f(t)−f(c))dt,
and the right side has absolute value at most ∣x−c∣1⋅ε∣x−c∣=ε. ■
So every continuous function has an antiderivative. One famous use: definelnx=∫1xtdt for x>0. Then FTC 1 gives ln′(x)=x1 at once.
Worked example. Let G(x)=∫0x2cos(t2)dt. With F(u)=∫0ucos(t2)dt, FTC 1 gives F′(u)=cos(u2), and G(x)=F(x2). By the chain rule (post 03),
G′(x)=cos((x2)2)⋅2x=2xcos(x4).
Part 2: differentiating then integrating
Theorem (FTC, part 2). Let F be differentiable on [a,b] (one-sided at the endpoints) and suppose f=F′ is integrable on [a,b]. Then
∫abf=F(b)−F(a).
Proof. Take any partition P. Apply the Mean Value Theorem (post 03) to F on each [xk−1,xk]: there is tk in the open subinterval with F(xk)−F(xk−1)=F′(tk)Δxk=f(tk)Δxk. Summing, the left side telescopes:
F(b)−F(a)=k=1∑nf(tk)Δxk.
Since mk≤f(tk)≤Mk, this gives L(f,P)≤F(b)−F(a)≤U(f,P) for everyP. So F(b)−F(a) lies between the lower and upper integrals, which are equal. ■
Watch out: the hypothesis "F′ is integrable" cannot be dropped. F(x)=x2sin(1/x2) with F(0)=0 is differentiable on [−1,1], but F′(x)=2xsin(1/x2)−x2cos(1/x2) for x=0 is unbounded near 0, so it is not Riemann integrable. A derivative can even be bounded and still not Riemann integrable (Volterra's function, 1881).
Integration by parts and substitution
Integration by parts. If u,v are differentiable on [a,b] and u′,v′ are integrable, then
∫abuv′=u(b)v(b)−u(a)v(a)−∫abu′v.
This is FTC 2 applied to (uv)′=u′v+uv′. Example: ∫01xexdx=[xex]01−∫01exdx=e−(e−1)=1.
Substitution. If φ:[a,b]→R is continuously differentiable and f is continuous on an interval containing φ([a,b]), then
∫abf(φ(t))φ′(t)dt=∫φ(a)φ(b)f(u)du.
Proof: both sides, as functions of the upper limit b, have the same derivative (FTC 1 and the chain rule) and agree when b=a. Example: with u=x2+1, ∫012x(x2+1)3dx=∫12u3du=424−14=415.
Chapter 6 — Improper integrals
The Riemann integral needs a bounded function on a closed, bounded interval. An improper integral relaxes one of these by a limit.
Unbounded interval. If f is integrable on [a,R] for every R>a, define ∫a∞f=limR→∞∫aRf when the limit exists (the integral converges).
Unbounded function. If f is integrable on [a+η,b] for every small η>0, define ∫abf=limη→0+∫a+ηbf.
The p-test. For p>0:
∫1Rx−pdx=⎩⎨⎧p−11−R1−plnRp=1,p=1.
As R→∞: if p>1 then R1−p→0 and the integral converges to p−11; if p≤1 it diverges to ∞. Near 0 the roles swap: ∫01x−pdx converges (to 1−p1) exactly when p<1.
Integral
Converges?
Value
∫1∞x−2dx
yes (p=2>1)
1
∫1∞x−1dx
no (p=1)
diverges
∫01x−1/2dx
yes (p=21<1)
2
∫0∞e−xdx
yes
1
This mirrors the p-series test of post 01: ∑1/kp converges exactly when p>1. The integral test makes the link precise: for f positive and decreasing on [1,∞), ∑f(k) and ∫1∞f converge or diverge together.
Common pitfall:∫−∞∞f is defined as ∫−∞0f+∫0∞f with both limits existing separately. limR→∞∫−RRxdx=0, but ∫−∞∞xdx diverges.
Chapter 7 — Lebesgue's criterion, and why Lebesgue integration exists
Measure zero
A set A⊆R has measure zero if for every ε>0 it can be covered by countably many open intervals whose total length is less than ε.
Every finite set has measure zero.
Every countable set {a1,a2,…} has measure zero: cover ak by an interval of length ε/2k+1; the total is at most ε/2. So Q has measure zero (it is countable, post 00).
An interval [c,d] with c<d does not have measure zero.
Theorem (Lebesgue's criterion). A function f:[a,b]→R is Riemann integrable if and only if f is bounded and the set of points where f is discontinuous has measure zero.
This explains every example in the post at once:
Function
Discontinuities
Integrable?
continuous f
none
yes
monotone f
countable (jumps)
yes
Thomae T
the rationals: countable
yes
Dirichlet D
every point of [0,1]
no
x−1/2 on (0,1]
— but unbounded
not Riemann; only improper
The proof is in Abbott, Section 7.6, and Rudin, Theorem 11.33.
Why a better integral was needed
The Riemann integral does not behave well under limits. Enumerate the rationals in [0,1] as q1,q2,… and let fn be 1 at q1,…,qn and 0 elsewhere. Each fn has finitely many discontinuities, so it is integrable with ∫01fn=0. The functions increase and are bounded by 1, and fn(x)→D(x) at every x. But the limit D is not Riemann integrable, so "∫fn→∫limfn" is not even meaningful.
Lebesgue's integral (1902) partitions the range of f instead of its domain, and measures the sets where f takes values in each range slice. It integrates D (answer 0, since Q has measure zero), agrees with the Riemann integral whenever the latter exists, and satisfies clean limit theorems such as the Monotone and Dominated Convergence Theorems. Post 05 shows the Riemann-world substitute: limits and integrals commute when convergence is uniform.
Practice Exercises
Exercise 1. For f(x)=x on [0,1] and the uniform partition Pn, compute U(f,Pn) and L(f,Pn) and deduce ∫01xdx.
Solution
Mk=k/n and mk=(k−1)/n, each times Δxk=1/n. With ∑k=1nk=2n(n+1): U=2nn+1 and L=2nn−1. So U−L=n1→0 and both tend to 21. Hence ∫01xdx=21.
Exercise 2. For f(x)=x3 on [0,2] with the uniform partition into n pieces, show U−L=n16. How large must n be for U−L<0.01?
Solution
By the trick of Chapter 2 (increasing function, uniform partition), U−L=n(b−a)(f(b)−f(a))=n2⋅8=n16. Explicitly, U=n24(n+1)2 and L=n24(n−1)2, whose difference is n216n. Then n16<0.01 needs n>1600, so n=1601 is the smallest. Both sums tend to 4=∫02x3dx.
Exercise 3. Let f=0 on [0,1] except f(21)=5. Prove from the definition that f is integrable with integral 0.
Solution
Every lower sum is 0 (each subinterval contains points where f=0). Given ε>0, take 0<δ<min(10ε,21) and the partition {0,21−δ,21+δ,1}. Only the middle subinterval has Mk=5, so U=5⋅2δ<ε. By the Riemann criterion f is integrable, and the integral is squeezed to 0.
Exercise 4. Evaluate ∫01xdx and decide whether ∫1∞xdx converges.
Solution
∫η1x−1/2dx=2−2η→2 as η→0+, so the first integral is 2. For the second, ∫1Rxdx=lnR→∞: it diverges (p=1).
Exercise 5. Let f be continuous on [a,b] with f≥0 and ∫abf=0. Prove f(x)=0 for all x.
Solution
Suppose f(c)>0 for some c. By continuity there is an interval [c′,d′]⊆[a,b] of positive length containing c on which f≥2f(c). By additivity and monotonicity, ∫abf≥∫c′d′f≥2f(c)(d′−c′)>0. Contradiction. (Continuity is needed: Thomae's function is ≥0, not identically 0, and has integral 0.)
Exercise 6. Find H′(x) for H(x)=∫xx2tdt on x>0, and explain the answer.
Solution
Write H(x)=∫1x2tdt−∫1xtdt. By FTC 1 and the chain rule, H′(x)=x21⋅2x−x1=x1. Indeed H(x)=ln(x2)−lnx=lnx.
Exercise 7. Explain why the pointwise limit of integrable functions need not be integrable, using the functions fn from Chapter 7.
Solution
Each fn is 1 at n rationals and 0 elsewhere, so it has n discontinuities and ∫01fn=0. At a rational x=qm, fn(x)=1 once n≥m; at an irrational x, fn(x)=0 for all n. So fn→D pointwise, and D is not Riemann integrable (upper integral 1, lower integral 0). The convergence is not uniform: sup∣fn−D∣=1 for every n.
Cheat-sheet
Idea
Statement
Upper / lower sum
U=∑MkΔxk, L=∑mkΔxk
Refinement
P⊆Q⇒L(P)≤L(Q)≤U(Q)≤U(P)
Integrable
lower integral = upper integral
Riemann criterion
for every ε some P has U−L<ε
Increasing, uniform partition
U−L=(b−a)(f(b)−f(a))/n
x2 on [0,1]
U−L=1/n, integral 1/3
Always integrable
continuous; monotone; bounded with finitely many discontinuities
Not integrable
Dirichlet (upper 1, lower 0); unbounded functions
Thomae
integrable, integral 0
Triangle inequality
∣∫f∣≤∫∣f∣
FTC 1
F(x)=∫axf is Lipschitz; F′(c)=f(c) where f is continuous
FTC 2
F′=f integrable ⇒∫abf=F(b)−F(a)
p-test
∫1∞x−p converges iff p>1; ∫01x−p iff p<1
Lebesgue criterion
bounded and discontinuities of measure zero
What's next
Post 05 studies sequences and series of functions. It separates pointwise from uniform convergence, proves that uniform limits of continuous functions are continuous and that integrals commute with uniform limits (the theorem the Dirichlet example above was missing), and then applies everything to power series: radius of convergence, term-by-term differentiation and integration, Abel's theorem and the Weierstrass approximation theorem.
References
Stephen Abbott, Understanding Analysis, 2nd ed., Springer (Undergraduate Texts in Mathematics), 2015 — Chapter 7, "The Riemann Integral", including Section 7.6 on Lebesgue's criterion.
Walter Rudin, Principles of Mathematical Analysis, 3rd ed., McGraw-Hill, 1976 — Chapter 6, "The Riemann–Stieltjes Integral", and Chapter 11 for Lebesgue theory.
Robert G. Bartle and Donald R. Sherbert, Introduction to Real Analysis, 4th ed., Wiley, 2011 — Chapter 7 (Riemann sums, the Darboux integral and their equivalence, FTC, Lebesgue's criterion).
Michael Spivak, Calculus, 4th ed., Publish or Perish, 2008 — Chapters 13–14 (integrals and the Fundamental Theorem).
Jiří Lebl, Basic Analysis I: Introduction to Real Analysis, free textbook — jirka.org/ra, Chapter 5.
MIT OpenCourseWare, 18.100A Real Analysis (Fall 2020), lecture notes on the Riemann integral and the Fundamental Theorem of Calculus.
Note: this post is in progress. Planned additions: the Riemann–Stieltjes integral, a full proof of Lebesgue's criterion, the integral test with its error bounds, and the integral form of the Taylor remainder from post 03.