---
title: Which Functions Are Integrable
module: The Riemann Integral
moduleNumber: 6
lessonNumber: 2
order: 602
summary: >
  The Cauchy criterion certifies whole classes of functions as integrable.
  Continuous functions are integrable because uniform continuity makes every
  oscillation cap small; monotone functions are integrable because their caps
  telescope to a single total jump; bounded functions with finitely many
  discontinuities are integrable by isolating the bad points. The Dirichlet
  function fails, and the Lebesgue criterion names the exact boundary.
topics: [The Riemann Integral]
draft: false
sources:
  - book: Shkoller
    ref: "§1.7 Monotonic and piecewise continuous functions are integrable"
  - book: Lebl
    ref: "§5.1 (continuity ⇒ integrable); §5.2 Properties of the integral (continuous, finitely-many-discontinuity, monotone cases)"
---

The [Cauchy criterion](/real-analysis/riemann-integration/darboux-integral) reduces
integrability to a single task: for each $\varepsilon > 0$, exhibit a partition on
which
$$
U(P,f) - L(P,f) = \sum_{i=1}^{n} (M_i - m_i)\,\Delta x_i < \varepsilon.
$$
The factor $M_i - m_i$ is the **oscillation** of $f$ on the $i$-th subinterval —
how far its values spread. Three structural properties each force this sum small
for a different reason, and one function shows what goes wrong when none of them
holds.

> **Definition (Oscillation).** The **oscillation** of a bounded $f$ on a set
> $S$ is
> $$
> \operatorname{osc}(f, S) \coloneqq \sup_{S} f - \inf_{S} f \;\ge\; 0.
> $$
> On the $i$-th subinterval, $M_i - m_i = \operatorname{osc}(f, [x_{i-1}, x_i])$,
> so the Cauchy criterion reads: $f$ is integrable if and only if for every
> $\varepsilon > 0$ some partition has
> $\sum_i \operatorname{osc}(f, [x_{i-1}, x_i])\,\Delta x_i < \varepsilon$.

Integrability is thus a statement about controlling oscillation on a fine enough
grid. Two mechanisms make the sum small: small individual oscillations
$\operatorname{osc}_i$, or small total width where the oscillation is large. Each
theorem below uses one of these.

Boundedness is not a detail that can be dropped. If $f$ were unbounded on some
subinterval, then $M_i$ or $m_i$ would be infinite and the corresponding Darboux
sum undefined; the entire theory presumes $f$ is bounded, and unbounded integrands
are treated only as
[improper integrals](/real-analysis/riemann-integration/log-exp-improper).

## Continuous functions

A continuous function on a closed bounded interval is uniformly continuous, so a
single $\delta$ controls the oscillation on every subinterval at once.[^lebl-cont]

> **Theorem (Continuous $\Rightarrow$ integrable).** If
> $f : [a,b] \to \mathbb{R}$ is continuous, then $f \in \mathcal{R}[a,b]$.

> **Proof.** On the compact interval $[a,b]$, $f$ is bounded and
> [uniformly continuous](/real-analysis/continuity/uniform-continuity). Given
> $\varepsilon > 0$, choose $\delta > 0$ so that $|x - y| < \delta$ implies
> $|f(x) - f(y)| < \tfrac{\varepsilon}{b-a}$. Take any partition of mesh below
> $\delta$, for instance the uniform one with $\tfrac{b-a}{N} < \delta$. On each
> subinterval $f$ attains its max and min (compactness again), so
> $M_i - m_i = f(\bar{x}) - f(\underline{x}) < \tfrac{\varepsilon}{b-a}$ for the
> maximizer $\bar{x}$ and minimizer $\underline{x}$. Then
> $$
> U(P,f) - L(P,f) = \sum_{i=1}^n (M_i - m_i)\,\Delta x_i
> < \frac{\varepsilon}{b-a}\sum_{i=1}^n \Delta x_i = \varepsilon. \qquad\square
> $$

$$
% caption: Uniform continuity bounds every oscillation cap by the same amount:
% caption: once the mesh is below $\delta$, each strip has height spread under
% caption: $\varepsilon/(b-a)$, so the caps sum to less than $\varepsilon$.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[acc, very thick] (0,1.4) .. controls (1.5,2.4) and (3,0.6) .. (4.8,1.8);
\foreach \a in {0,0.8,1.6,2.4,3.2,4.0}{
  \draw[black] (\a,0) -- (\a,2.7);
}
% highlight one strip cap
\fill[black] (1.6,1.9) rectangle (2.4,2.32);
\draw[<->, black] (2.65,1.9) -- (2.65,2.32);
\node[black, font=\footnotesize, anchor=west] at (2.72,2.11) {cap};
\draw[->] (-0.15,0) -- (5.1,0);
\draw[->] (0,-0.15) -- (0,2.95);
\draw[<->, acc] (0.0,-0.35) -- (0.8,-0.35);
\node[acc, font=\footnotesize, anchor=north] at (0.4,-0.35) {mesh};
\end{tikzpicture}
$$

