Tutorials › Calculus I › A Dense Set of Discontinuities Can Prevent Integrability

Riemann Sums and the Integral · Tutorial 953 of 1495

A Dense Set of Discontinuities Can Prevent Integrability

See how rational and irrational inputs in every interval force a fixed gap between upper and lower sums, preventing Riemann integrability.

Intermediate 9 min read

What You'll Learn

  • Define the function that is one on rational inputs and zero on irrational inputs.
  • Explain why every nonempty interval contains both rational and irrational numbers.
  • Calculate upper and lower Darboux sums for arbitrary partitions.
  • Apply the upper-lower sum criterion to prove nonintegrability on every interval of positive length.
  • Use contrasting tagged sums to identify a common error about tag choices.
  • Distinguish this example from cases where a dense set of discontinuities alone settles integrability.

A Function That Oscillates in Every Interval

A bounded function can fail to be Riemann integrable even though its values never become large. The key issue is not the size of its values, but whether they vary within every subinterval, no matter how small that subinterval is.

Consider the function that takes the value \(1\) at every rational number and the value \(0\) at every irrational number. Rational and irrational numbers both occur inside every interval of positive length. Consequently, every part of a partition contains both function values. We will see that this forces an unchanged positive gap between the upper and lower Darboux sums.

Definition: Define \(f:\mathbb{R}\to\mathbb{R}\) by $$ f(x)= \begin{cases} 1,&x\in\mathbb{Q},\\ 0,&x\notin\mathbb{Q}. \end{cases} $$ Here \(\mathbb{Q}\) is the set of rational numbers, so \(x\notin\mathbb{Q}\) means that \(x\) is irrational. On any interval, \(f\) is bounded because \(0\leq f(x)\leq 1\).

Why Both Values Occur in Every Interval

The argument depends on two density facts. A set is dense in \(\mathbb{R}\) if every nonempty open interval contains at least one element of that set. Both \(\mathbb{Q}\) and the irrational numbers are dense in \(\mathbb{R}\).

Fact: If \(u<v\), then the open interval \((u,v)\) contains both a rational number and an irrational number.

Here is a justification of both claims. For the rational case, choose a positive integer \(n\) large enough that \(n(v-u)>1\). Let \(m=\lfloor nu\rfloor+1\), where \(\lfloor nu\rfloor\) is the greatest integer not exceeding \(nu\). Then \(m>nu\), while \(m\leq nu+1<nv\). Thus \(nu<m<nv\), and division by \(n\) gives \(u<m/n<v\). The number \(m/n\) is rational.

For the irrational case, first note that \(\sqrt{2}\) is irrational: if \(\sqrt{2}=p/q\) in lowest terms, then \(p^2=2q^2\), so \(p\) is even; substituting \(p=2k\) shows \(q^2=2k^2\), so \(q\) is even too, contradicting that \(p/q\) is in lowest terms. By the rational case, there is a rational number \(r\) in \((u-\sqrt{2},v-\sqrt{2})\). Then \(r+\sqrt{2}\) lies in \((u,v)\) and is irrational: if it were rational, subtracting the rational \(r\) would make \(\sqrt{2}\) rational.

Upper and Lower Values on a Partition

Let \([a,b]\) be an interval with \(a<b\). A partition \(P\) of \([a,b]\) is a finite sequence \(a=x_0<x_1<\cdots<x_n=b\). Its subintervals are \([x_{i-1},x_i]\), and the width of the \(i\)-th subinterval is \(\Delta x_i=x_i-x_{i-1}\).

For a bounded function \(f\), let \(M_i\) be its supremum on the \(i\)-th subinterval and \(m_i\) its infimum there. The upper Darboux sum \(U(f,P)\) uses the supremum on each subinterval; the lower Darboux sum \(L(f,P)\) uses the infimum:

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

Every subinterval of positive width contains an open interval, and that open interval contains both a rational number and an irrational number. On the rational input, \(f\) equals \(1\); on the irrational input, it equals \(0\). Since \(f\) only takes the values \(0\) and \(1\), its supremum on each subinterval is \(1\) and its infimum is \(0\).

Key observation: For every partition of \([a,b]\) with \(a<b\), every subinterval has supremum \(1\) and infimum \(0\). The conclusion does not depend on the widths of the subintervals.

Worked Example: Upper and Lower Sums on \([0,1]\)

Take the partition \(P=\{0,\frac14,\frac12,\frac34,1\}\). It has four subintervals, each of width \(\frac14\). In each subinterval, the supremum of \(f\) is \(1\) and the infimum is \(0\). Therefore,

$$ U(f,P) =1\cdot\frac14+1\cdot\frac14+1\cdot\frac14+1\cdot\frac14 =\frac14+\frac14+\frac14+\frac14 =1, $$ $$ L(f,P) =0\cdot\frac14+0\cdot\frac14+0\cdot\frac14+0\cdot\frac14 =0. $$

The gap is \(U(f,P)-L(f,P)=1-0=1\), equal to the interval length. As a check on the arithmetic, the four widths sum to \(\frac14+\frac14+\frac14+\frac14=1\); multiplying their sum by the common supremum \(1\) gives the upper sum, and multiplying by the common infimum \(0\) gives the lower sum.

Worked Example: An Arbitrary Partition of \([-1,2]\)

Let \(P=\{-1,0,\frac12,2\}\). Its three widths are

$$ \Delta x_1=0-(-1)=1,\qquad \Delta x_2=\frac12-0=\frac12,\qquad \Delta x_3=2-\frac12=\frac32. $$

