$$\int_1^{\infty} \frac{\lbrace x\rbrace-\frac{1}2}{x} dx$$ Here $\lbrace\cdot\rbrace$ denotes the fractional part.

I found this challenging integral, and I'm curious about the solution, so I decided to do some efforts to solve it, but sadly I didn't, any hints?


\begin{align} \int_1^{\infty} \frac{\lbrace x\rbrace-\frac{1}2}{x} dx&=\int_1^{\infty} \frac{1\lbrace x\rbrace-1}{2x} dx\\ &=\int_1^{\infty}\frac{\lbrace x\rbrace}{x}-\frac{1}{2x}dx\\ &=\int_1^\infty \frac{x-\lfloor x\rfloor-1}{x}-\frac{1}{2x}dx\\ &=\int_1^\infty \frac{x-\lfloor x\rfloor-1}{x} dx -\int_1^\infty \frac{dx}{2x} \end{align} I thought about this property: $$\int_0^\infty \varphi (x) dx=\lim_{a\to \infty} \int_0^a \varphi(x) dx$$ So I applied it only for the second fraction because its antiderivative was easy enough, and here's what I've got: \begin{align} \int_1^\infty \frac{dx}{2x}&=\lim_{a\to \infty} \int_1^a \frac{dx}{2x}\\ &=\lim_{a\to \infty}\frac{\ln (x)}{2}\bigg\vert_0^a\\ &=\lim_{a\to \infty}\frac{\ln (a)}2 -\frac{\ln (0)}{2} \end{align} And here I felt that I'm wrong I can't get $\infty -\infty$, So any thoughts or hints, I'll be thankfull!

  • 3
    $\begingroup$ $\int dx/x$ is divergent, what is important is $\{x\}-1/2$ change sign, so it ressembles $\sum (-1)^n/n$. You should try $\sum u_n$ where $u_n=\int_{n}^{n+1}f(x)dx=\int_n^{n+1/2}+\int_{n+1/2}^{n+1}$. $\endgroup$
    – zwim
    Jul 26, 2020 at 15:50
  • $\begingroup$ Sure I'll try, thanks for the tip! $\endgroup$
    – euler_med
    Jul 26, 2020 at 15:51
  • $\begingroup$ @StubbornAtom Sorry, I'll edit it right now! $\endgroup$
    – euler_med
    Jul 26, 2020 at 16:16

3 Answers 3


This function is not integrable in the Lebesgue sense, so you can only evaluate the Cauchy principal value.

That is, what you want to evaluate is the limit $$\lim_{M \rightarrow +\infty} \int_1^M \frac{\{x\}-\frac12}xdx.$$

It is easy to see that it suffices to take the limit for integer values of $M$. We first compute, for every positive integer $k$: $$\int_k^{k + 1}\frac{\{x\}-\frac12}xdx = \int_k^{k + 1}\frac{x- k-\frac12}xdx = 1 - \left(k + \frac 1 2\right) (\ln(k + 1) - \ln k).$$

We then take the sum: $$\int_1^{M + 1} \frac{\{x\}-\frac12}xdx = \sum_{k = 1}^M\left(1 - \left(k + \frac 1 2\right) (\ln(k + 1) - \ln k)\right).$$

This simplifies to: $$M - \left(M + \frac12\right)\ln(M + 1) + \ln M!$$ which, by Stirling's formula, converges to $\ln\frac{\sqrt{2\pi}}e\approx-0.0810614668$.

  • 1
    $\begingroup$ Nicely done! I couldn't figure out how to evaluate the sum there. $\endgroup$
    – Ty.
    Jul 26, 2020 at 16:11
  • $\begingroup$ thanks for your brilliant answer, I just don't get why isn't integrable as you said in the Lebesgue sense? $\endgroup$
    – euler_med
    Jul 26, 2020 at 16:14
  • 1
    $\begingroup$ If a function $f$ is Lebesgue integrable, then it is absolutely integrable, i.e. the function $|f|$ is also integrable. This is obviously not the case here. $\endgroup$
    – WhatsUp
    Jul 26, 2020 at 16:34
  • $\begingroup$ @WhatsUp Okay, I got it now! Thanks so much for the answer! $\endgroup$
    – euler_med
    Jul 26, 2020 at 17:17
  • 5
    $\begingroup$ This isn't a Cauchy principal value. It's just an improper integral. $\endgroup$ Jul 26, 2020 at 18:34