## Monotone functions

A monotone function need not be continuous — it may have jumps — yet it is always
integrable. The reason is that its oscillation caps telescope.[^shk-mono]

> **Theorem (Monotone $\Rightarrow$ integrable).** If
> $f : [a,b] \to \mathbb{R}$ is monotone, then $f \in \mathcal{R}[a,b]$.

> **Proof (increasing case).** Then $f(a) \le f(x) \le f(b)$, so $f$ is bounded.
> On a uniform partition of mesh $\delta = \tfrac{b-a}{N}$, monotonicity gives
> $m_i = f(x_{i-1})$ and $M_i = f(x_i)$, so
> $$
> U(P,f) - L(P,f) = \sum_{i=1}^{N} \big(f(x_i) - f(x_{i-1})\big)\,\delta
> = \delta\,\big(f(b) - f(a)\big),
> $$
> because the inner sum telescopes. Choosing $N$ with
> $\delta < \tfrac{\varepsilon}{f(b) - f(a)}$ makes the gap below $\varepsilon$.
> $\square$

The picture is exact: the caps, whatever their widths, stack to a single column of
height $f(b) - f(a)$, and shrinking the mesh scales that column's contribution to
$U - L$ linearly. The bound is uniform in the shape of $f$: for any increasing
$f : [0,1] \to \mathbb{R}$ with $f(0) = 0$ and $f(1) = 1$, the uniform partition
into $N$ pieces gives $U(P,f) - L(P,f) = \tfrac1N$, no matter how the graph rises
between the endpoints. Ten thousand pieces force agreement to $10^{-4}$.

Monotonicity also permits infinitely many discontinuities. A monotone function can
jump at every rational and still be integrable, because its jumps are at most
[countably many](/real-analysis/continuity/limits-infinity-monotone) and their
total height is bounded by $f(b) - f(a)$; only finitely many exceed any fixed
threshold, so the caps that matter are few.

$$
% caption: For an increasing $f$ the oscillation caps (shaded) stack, without
% caption: overlap, into one column of total height $f(b) - f(a)$. Each cap is at
% caption: most one mesh wide, so the gap is bounded by that height times the mesh.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
% increasing staircase graph values at x=0..4
\draw[acc, very thick] (0,0.5) -- (1,1.3) -- (2,1.9) -- (3,2.3) -- (4,2.5);
% oscillation caps on each strip
\foreach \a/\lo/\hi in {0/0.5/1.3, 1/1.3/1.9, 2/1.9/2.3, 3/2.3/2.5}{
  \fill[acc!16] (\a,\lo) rectangle ({\a+1},\hi);
  \draw[black] (\a,\lo) rectangle ({\a+1},\hi);
}
\draw[->] (-0.15,0) -- (4.4,0);
\draw[->] (0,-0.15) -- (0,2.95);
\foreach \x/\lab in {0/x_0, 4/x_n}
  \draw (\x,0.07) -- (\x,-0.07) node[below, font=\footnotesize] {$\lab$};
% stacked column to the right
\begin{scope}[xshift=5.2cm]
  \foreach \lo/\hi in {0/0.8, 0.8/1.4, 1.4/1.8, 1.8/2.0}{
    \fill[acc!16] (0,\lo) rectangle (0.55,\hi);
    \draw[black] (0,\lo) rectangle (0.55,\hi);
  }
  \draw[<->, acc] (0.8,0) -- (0.8,2.0);
  \node[acc, font=\footnotesize, anchor=west, align=left] at (0.9,1.0) {total\\jump};
\end{scope}
\end{tikzpicture}
$$

> **Worked example (A staircase integrated).** The floor function
> $f(x) = \lfloor x \rfloor$ on $[0,3]$ is increasing, hence integrable, and its
> integral is computed by additivity. On $[0,1]$ the function equals $0$ except
> at the right endpoint, on $[1,2]$ it equals $1$ except at the right endpoint,
> and on $[2,3]$ it equals $2$ except at the right endpoint; a function agreeing
> with a constant except at one point has that constant's integral, by the
> [single-jump computation](/real-analysis/riemann-integration/darboux-integral).
> Hence
> $$
> \int_0^3 \lfloor x \rfloor \, \d x
> = \int_0^1 0 \, \d x + \int_1^2 1 \, \d x + \int_2^3 2 \, \d x
> = 0 + 1 + 2 = 3.
> $$
> Directly: on the uniform partition of $[0,3]$ into $3N$ pieces, the telescoping
> bound gives $U - L = \tfrac{3}{3N}\big(f(3) - f(0)\big) = \tfrac{3}{N}$, which
> confirms integrability without identifying the value.