Each subinterval has supremum \(1\) and infimum \(0\). Hence

$$ U(f,P)=1\cdot 1+1\cdot\frac12+1\cdot\frac32 =1+\frac12+\frac32=3, $$ $$ L(f,P)=0\cdot 1+0\cdot\frac12+0\cdot\frac32=0. $$

The gap is \(3\). Checking against the interval length, the widths sum to \(1+\frac12+\frac32=3=2-(-1)\), as expected. The upper sum is this total width, and the lower sum is zero.

The Gap Never Shrinks

For any partition of \([a,b]\), the upper and lower values on every subinterval are \(M_i=1\) and \(m_i=0\). Substituting these values into the definitions gives

$$ U(f,P)=\sum_{i=1}^{n}1\cdot\Delta x_i =\sum_{i=1}^{n}(x_i-x_{i-1}) =b-a, $$ $$ L(f,P)=\sum_{i=1}^{n}0\cdot\Delta x_i=0. $$

The equality \(\sum_{i=1}^{n}(x_i-x_{i-1})=b-a\) follows by cancellation: each interior partition point appears once with a positive sign and once with a negative sign, leaving \(x_n-x_0=b-a\). Thus \(U(f,P)-L(f,P)=b-a\) for every partition, including partitions with very small mesh.

Upper-lower sum criterion: A bounded function on \([a,b]\) is Riemann integrable if and only if, for every \(\varepsilon>0\), there is a partition \(P\) such that \(U(f,P)-L(f,P)<\varepsilon\).

For the function under consideration, if \(a<b\), the gap is always \(b-a>0\). Choose \(\varepsilon=(b-a)/2\). No partition can have gap less than \(\varepsilon\), because every partition has gap \(b-a\). The criterion therefore fails, proving that \(f\) is not Riemann integrable on any interval of positive length.

Theorem: The function \(f(x)=1\) for rational \(x\) and \(f(x)=0\) for irrational \(x\) is not Riemann integrable on \([a,b]\) whenever \(a<b\).

Proof Through Tagged Riemann Sums

The same obstruction can be seen using tagged Riemann sums. For a partition \(P\), choose one tag \(t_i\in[x_{i-1},x_i]\) for each subinterval. The tagged sum is \(\sum_{i=1}^{n}f(t_i)\Delta x_i\). Since rational and irrational numbers are both dense, each tag can be chosen to be rational, or each can be chosen to be irrational.

Worked Example: Two Tagged Sums with the Same Partition

Divide \([0,2]\) into \(n\) equal subintervals. Each width is \(\Delta x_i=2/n\), so the mesh, the largest subinterval width, is \(2/n\). First choose a rational tag in every subinterval. Each function value is \(1\), and the tagged sum is

$$ \sum_{i=1}^{n}f(t_i)\Delta x_i =\sum_{i=1}^{n}1\cdot\frac{2}{n} =n\cdot\frac{2}{n} =2. $$

Now keep the same partition and choose an irrational tag in every subinterval. Each function value is \(0\), so the tagged sum is

$$ \sum_{i=1}^{n}f(t_i)\Delta x_i =\sum_{i=1}^{n}0\cdot\frac{2}{n} =0. $$

These calculations hold for every positive integer \(n\). As \(n\) increases, the mesh \(2/n\) tends to zero, but the two allowed tagged sums remain \(2\) and \(0\). Their difference is \(2\), the length of the interval. This verifies directly that refining the partition cannot make all tagged sums approach a common value.

A Common Mistake: Trusting One Choice of Tags

A rational tag can be selected in every subinterval, so it is tempting to compute the tagged sums \(2\) above and conclude that the integral is \(2\). That conclusion uses only one kind of tag. Riemann integrability requires the tagged sums to approach a common limit as the mesh tends to zero, not merely that one selection of tags has a limit.

The correction is to consider another permitted selection for exactly the same partitions: choose irrational tags. Those sums are all \(0\), rather than \(2\). Since both selections are valid for arbitrarily small mesh and remain separated by \(2\), there is no common tagged-sum limit. Likewise, the upper-lower criterion cannot be satisfied because its gap remains fixed at \(2\) on \([0,2]\).

Discontinuity and the Role of the Example

This function is discontinuous at every point of \([a,b]\). At a rational point, the function value is \(1\), but irrational points with function value \(0\) occur arbitrarily close. At an irrational point, the function value is \(0\), but rational points with function value \(1\) occur arbitrarily close. Density ensures such points exist in every interval around the point; at an endpoint, the same reasoning uses intervals on the side inside \([a,b]\).

The example shows that boundedness alone does not guarantee Riemann integrability, and that dense oscillation can obstruct it throughout an interval. It does not say that every bounded function with a dense set of discontinuities must fail to be integrable: integrability depends on the sizes and distribution of oscillations, not simply on whether discontinuities occur densely. Here the decisive fact is stronger: every subinterval has the full range of values \(0\) and \(1\), so no partition can reduce the upper-lower gap.

Check Your Understanding

Use the density of the rational and irrational numbers and the definitions of the upper and lower sums to answer these questions.

  1. What are the supremum and infimum of \(f\) on any interval of positive width?
  2. For a partition \(P\) of \([a,b]\), why does \(U(f,P)=b-a\)?
  3. Why is the lower sum \(L(f,P)=0\) for every such partition?
  4. Which condition in the upper-lower sum criterion fails when \(a<b\)?
  5. Why do rational tags alone not establish a tagged-sum limit?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon