TITLE: Evaluate the integral : $\int_0^\infty (-1)^{ \lfloor x \sin x \rfloor } dx$
QUESTION [6 upvotes]: How to evaluate the following integral?
$$ \int_0^\infty (-1)^{ \lfloor x \sin x  \rfloor } dx$$
I have no idea how to calculate this improper integral. Maybe I have to use some property of floor functions to reduce $ (-1)^{ \lfloor x \sin x  \rfloor } $ to something simpler I can work with, but I don't know what property.
Thanks in advance for help!
Edit: I reached the following,
For every $ k \in \mathbb{Z_+} $ we have that $ \int_0^{\pi \cdot (k+1)} (-1)^{ \lfloor x \sin x  \rfloor } dx = \sum_{m=0}^k \int_{\pi \cdot m}^{ \pi \cdot (m+1)} (-1)^{ \lfloor x \sin x  \rfloor } =  \{ x = t + \pi \cdot m , dx = dt \} = \sum_{m=0}^k \int_{0}^{ \pi} (-1)^{ \lfloor ( t+\pi \cdot m)\cdot( \sin(t+\pi \cdot m) )  \rfloor } dt = \sum_{m=0}^k \int_{0}^{ \pi} (-1)^{ \lfloor ( t+\pi \cdot m)\cdot( \sin(\pi \cdot m )\cos(t) + \sin(t)\cos(\pi \cdot m)  )  \rfloor } dt = \sum_{m=0}^k \int_{0}^{ \pi} (-1)^{ \lfloor ( t+\pi \cdot m)\cdot  (-1)^m \cdot \sin(t)   \rfloor } dt $ .
If I can get a formula for the last integral from $ 0 $ to $ \pi $ I'll have an answer whether the integral from $ 0 $ to $ \infty $ converges or not.

REPLY [2 votes]: (Too long for a comment)
1. Using the Fourier series
$$ (-1)^{\lfloor x \rfloor} = \frac{4}{\pi} \sum_{k=1,3,5,\ldots} \frac{\sin(k\pi x)}{k} \quad\text{for } x \in \mathbb{R}\setminus\mathbb{Z} $$
that converges uniformly over any compact subset of $\mathbb{R}\setminus\mathbb{Z}$,
it follows that
\begin{align*}
\int_{0}^{R} (-1)^{\lfloor x\sin x\rfloor} \, \mathrm{d}x
&= \frac{4}{\pi} \sum_{k=1,3,5,\ldots} \frac{1}{k} \int_{0}^{R} \sin(k \pi x\sin x) \, \mathrm{d}x \\
&= \frac{4}{\pi} \sum_{k=1,3,5,\ldots} \frac{1}{k^2} \int_{0}^{kR} \sin(\pi x\sin (x/k)) \, \mathrm{d}x
\end{align*}
I suspect that the following holds:
$$ \sum_{k=1,3,5,\ldots} \frac{1}{k^2} \sup_{R \geq 0} \left| \int_{0}^{kR} \sin(\pi x\sin (x/k)) \, \mathrm{d}x \right| < \infty $$
If this is the case, then the above formula shows that $\int_{0}^{\infty} (-1)^{\lfloor x \sin x \rfloor} \, \mathrm{d}x$ converges as an improper Riemann integral and admits the series representation
$$ \int_{0}^{R} (-1)^{\lfloor x\sin x\rfloor} \, \mathrm{d}x
= \frac{4}{\pi} \sum_{k=1,3,5,\ldots} \frac{1}{k^2} \int_{0}^{\infty} \sin(\pi x\sin (x/k)) \, \mathrm{d}x. $$
But of course, proving (or disproving) the above claim would be quite hard.
2. Here is a numerical simulation of the map $r \mapsto \int_{0}^{r} (-1)^{\lfloor x \sin x \rfloor} \, \mathrm{d}x$ for $0 \leq r \leq 100\pi$.

The graph is generated by finding all the points of discontinuity of $x \mapsto \lfloor x \sin x \rfloor$ in the range $0 \leq x \leq 100\pi$. So I believe it is much more precise than simply throwing the function $(-1)^{\lfloor x \sin x \rfloor}$ to a numerical integrator.