## Piecewise-continuous and finitely-many-discontinuity functions

A few bad points are harmless as long as the function stays bounded. Trap each
discontinuity inside a strip so thin that its contribution to $U - L$ is
negligible, and integrate the continuous pieces elsewhere.

> **Theorem (Finitely many discontinuities).** A bounded
> $f : [a,b] \to \mathbb{R}$ with only finitely many discontinuities is Riemann
> integrable.[^lebl-disc]

> **Proof.** The supporting lemma is that a bounded function integrable on every
> $[a_n, b_n]$ with $a_n \downarrow a$ and $b_n \uparrow b$ is integrable on
> $[a,b]$, because the two end strips contribute at most $M \cdot (a_n - a)$ and
> $M \cdot (b - b_n)$, both vanishing.[^lebl-disc] Split $[a,b]$ at the
> discontinuities; on each open piece $f$ is continuous, hence integrable on
> every compactly-contained subinterval, hence integrable up to the endpoints by
> the lemma; additivity reassembles the whole.

> **Definition (Piecewise continuous / monotone).** $f : [a,b] \to \mathbb{R}$ is
> **piecewise continuous** (resp. **piecewise monotone**) if some partition
> $\{x_0, \dots, x_N\}$ makes $f$ continuous (resp. monotone) on each open
> subinterval $(x_{i-1}, x_i)$.

> **Theorem.** Every bounded piecewise-continuous or bounded piecewise-monotone
> function on $[a,b]$ is Riemann integrable.[^shk-mono]

$$
% caption: A bounded function with two jumps. Each discontinuity is boxed in a
% caption: thin strip whose oscillation contributes little; the continuous arcs
% caption: between the strips are integrable, and additivity glues the pieces.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
% arc 1
\draw[acc, very thick] (0,0.7) .. controls (0.8,1.4) and (1.4,1.5) .. (1.8,1.5);
% jump strip 1 around x=1.9
\fill[black] (1.8,0) rectangle (2.0,2.6);
% arc 2 (lower level)
\draw[acc, very thick] (2.0,0.8) .. controls (2.6,1.0) and (3.0,0.9) .. (3.4,0.85);
% jump strip 2 around x=3.5
\fill[black] (3.4,0) rectangle (3.6,2.6);
% arc 3 (rising)
\draw[acc, very thick] (3.6,1.6) .. controls (4.1,1.9) and (4.4,2.1) .. (4.8,2.3);
\draw[->] (-0.15,0) -- (5.1,0);
\draw[->] (0,-0.15) -- (0,2.8);
\node[black, font=\footnotesize, anchor=south] at (1.9,2.6) {thin};
\node[black, font=\footnotesize, anchor=south] at (3.5,2.6) {thin};
\end{tikzpicture}
$$

## Where integrability fails, and where it does not

Two bounded functions with dense discontinuities separate the concepts. The
Dirichlet function is not integrable; the Thomae function, discontinuous at every
rational, is.

> **Worked example (Dirichlet — not integrable).** $f(x) = 1$ on $\mathbb{Q}$, $0$
> elsewhere. Every subinterval meets both sets, so $m_i = 0$ and $M_i = 1$ on
> every partition, giving $L(P,f) = 0$, $U(P,f) = 1$, and a gap of $1$ that no
> refinement reduces. The discontinuity set is all of $[0,1]$.

> **Worked example (Thomae "popcorn" — integrable).** $f(0) = 1$ and, for $x > 0$,
> $f(x) = \tfrac{1}{k}$ if $x = \tfrac{m}{k}$ in lowest terms, $f(x) = 0$ for
> irrational $x$. This $f$ is discontinuous at every rational and continuous at
> every irrational, yet $\int_0^1 f = 0$: only finitely many points have value
> exceeding a given height, so those spikes fit under a total-area-$\varepsilon$
> collection of strips while the rest contributes nothing.[^lebl-disc]

$$
% caption: The Thomae function: at a rational $m/k$ in lowest terms the value is
% caption: $1/k$, so only finitely many spikes exceed any height. Every upper sum
% caption: can be made small, and the integral is zero despite dense
% caption: discontinuity.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[->] (-0.15,0) -- (5.2,0);
\draw[->] (0,-0.15) -- (0,2.4);
\node[font=\footnotesize, anchor=east] at (0,2.0) {$1$};
\draw[black, dashed] (0,2.0) -- (5.0,2.0);
% stems: x scaled by 5, height scaled by 2
% 1/2 -> h 1/2
\draw[acc, thick] (2.5,0) -- (2.5,1.0); \fill[acc] (2.5,1.0) circle (1.5pt);
% 1/3, 2/3 -> h 1/3
\draw[acc, thick] (1.667,0) -- (1.667,0.667); \fill[acc] (1.667,0.667) circle (1.3pt);
\draw[acc, thick] (3.333,0) -- (3.333,0.667); \fill[acc] (3.333,0.667) circle (1.3pt);
% 1/4, 3/4 -> h 1/4
\draw[acc, thick] (1.25,0) -- (1.25,0.5); \fill[acc] (1.25,0.5) circle (1.1pt);
\draw[acc, thick] (3.75,0) -- (3.75,0.5); \fill[acc] (3.75,0.5) circle (1.1pt);
% 1/5..4/5 -> h 1/5
\foreach \x in {1.0,2.0,3.0,4.0}{
  \draw[acc, thick] (\x,0) -- (\x,0.4); \fill[acc] (\x,0.4) circle (1.0pt);}
