Maths WorkshopMaths problems with full solutions
Exercise 739Calculus › Single-variable calculus › Integration › Riemann integralL1Added 2 Nov 2026

Darboux sums of the Dirichlet function

#Riemann integrability#Darboux sums#density

Statement

Let f:[1,2]→Rf:[1,2]\to\mathbb{R} with f(x)=0f(x)=0 if xx is rational and f(x)=1f(x)=1 if xx is irrational. For a partition σ\sigma compute the lower sum sσ(f)s_\sigma(f) and the upper sum Sσ(f)S_\sigma(f). Determine s(f)=sup⁡σsσ(f)s(f)=\sup_\sigma s_\sigma(f) and S(f)=inf⁡σSσ(f)S(f)=\inf_\sigma S_\sigma(f), and decide whether ff is Riemann integrable.

Hint

Both rationals and irrationals are dense. What are the infimum and the supremum of ff on any subinterval of positive length?

Show solutionHide solution

Solution

Definitions. For a partition 1=x0<x1<⋯<xn=21=x_0<x_1<\dots<x_n=2, let mi=inf⁡[xi−1,xi]fm_i=\inf_{[x_{i-1},x_i]}f and Mi=sup⁡[xi−1,xi]fM_i=\sup_{[x_{i-1},x_i]}f. Then
sσ(f)=∑mi(xi−xi−1),Sσ(f)=∑Mi(xi−xi−1).s_\sigma(f)=\sum m_i(x_i-x_{i-1}),\qquad S_\sigma(f)=\sum M_i(x_i-x_{i-1}).

Values. Each subinterval has positive length and so contains a rational (where f=0f=0) and an irrational (where f=1f=1). Hence mi=0m_i=0 and Mi=1M_i=1 for all ii, and
sσ(f)=0,Sσ(f)=∑(xi−xi−1)=1.s_\sigma(f)=0,\qquad S_\sigma(f)=\sum(x_i-x_{i-1})=1.

Conclusion. s(f)=0s(f)=0 and S(f)=1S(f)=1. They differ, so ff is not Riemann integrable.

Remark. No refinement of the partition helps: the function oscillates fully on every tiny interval. This example motivated Lebesgue's theory, in which this function has integral 11, since the rationals have measure zero.