How to integrate $\int\limits_0^1 \left(-1\right)^{^{\left\lfloor\frac{1}{x}\right\rfloor}} dx$?

As my title says, I need help integrating with floor functions,

$$\int\limits_0^1 \left(-1\right)^{^{\left\lfloor\frac{1}{x}\right\rfloor}} dx$$

What does this even mean exactly? How would approach this?

Essentially, you have this: $$\int_0^1 \left(-1\right)^{^{\left\lfloor\frac{1}{x}\right\rfloor}} dx=\int_\frac{1}{2}^1\left(-1\right)^1dx+\int_\frac{1}{3}^\frac{1}{2}\left(-1\right)^2dx+\int_\frac{1}{4}^\frac{1}{3}\left(-1\right)^3dx+\int_\frac{1}{5}^\frac{1}{4}\left(-1\right)^4dx+\ldots$$ $$=\left(-1+\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)+ \left(-\frac{1}{3}+\frac{1}{4}\right)+\left(\frac{1}{4}-\frac{1}{5}\right)+\ldots$$ $$=-1+2\left(\frac{1}{2}-\frac{1}{3}+\frac{1}{4}-\frac{1}{5}+\ldots\right)$$ $$=-1+2(1-\log2)=1-\log 4$$

• This helps a lot. Thanks! :) – Javin S Dec 23 '15 at 19:48

One may write \begin{align*} \displaystyle \int_{0}^{1} \left(-1\right)^{\large ^{\left\lfloor\frac{1}{x}\right\rfloor}} \mathrm{d}x &= \sum_{k=1}^{\infty}\int_{\frac{1}{k+1}}^{\frac{1}{k}} \left(-1\right)^{\large ^{\left\lfloor\frac{1}{x}\right\rfloor}} \mathrm{d}x \\ &= \sum_{k=1}^{\infty} \int_{k}^{k+1} \left(-1\right)^{\large ^{\left\lfloor u\right\rfloor}} \: \frac{\mathrm{d} u}{u^{2}} \\ &= \sum_{k=1}^{\infty} \int_{k}^{k+1} \left(-1\right)^{{k}} \: \frac{\mathrm{d} u}{u^{2}} \\ &= \sum_{k=1}^{\infty}\frac{\left(-1\right)^{{k}}}{k (k+1)} \\ &= \sum_{k=1}^{\infty}\frac{\left(-1\right)^k}{k}+\sum_{k=1}^{\infty}\frac{\left(-1\right)^{k+1}}{k+1}\\ &=-\log 2-\log 2+1 \end{align*} where we have used the standard identity $$\log(1+x)=-\sum_{k=1}^{\infty}\frac{\left(-1\right)^k}{k}x^k, \quad |x|<1,$$ when $x \to 1^-$ (via Abel's theorem).

Finally,

$$\int_{0}^{1} \left(-1\right)^{\large ^{\left\lfloor\frac{1}{x}\right\rfloor}} \mathrm{d}x = 1-2 \log 2.$$

• (+1), I think that you could integrate just after the third equality! :) – H. R. Dec 23 '15 at 19:24
• @H.R. Right! I will edit. Thanks. – Olivier Oloa Dec 23 '15 at 19:25
• One may just see it from $$(0,1]=\cup_{k=1}^{\infty}[1/(k+1),1/k]$$ No? – Olivier Oloa Dec 23 '15 at 19:31
• A proof: each element in the left hand side set is in the right hand side set, and vice versa. – Olivier Oloa Dec 23 '15 at 19:37
• The infinite union of sets has been defined as given here:en.wikipedia.org/wiki/Union_%28set_theory%29#Arbitrary_unions But all these concepts are not so trivial... – Olivier Oloa Dec 23 '15 at 22:03