MATH-241 · Lesson 12 of 12 · 23 min
Capstone: the Riemann integral and the fundamental theorem of calculus
The final lesson brings the course together. Calculus defines the integral informally as an area or as an antiderivative. Riemann, in his Habilitation thesis of 1854 on trigonometric series, published in 1868 after his death, gave the first definition general enough to ask which functions are integrable. We follow the equivalent approach of Darboux (1875) with upper and lower sums. Completeness gives the definition, the Heine–Cantor theorem shows that continuous functions are integrable, and the mean value theorem proves the fundamental theorem of calculus. Almost every result of the course is used somewhere in this lesson.
Partitions and Darboux sums
Let \(f: [a, b] \to \mathbb{R}\) be bounded. A partition of \([a, b]\) is a finite set \(P = \{x_0, x_1, \dots, x_n\}\) with \(a = x_0 < x_1 < \dots < x_n = b\). On the \(k\)-th subinterval \([x_{k-1}, x_k]\), of length \(\Delta x_k = x_k - x_{k-1}\), let
\[m_k = \inf\{f(x) : x \in [x_{k-1}, x_k]\}, \qquad M_k = \sup\{f(x) : x \in [x_{k-1}, x_k]\}.\]
These exist by completeness because \(f\) is bounded. The lower and upper sums are
\[L(f, P) = \sum_{k=1}^{n} m_k \Delta x_k, \qquad U(f, P) = \sum_{k=1}^{n} M_k \Delta x_k.\]
Geometrically, for positive \(f\), \(L(f, P)\) is the total area of rectangles lying under the graph and \(U(f, P)\) of rectangles covering it. Clearly \(L(f, P) \le U(f, P)\).
Lemma (refinement). If \(Q \supseteq P\), then \(L(f, P) \le L(f, Q)\) and \(U(f, Q) \le U(f, P)\).
Proof. It suffices to add one point \(z\) inside a subinterval \([x_{k-1}, x_k]\). The infimum over each of the two pieces is at least the infimum \(m_k\) over the whole subinterval, so the two new lower terms sum to at least \(m_k \Delta x_k\). Upper sums are similar. \(\blacksquare\)
Lemma. For any partitions \(P_1\) and \(P_2\), \(L(f, P_1) \le U(f, P_2)\).
Proof. Let \(Q = P_1 \cup P_2\), a common refinement. Then \(L(f, P_1) \le L(f, Q) \le U(f, Q) \le U(f, P_2)\). \(\blacksquare\)
The definition of the integral
Every lower sum is at most every upper sum. So by completeness the lower integral \(L(f) = \sup_P L(f, P)\) and the upper integral \(U(f) = \inf_P U(f, P)\) exist, and \(L(f) \le U(f)\).
Definition. \(f\) is (Riemann) integrable on \([a, b]\) if \(L(f) = U(f)\). The common value is \(\int_a^b f\), or \(\int_a^b f(x)\,dx\).
Riemann's original definition used sums \(\sum f(t_k)\Delta x_k\) with arbitrary sample points \(t_k \in [x_{k-1}, x_k]\), required to converge as the longest subinterval shrinks. Such a sum lies between \(L(f, P)\) and \(U(f, P)\), and the two definitions are equivalent.
Theorem (integrability criterion). A bounded \(f\) is integrable if and only if for every \(\varepsilon > 0\) there is a partition \(P\) with \(U(f, P) - L(f, P) < \varepsilon\).
Proof. If such partitions exist, then \(0 \le U(f) - L(f) \le U(f, P) - L(f, P) < \varepsilon\) for every \(\varepsilon\), so \(U(f) = L(f)\). Conversely, if \(U(f) = L(f)\), choose \(P_1\) with \(L(f, P_1) > L(f) - \frac{\varepsilon}{2}\) and \(P_2\) with \(U(f, P_2) < U(f) + \frac{\varepsilon}{2}\), by the approximation property of suprema and infima. Their common refinement \(P\) satisfies \(U(f, P) - L(f, P) < \varepsilon\). \(\blacksquare\)
Worked problem
Integrating x squared from the definition
Prove that \(\int_0^1 x^2\,dx = \frac{1}{3}\).
Show solution
- Let \(P_n\) divide \([0, 1]\) into \(n\) equal parts. Since \(x^2\) is increasing on \([0, 1]\), \(m_k = \frac{(k-1)^2}{n^2}\) and \(M_k = \frac{k^2}{n^2}\).
- So \(U(f, P_n) = \frac{1}{n^3}\sum_{k=1}^{n} k^2 = \frac{(n+1)(2n+1)}{6n^2}\) and \(L(f, P_n) = \frac{(n-1)(2n-1)}{6n^2}\), using \(\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}\).
- The difference is \(U - L = \frac{1}{n}\sum_{k=1}^{n} \frac{k^2 - (k-1)^2}{n^2} = \frac{1}{n}\), since the sum telescopes, and it tends to 0, so \(f\) is integrable. Both sums tend to \(\frac{1}{3}\), and \(L(f, P_n) \le \int_0^1 x^2 \le U(f, P_n)\), so the integral is \(\frac{1}{3}\).
Answer: \(\int_0^1 x^2\,dx = \frac{1}{3}\), computed without antiderivatives. Archimedes found the equivalent area of a parabolic segment in the third century BCE by a similar exhaustion argument.
Worked problem
A function that is not integrable
Show that Dirichlet's function \(D\) (1 on rationals, 0 on irrationals) is not integrable on \([0, 1]\).
Show solution
- Every subinterval contains rationals and irrationals by density, so \(m_k = 0\) and \(M_k = 1\) for every subinterval of every partition.
- Hence \(L(D, P) = 0\) and \(U(D, P) = 1\) for every \(P\), so \(L(D) = 0 \ne 1 = U(D)\).
Answer: Dirichlet's function is bounded but not Riemann integrable. The Lebesgue integral of MATH-445 handles it, giving 0, because the rationals have measure zero.
Which functions are integrable
Theorem. Every continuous function on \([a, b]\) is integrable.
Proof. By the extreme value theorem \(f\) is bounded, and by the Heine–Cantor theorem it is uniformly continuous. Let \(\varepsilon > 0\) and choose \(\delta\) with \(|f(x) - f(y)| < \frac{\varepsilon}{b - a}\) whenever \(|x - y| < \delta\). Take any partition \(P\) whose subintervals all have length less than \(\delta\). On each subinterval the extreme value theorem gives points where \(f\) attains \(M_k\) and \(m_k\), and they are less than \(\delta\) apart, so \(M_k - m_k < \frac{\varepsilon}{b - a}\). Therefore
\[U(f, P) - L(f, P) = \sum_{k=1}^{n} (M_k - m_k)\Delta x_k < \frac{\varepsilon}{b - a}\sum_{k=1}^{n} \Delta x_k = \varepsilon. \qquad \blacksquare\]
This proof is where uniform continuity is indispensable: a single \(\delta\) has to work on every subinterval at once.
Theorem. Every monotone function on \([a, b]\) is integrable.
Proof. Say \(f\) is increasing, and take \(n\) equal subintervals of length \(h = \frac{b - a}{n}\). Then \(M_k = f(x_k)\) and \(m_k = f(x_{k-1})\), so \(U - L = h\sum_{k=1}^{n}(f(x_k) - f(x_{k-1})) = h(f(b) - f(a))\), which tends to 0. \(\blacksquare\) A monotone function can have infinitely many jumps, so integrable functions need not be continuous.
Thomae's function from lesson 8 is integrable on \([0, 1]\) with integral 0, although it is discontinuous at every rational. The complete answer is Lebesgue's criterion of 1902: a bounded function on \([a, b]\) is Riemann integrable if and only if its set of discontinuities has measure zero, meaning it can be covered by intervals of arbitrarily small total length.
Properties of the integral
For integrable \(f\) and \(g\) on \([a, b]\) and a constant \(c\):
- Linearity: \(f + g\) and \(cf\) are integrable, with \(\int_a^b (f + g) = \int_a^b f + \int_a^b g\) and \(\int_a^b cf = c\int_a^b f\).
- Order: if \(f \le g\) then \(\int_a^b f \le \int_a^b g\). In particular \(\big|\int_a^b f\big| \le \int_a^b |f|\), and if \(m \le f \le M\) then \(m(b - a) \le \int_a^b f \le M(b - a)\).
- Additivity: for \(a < c < b\), \(f\) is integrable on \([a, c]\) and \([c, b]\) and \(\int_a^b f = \int_a^c f + \int_c^b f\).
Each property is proved from Darboux sums. For linearity, the supremum of \(f + g\) on a subinterval is at most the sum of the suprema, so \(U(f + g, P) \le U(f, P) + U(g, P)\), and similarly \(L(f + g, P) \ge L(f, P) + L(g, P)\); the integrability criterion then gives integrability and the formula. We define \(\int_b^a f = -\int_a^b f\), so that additivity holds for any order of \(a, b, c\).
The fundamental theorem of calculus
Theorem (fundamental theorem, part 1). Let \(f\) be integrable on \([a, b]\) and suppose \(F\) is continuous on \([a, b]\), differentiable on \((a, b)\), with \(F' = f\) there. Then \(\int_a^b f = F(b) - F(a)\).
Proof. Let \(P\) be any partition. On each \([x_{k-1}, x_k]\) the mean value theorem gives \(t_k\) with \(F(x_k) - F(x_{k-1}) = f(t_k)\Delta x_k\). Summing, the left sides telescope:
\[F(b) - F(a) = \sum_{k=1}^{n} f(t_k)\Delta x_k.\]
Since \(m_k \le f(t_k) \le M_k\), we get \(L(f, P) \le F(b) - F(a) \le U(f, P)\) for every \(P\). Taking the supremum and infimum over \(P\), \(L(f) \le F(b) - F(a) \le U(f)\). Both equal \(\int_a^b f\). \(\blacksquare\)
Theorem (fundamental theorem, part 2). Let \(f\) be integrable on \([a, b]\) and define \(G(x) = \int_a^x f\). Then \(G\) is uniformly continuous on \([a, b]\). If \(f\) is continuous at \(c \in (a, b)\), then \(G\) is differentiable at \(c\) with \(G'(c) = f(c)\).
Proof. Let \(|f| \le M\). For \(x < y\), \(|G(y) - G(x)| = \big|\int_x^y f\big| \le M(y - x)\), so \(G\) is Lipschitz. Now let \(f\) be continuous at \(c\) and \(\varepsilon > 0\). Choose \(\delta\) with \(|f(t) - f(c)| < \varepsilon\) for \(|t - c| < \delta\). For \(0 < |h| < \delta\),
\[\Big|\frac{G(c + h) - G(c)}{h} - f(c)\Big| = \Big|\frac{1}{h}\int_c^{c+h} (f(t) - f(c))\,dt\Big| \le \varepsilon,\]
since the integrand has absolute value less than \(\varepsilon\) on the interval of length \(|h|\). Hence \(G'(c) = f(c)\). \(\blacksquare\)
Together the two parts say that differentiation and integration are inverse operations: every continuous function has an antiderivative, namely \(\int_a^x f\), and integrals can be computed from any antiderivative. Newton and Leibniz discovered this in the 1660s and 1670s; Cauchy gave the first proof for continuous functions in 1823, and the proofs above follow the later form based on Darboux sums.
Part 1 needs \(f\) to be integrable as a hypothesis. Volterra constructed in 1881 a function \(F\), differentiable everywhere with a bounded derivative, whose derivative is not Riemann integrable. Problems like this led Lebesgue to his integral, for which the fundamental theorem holds whenever the derivative is bounded.
from fractions import Fraction as F
def darboux(f, a, b, n):
"""Exact lower and upper sums for a monotone f on n equal subintervals."""
h = (b - a) / n
xs = [a + k * h for k in range(n + 1)]
lo = sum(min(f(xs[k]), f(xs[k + 1])) * h for k in range(n))
hi = sum(max(f(xs[k]), f(xs[k + 1])) * h for k in range(n))
return lo, hi
sq = lambda x: x * x
print("f(x) = x^2 on [0, 1]; the integral is 1/3")
for n in (4, 16, 64, 256, 1024):
lo, hi = darboux(sq, F(0), F(1), n)
print(f"n = {n:5}: L = {str(lo):>17} U = {str(hi):>17} U - L = {str(hi - lo):>7} L <= 1/3 <= U: {lo <= F(1, 3) <= hi}")
cube = lambda x: x ** 3
lo, hi = darboux(cube, F(1), F(2), 1000)
print(f"\nf(x) = x^3 on [1, 2], n = 1000: L = {float(lo):.6f}, U = {float(hi):.6f}; F(2) - F(1) with F = x^4/4 is {float(F(16, 4) - F(1, 4))}")f(x) = x^2 on [0, 1]; the integral is 1/3 n = 4: L = 7/32 U = 15/32 U - L = 1/4 L <= 1/3 <= U: True n = 16: L = 155/512 U = 187/512 U - L = 1/16 L <= 1/3 <= U: True n = 64: L = 2667/8192 U = 2795/8192 U - L = 1/64 L <= 1/3 <= U: True n = 256: L = 43435/131072 U = 43947/131072 U - L = 1/256 L <= 1/3 <= U: True n = 1024: L = 698027/2097152 U = 700075/2097152 U - L = 1/1024 L <= 1/3 <= U: True f(x) = x^3 on [1, 2], n = 1000: L = 3.746501, U = 3.753501; F(2) - F(1) with F = x^4/4 is 3.75
The sums for \(x^2\) agree with the formulas of the worked example, and the gap \(U - L\) is exactly \(\frac{1}{n}\). For \(x^3\) on \([1, 2]\) the gap is \(\frac{f(2) - f(1)}{n} = 0.007\), and the sums bracket \(\frac{15}{4} = 3.75\), the value given by the fundamental theorem.
Looking back and ahead
The course has built calculus on a single axiom. Completeness, in lessons 2 and 3, gave suprema; suprema gave monotone convergence and Bolzano–Weierstrass in lesson 5, and the Cauchy criterion in lesson 6. Through sequences these became the intermediate value theorem in lesson 8 and the extreme value and Heine–Cantor theorems in lesson 9. The extreme value theorem gave Rolle's theorem and the mean value theorem in lesson 10, and the mean value theorem gave Taylor's theorem in lesson 11 and the fundamental theorem of calculus here. Every one of these results fails over the rational numbers.
MATH-341 Real Analysis II continues with sequences and series of functions, uniform convergence, power series, metric spaces, and the inverse and implicit function theorems in \(\mathbb{R}^n\). There the question that drove Riemann's thesis returns: when can limits, sums, derivatives and integrals be interchanged?
Common mistakes
MistakeAssuming every bounded function is integrable.
InsteadDirichlet's function has \(L = 0\) and \(U = 1\) for every partition.
MistakeAssuming integrable functions are continuous.
InsteadMonotone functions with jumps, and Thomae's function, are integrable.
MistakeUsing the fundamental theorem without checking that \(f\) is integrable.
InsteadPart 1 assumes integrability; Volterra's example shows a derivative can fail it.
MistakeClaiming \(G(x) = \int_a^x f\) is always differentiable with \(G' = f\).
InsteadThis needs \(f\) continuous at the point; for \(f = \operatorname{sgn}\), \(G(x) = |x|\) near 0, which has a corner.
MistakeComparing a lower sum and an upper sum from different partitions in the wrong direction.
InsteadEvery lower sum is at most every upper sum; pass to a common refinement to prove it.
Summary and key terms
- Lower and upper Darboux sums use infima and suprema on each subinterval; refining raises lower sums and lowers upper sums.
- \(f\) is integrable when \(\sup_P L(f, P) = \inf_P U(f, P)\), equivalently when \(U - L\) can be made smaller than any \(\varepsilon\).
- Continuous functions are integrable, by uniform continuity; monotone functions are integrable; Dirichlet's function is not.
- The integral is linear, order-preserving and additive over intervals.
- Fundamental theorem: \(\int_a^b F' = F(b) - F(a)\) when \(F'\) is integrable, and \(\frac{d}{dx}\int_a^x f = f(x)\) where \(f\) is continuous.
- Every major theorem of the course rests on the completeness axiom.
- Partition
- Finitely many points \(a = x_0 < \dots < x_n = b\).
- Darboux sums
- \(L(f, P) = \sum m_k \Delta x_k\) and \(U(f, P) = \sum M_k \Delta x_k\).
- Refinement
- A partition containing another.
- Riemann integrable
- Lower and upper integrals agree.
- Fundamental theorem of calculus
- Integration and differentiation are inverse operations.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Compute \(U(f, P_n)\) and \(L(f, P_n)\) for \(f(x) = x\) on \([0, 1]\) with \(n\) equal parts, and deduce \(\int_0^1 x = \frac{1}{2}\).
Show answer
\(U = \frac{n+1}{2n}\), \(L = \frac{n-1}{2n}\); both tend to \(\frac{1}{2}\) and \(U - L = \frac{1}{n}\).
Let \(f = 0\) on \([0, 1]\) except \(f(\frac{1}{2}) = 1\). Show \(f\) is integrable with integral 0.
Show answer
Every \(L = 0\). A partition with \(\frac{1}{2}\) inside a subinterval of length \(\varepsilon\) has \(U \le \varepsilon\).
Find \(G'(x)\) for \(G(x) = \int_0^{x^2} \cos t\,dt\).
Show answer
By part 2 and the chain rule, \(G'(x) = 2x\cos(x^2)\).
Prove that if \(f\) is continuous, \(f \ge 0\) and \(\int_a^b f = 0\), then \(f = 0\) on \([a, b]\).
Show answer
If \(f(c) > 0\), continuity gives \(f > \frac{f(c)}{2}\) on an interval of length \(\ell > 0\), so \(\int_a^b f \ge \frac{f(c)}{2}\ell > 0\).
Use Darboux sums to show \(\frac{1}{2} \le \int_1^2 \frac{dx}{x} \le 1\).
Show answer
With the trivial partition, \(m = \frac{1}{2}\) and \(M = 1\) on an interval of length 1.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.