Not to take away from @Whatsup's clever answer, but I did it another way.

Start with the integral formula, valid for $\Re(s)>0$: $$ \zeta(s) = \frac{s}{s-1} - s\int _1^{\infty}\frac{\{x\}}{x^{s+1}}\,dx $$Introduce the $1/2$ in the integrand: $$ \zeta(s) = \frac{s}{s-1} - s\int _1^{\infty}\frac{\{x\}-1/2+1/2}{x^{s+1}}\,dx $$$$ \zeta(s) = \frac{s}{s-1} - s\int _1^{\infty}\frac{\{x\}-1/2}{x^{s+1}}\,dx - \frac{1}{2} $$Solve for the integral: $$ \int _1^{\infty}\frac{\{x\}-1/2}{x^{s+1}}\,dx = \frac{-2 (s-1) \zeta (s)+s+1}{2 (s-1) s} $$Take the limit as $s\to 0^+$; the LHS exists by Dirichlet's Test and the RHS can be evaluated using L'Hôpital's Rule. $$ \int _1^{\infty}\frac{\{x\}-1/2}{x}\,dx =\lim_{s\to 0^+} \frac{-2 (s-1) \zeta (s)+s+1}{2 (s-1) s} $$ $$ =\lim_{s\to 0^+} \frac{-2 (s-1) \zeta '(s)-2 \zeta (s)+1}{4s-2} $$Using $\zeta(0)=-1/2$ and $\zeta'(0)=-1/2\log(2 \pi)$ as shown here gives the same result. $$ =\lim_{s\to 0^+} \frac{-2 (s-1) (-1/2\log(2 \pi))-2 (-1/2)+1}{4s-2} $$ $$ =1/2\log(2 \pi)-1= \log(\sqrt{2\pi}/e) $$

  • 1
    $\begingroup$ Ohh, Nice approach! thank you for the intuitive solution (+1) from me! $\endgroup$
    – euler_med
    Jul 26, 2020 at 18:39
  • 1
    $\begingroup$ Of course, my pleasure. $\endgroup$
    – Integrand
    Jul 26, 2020 at 18:54
  • $\begingroup$ You deserve the correct answer, I'm really fascinated by your answer! $\endgroup$
    – euler_med
    Jul 26, 2020 at 18:55
  • $\begingroup$ It needs to be proved that $$\lim_{s \to 0^+} \int_1^\infty \frac {\{x\} - \frac 1 2} {x^{s + 1}} dx = \int_1^\infty \frac {\{x\} - \frac 1 2} x dx,$$ the existence of the rhs is not a sufficient condition for that. $\endgroup$
    – Maxim
    Jul 26, 2020 at 22:42
  • $\begingroup$ @Maxim Dirichlet's Test works here; the integral of numerator is uniformly bounded and $1/x$ is monotonic and decreasing to zero. $\endgroup$
    – Integrand
    Jul 26, 2020 at 22:45

Euler-Maclaurin formula applied to $\log N!$ gives

$$ \begin{aligned} \log N! &=\int_1^N\log x\mathrm dx+{\log N\over2}+\int_1^N{\overline B_1(x)\over x}\mathrm dx \\ &=\left(N+\frac12\right)\log N-N+1+\int_1^N{\overline B_1(x)\over x}\mathrm dx \end{aligned} $$

However, according to Stirling's approximation, we have

$$ \log N!=\left(N+\frac12\right)\log N-N+\frac12\log2\pi+\mathcal O\left(\frac1N\right) $$

Consequently as $N\to\infty$ we get

$$ \int_1^\infty{\overline B_1(x)\over x}\mathrm dx=\int_1^\infty{\{x\}-1/2\over x}\mathrm dx=-1+\frac12\log2\pi $$


You must log in to answer this question.

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