% 1/6,5/6 -> h 1/6
\draw[acc, thick] (0.833,0) -- (0.833,0.333); \fill[acc] (0.833,0.333) circle (0.9pt);
\draw[acc, thick] (4.167,0) -- (4.167,0.333); \fill[acc] (4.167,0.333) circle (0.9pt);
\foreach \x/\lab in {0/0, 2.5/{\tfrac12}, 5/1}
  \draw (\x,0.06) -- (\x,-0.06) node[below, font=\footnotesize] {$\lab$};
\end{tikzpicture}
$$

> **Proof (Thomae integrates to zero).** The count is direct. Every lower sum is
> $0$, since irrationals are dense and $f = 0$ there, so
> $\underline{\int_0^1} f = 0$. For the upper sum, fix $\varepsilon > 0$ and let
> $S = \{ x : f(x) \ge \tfrac{\varepsilon}{2} \}$; this is the finite set of
> fractions $\tfrac{m}{k}$ with $k \le \tfrac{2}{\varepsilon}$. Cover the points
> of $S$ by subintervals of total width below $\tfrac{\varepsilon}{2}$, where the
> integrand is at most $1$; on the rest of $[0,1]$ the integrand is below
> $\tfrac{\varepsilon}{2}$. Then $U(P,f) < \tfrac{\varepsilon}{2}\cdot 1 +
> 1 \cdot \tfrac{\varepsilon}{2} = \varepsilon$, so $\overline{\int_0^1} f = 0$ as
> well, and $\int_0^1 f = 0$.

The difference is measure-theoretic. Dirichlet is discontinuous everywhere; Thomae
is discontinuous only on $\mathbb{Q}$, a countable — hence measure-zero — set. That
distinction marks the boundary.

> **Theorem (Lebesgue criterion).** A bounded $f : [a,b] \to \mathbb{R}$ is
> Riemann integrable if and only if its set of discontinuities has **measure
> zero**: for every $\varepsilon > 0$ it can be covered by countably many
> intervals of total length below $\varepsilon$.[^lebesgue]

Every class above is a special case: continuous functions have empty discontinuity
set, monotone functions have at most
[countably many jumps](/real-analysis/continuity/limits-infinity-monotone),
finitely-many-discontinuity functions have finite sets, and Thomae's set
$\mathbb{Q}$ is countable — all measure zero. Dirichlet's discontinuity set has
measure equal to the whole interval, so it alone fails.

| Class | Why the caps stay small | Integrable? |
| --- | --- | --- |
| Continuous | uniform continuity bounds every cap by $\varepsilon/(b-a)$ | yes |
| Monotone | caps telescope to total jump $f(b) - f(a)$ | yes |
| Finitely many jumps | isolate each in a vanishing strip; integrate the rest | yes |
| Thomae (popcorn) | finitely many spikes above any height; measure-zero jumps | yes |
| Dirichlet | oscillation $1$ on every subinterval; discontinuous everywhere | no |

[^lebl-cont]: **Lebl**, _Basic Analysis I_, §5.2 — a continuous function on $[a,b]$ is integrable (Lemma 5.2.7), proved from uniform continuity and the compactness attainment of max and min on each subinterval.
[^shk-mono]: **Shkoller**, _MAT125B Lecture Notes_, §1.7 — monotone functions are integrable (Thm. 1.20), continuous functions are integrable (Thm. 1.21), and piecewise-continuous or bounded piecewise-monotone functions are integrable (Thm. 1.27).
[^lebl-disc]: **Lebl**, _Basic Analysis I_, §5.2 — the interior-integrability lemma (Lemma 5.2.8), integrability of bounded functions with finitely many discontinuities (Thm. 5.2.9), and the Thomae/popcorn function as an integrable function discontinuous on a dense set (Exercise 5.2.11).
[^lebesgue]: The Lebesgue criterion for Riemann integrability is a measure-theoretic result outside the Darboux development used here; stated without proof. See H. L. Royden and P. M. Fitzpatrick, _Real Analysis_, 4th ed., for the standard treatment: <https://en.wikipedia.org/wiki/Riemann_integral#Integrability>.
