One time I was bored and played around a bit with integrals and wolfram alpha and tested the following integral:


Note: The result at my laptop shows: $ \int_0^1 \lceil { x\sin({1 \over x})} \rceil \,dx = 1 - \frac{\log(4)}{2\pi} $

I was a bit surprised seeing this and wondered, if this result makes any sense and if yes, if there were an explanation, where $\frac{\log(4)}{2\pi}$ exactly comes from. The numbers look too neat to be random, so there might be a way to derive those values directly without using the help of a calculator etc.

As always: Thanks in advance for any constructive answer/comment.

  • 1
    $\begingroup$ I think the multiplicative factor of $x$ is redundant (sorry you'll have to paste the link): wolframalpha.com/inpu/?i=integral_0^1+ceil%28sin%28%2F%29%29 $\endgroup$ Jul 29, 2015 at 12:24
  • $\begingroup$ yeah, the factor is redundant, however somehow I never got an precise value for the integral.. (a friend of mine also got weird result for this integral and other values (which CAN'T be correct, guess wolfram alpha is a bit buggy in this regard) $\endgroup$
    – Imago
    Jul 29, 2015 at 12:27
  • $\begingroup$ It would be interesting to try the multiplicative factor for different intervals. In general I don't think it would be redundant. $\endgroup$ Jul 29, 2015 at 12:33
  • $\begingroup$ The one I don't understand, why is this is question so well received? Am I overlooking something? $\endgroup$
    – Imago
    Jul 29, 2015 at 17:40
  • 2
    $\begingroup$ @Imago First you try something that puzzles you and does not fit your understanding of the universe, then you start to think why, get intuition for a hidden law of the nature and search for a possible explanation - this is very scientific. Curiosity is a positive thing. $\endgroup$
    – A.Γ.
    Jul 29, 2015 at 18:02

2 Answers 2


The ceiling function gives one iff $\sin(1/x)> 0$, otherwise zero. So the integral is just a sum of interval lengths where the sin is positive, i.e. $$ \left(1-\frac{1}{\pi}\right)+\left(\frac{1}{2\pi}-\frac{1}{3\pi}\right)+\left(\frac{1}{4\pi}-\frac{1}{5\pi}\right)+\ldots=1-\frac{1}{\pi}\left(1-\frac12+\frac13-\frac14+\ldots\right)=\\ =1-\frac{1}{\pi}\ln(1+1)=1-\frac{\ln(2)}{\pi}. $$

  • $\begingroup$ It looks like your inequality should be strict. $\;$ $\endgroup$
    – user57159
    Jul 29, 2015 at 16:48
  • $\begingroup$ @RickyDemer Yes, thanks. $\endgroup$
    – A.Γ.
    Jul 29, 2015 at 17:08

Note that $x \sin(1/x) \in [-1, 1]$ when $x \in [0,1]$ so your integral is the volume of the set on which $x \sin(1/x) > 0$. This set is

$$\left(\frac{1}{\pi}, 1\right) \cup \bigcup_{k=1}^{\infty}\left(\frac{1}{\pi (2k+1)}, \frac{1}{2\pi k}\right)$$ and its volume is $$1 - \frac{1}{\pi} + \sum_{k=1}^{\infty}\left(\frac{1}{2\pi k} - \frac{1}{\pi (2k+1)}\right)=1+\sum_{k=1}^{\infty} \frac{(-1)^k}{\pi k} = 1 - \frac{\log(2)}{\pi}.$$

  • $\begingroup$ Wait... $x\sin(x) \in [0,1]$ since both x and sin are in $[0,1]$ on $x\in [0,1]$, maybe you mean $x\sin\left(\frac{1}{x}\right) \in [-1,1]$, or am I confused? $\endgroup$ Jul 29, 2015 at 17:38
  • $\begingroup$ @mathreadler. Thanks for pointing that out. That was a persistent typo. Fixed. $\endgroup$
    – WimC
    Jul 29, 2015 at 21:48

You must log in to answer this question.

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