Okay so I'm trying to determine whether $\int_{0}^{1}\left(\left\lceil \frac{1}{x} \right\rceil-\left\lfloor \frac{1}{x} \right\rfloor\right) \, dx$ converges and if so, to what value? So the function $\left\lceil \frac{1}{x} \right\rceil-\left\lfloor \frac{1}{x} \right\rfloor = 0$ when $x=\frac{1}{k}$ where $k$ is a natural number, and everywhere else $\left\lceil \frac{1}{x} \right\rceil-\left\lfloor \frac{1}{x} \right\rfloor = 1$ From there I split the integral:

\begin{align*} \int_0^1 \left(\left\lceil \frac{1}{x} \right\rceil-\left\lfloor \frac{1}{x} \right\rfloor\right) \, dx &= \int_{1/2}^1 1 \, dx +\int_{1/3}^{1/2} 1 \, dx + \int_{1/3}^{1/4} 1 \, dx + \cdots \\[10pt] &= (1 - 1/2) + (1/2 - 1/3) + (1/3 - 1/4) + \cdots \\[10pt] &= \lim_{m \to \infty} 1-1/m = 1\;. \end{align*}

Am I correct?

  • 2
    $\begingroup$ Very nice solution indeed...I could learn some thing new from it. $\endgroup$
    – DeepSea
    Jul 16, 2015 at 0:02

1 Answer 1


Yes, you are correct. But it is much faster if you say that $\lceil \frac{1}{x} \rceil-\lfloor \frac{1}{x} \rfloor$ is $1$ except in a set of measure zero. If you don't know what the meausre of a set is, just say that the set is countable. Then $$\int_0^1\left(\left\lceil \frac{1}{x}\right \rceil-\left\lfloor \frac{1}{x} \right\rfloor\right)dx=\int_0^11dx=1 $$

Your solution is still very nice.

  • $\begingroup$ Thank you. I haven't taken any measure theory yet, and I wasn't sure of it being correct because of the function taking on a value of 0 at all of the integrals bounds. I guess that's a nice explanation as to why my first equality holds. $\endgroup$
    – lamyvista
    Jul 16, 2015 at 0:07
  • $\begingroup$ The problem then is that this function might not be integrable in Riemann's sense. I think it is, but it is not obviuos, that is, if you are using Riemann's integrals, you should show that it is integrable. $\endgroup$
    – ajotatxe
    Jul 16, 2015 at 0:17
  • $\begingroup$ @ajotatxe: One can just use the theorem that says that a function is Riemann integrable on an interval iff its set of discontinuities has measure zero. I think most introductory analysis classes cover that theorem. $\endgroup$
    – shalop
    Jul 16, 2015 at 1:07
  • $\begingroup$ Dirichlet's function (rationals map to $0$ and irrationals to $1$) is not integrable in Riemann's sense. $\endgroup$
    – ajotatxe
    Jul 16, 2015 at 3:09
  • 1
    $\begingroup$ @ajotatxe: That is not a counterexample to my statement. Think about it: where is that function discontinuous? $\endgroup$
    – shalop
    Jul 16, 2015 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .