The Riemann Integral

The definite integral is usually introduced as a limit of sums. To make that rigorous — and to say which functions have an integral at all — we squeeze the area between two approximations that never lie about it: one that always undershoots and one that always overshoots.

Chop [a, b] with a partition P = \{a = x_0 < x_1 < \dots < x_n = b\}, with widths \Delta x_i = x_i - x_{i-1}. On each subinterval let

m_i = \inf_{[x_{i-1}, x_i]} f, \qquad M_i = \sup_{[x_{i-1}, x_i]} f.

The lower sum stacks rectangles at the floor of f; the upper sum stacks them at the ceiling:

L(f, P) = \sum_{i=1}^{n} m_i\,\Delta x_i, \qquad U(f, P) = \sum_{i=1}^{n} M_i\,\Delta x_i.

Since m_i \le M_i, always L(f, P) \le U(f, P): the true area is trapped between them.

Centrepiece: refinement, the criterion, and why continuity suffices

Step A — refining a partition raises L and lowers U

Add one new point c inside a subinterval [x_{i-1}, x_i], splitting it into a left piece [x_{i-1}, c] and a right piece [c, x_i].

A1 — the infimum can only go up on a smaller set. The inf over a sub-piece is \ge the inf over the whole, so writing m', m'' for the two pieces' infima, m' \ge m_i and m'' \ge m_i. Hence the lower sum's contribution can only increase:

m_i\,\Delta x_i = m_i(c - x_{i-1}) + m_i(x_i - c) \le m'(c - x_{i-1}) + m''(x_i - c).

A2 — symmetrically, the supremum can only go down, so the upper sum's contribution can only decrease. Refining therefore gives

L(f, P) \le L(f, P') \quad\text{and}\quad U(f, P') \le U(f, P) \qquad (P' \text{ a refinement of } P).

A3 — every lower sum is below every upper sum. Given any two partitions P_1, P_2, refine to their common refinement P_1 \cup P_2 and chain the inequalities:

L(f, P_1) \le L(f, P_1 \cup P_2) \le U(f, P_1 \cup P_2) \le U(f, P_2).

So the set of lower sums sits entirely below the set of upper sums. The two then have a clean gate between them.

Step B — the definition: \sup L = \inf U

Define the lower integral and upper integral by taking the best approximation from each side:

\underline{\int_a^b} f = \sup_P L(f, P), \qquad \overline{\int_a^b} f = \inf_P U(f, P).

By Step A3 always \underline{\int} f \le \overline{\int} f. We call f Riemann integrable exactly when these agree, and then their common value is the integral:

\underline{\int_a^b} f = \overline{\int_a^b} f =: \int_a^b f.

Cauchy criterion (the practical test). Squeezing the two integrals together is the same as making a single upper–lower gap small. f is integrable iff for every \varepsilon > 0 there is a partition P with

U(f, P) - L(f, P) = \sum_{i=1}^{n} (M_i - m_i)\,\Delta x_i < \varepsilon.

Step C — a continuous f on [a,b] is integrable

C1 — upgrade continuity to uniform continuity. By Heine–Cantor, a function continuous on the closed bounded interval [a, b] is uniformly continuous: given \varepsilon > 0, there is one \delta > 0 with |x - y| < \delta \Rightarrow |f(x) - f(y)| < \dfrac{\varepsilon}{b - a}.

C2 — pick a fine enough partition. Choose P with every \Delta x_i < \delta. On each subinterval the oscillation is small: because f is continuous it attains its max and min there (EVT), at points no more than \delta apart, so

M_i - m_i = f(\text{argmax}) - f(\text{argmin}) < \frac{\varepsilon}{b - a}.

C3 — assemble the Cauchy gap. Sum the oscillations against the widths:

U(f, P) - L(f, P) = \sum_i (M_i - m_i)\,\Delta x_i < \frac{\varepsilon}{b - a} \sum_i \Delta x_i = \frac{\varepsilon}{b - a}\,(b - a) = \varepsilon.

The Cauchy criterion is met for every \varepsilon, so a continuous function on [a, b] is Riemann integrable. Uniform continuity is precisely the lever: it makes the oscillations M_i - m_i small everywhere at once.

Let f be bounded on [a, b]. Then:

Riemann integration has a hard limit. Consider the indicator of the rationals on [0, 1],

\mathbf{1}_{\mathbb{Q}}(x) = \begin{cases} 1, & x \in \mathbb{Q}, \\ 0, & x \notin \mathbb{Q}. \end{cases}

Every subinterval, however tiny, contains both a rational and an irrational (both are dense). So on each piece m_i = 0 and M_i = 1, giving

L(f, P) = 0 \;\text{for all } P, \qquad U(f, P) = 1 \;\text{for all } P,

hence \underline{\int} = 0 \ne 1 = \overline{\int}: the lower and upper integrals never meet, and \mathbf{1}_{\mathbb{Q}} is not Riemann integrable. The fix is to stop chopping the domain into intervals and instead chop the range into level sets, measuring how big each level set is — that is the Lebesgue integral, for which \int_0^1 \mathbf{1}_{\mathbb{Q}} = 0 because the rationals have measure zero.

Watch the staircases close

For f(x) = 1 + x - \tfrac14 x^2 on [0, 4], the upper rectangles (each at the subinterval's ceiling M_i) overshoot, and the lower rectangles (at the floor m_i) undershoot. Increase the number of partition points: the gap U - L shrinks toward 0, and both staircases converge on the same area.