# Value of an integral involving the fractional part function

I have difficulties in evaluating the double integral defined in the following.

Let $$\left\{ t \right\} = t - \lfloor t \rfloor,$$
$t> 0$ be the fractional part function, where the function $\lfloor t \rfloor$ is representing the greatest integer contained in $t$, known also as the floor function. What is the value of: $$\int_{0}^{\alpha}\int_{0}^{\alpha} \left\{\dfrac{x}{y}\right\} \left\{\dfrac{y}{x}\right\} dx dy$$ where $0 < \alpha < 1$ ?

Thanks for help.

Use the change of variables $s = x/\alpha, t = x/y$.

Then

$$I = \int_{0}^{\alpha}\int_{0}^{\alpha} \left\{\dfrac{x}{y}\right\} \left\{\dfrac{y}{x}\right\} dx dy=\alpha^2\int_{0}^{1}\int_{s}^{\infty} \frac{s}{t^2}\left\{t\right\} \left\{\frac1{t}\right\} dt ds.$$

Integrating by parts, with $u = \int_{s}^{\infty} \frac{1}{t^2}\left\{t\right\} \left\{\frac1{t}\right\} dt$ and $dv = sds$,

\begin{align}I/\alpha^2 &= \left.\frac{s^2}{2}\int_{s}^{\infty} \frac{1}{t^2}\left\{t\right\} \left\{\frac1{t}\right\} dt\right|_{s=0}^{s=1}+ \frac1{2}\int_0^1\left\{s\right\} \left\{\frac1{s}\right\}ds\\ &=\frac{1}{2}\int_{1}^{\infty} \frac{1}{t^2}\left\{t\right\} \left\{\frac1{t}\right\} dt+ \frac1{2}\int_0^1 \left\{s\right\} \left\{\frac1{s}\right\}ds\\ &=\int_0^1\left\{s\right\} \left\{\frac1{s}\right\}ds.\end{align}

Now

\begin{align}\int_0^1\left\{s\right\} \left\{\frac1{s}\right\}ds &=\sum_{k=1}^{\infty}\int_{1/(k+1)}^{1/k}\left\{s\right\} \left\{\frac1{s}\right\}ds\\ &= \sum_{k=1}^{\infty}\int_{1/(k+1)}^{1/k}s (1/s-k)ds\\ &=\sum_{k=1}^{\infty}\left.\left(s- \frac{k}{2}s^2\right)\right|_{1/(k+1)}^{1/k}\\ &=\sum_{k=1}^{\infty}\left[\frac{1}{k(k+1)}-\frac{2k+1}{2k(k+1)^2}\right]\\ &=\frac1{2}\sum_{k=1}^{\infty}\frac{1}{k(k+1)^2}\\ &=\frac1{2}\sum_{k=1}^{\infty}\frac{1}{k(k+1)}-\frac1{2}\sum_{k=1}^{\infty}\frac{1}{(k+1)^2}\\ &=\frac1{2}\left[1- \left(\frac{\pi^2}{6}-1\right)\right].\end{align}

Finish this to get

$$I = \alpha^2\left(1 - \frac{\pi^2}{12}\right).$$

• I tried that. Integrating by x first, I obtained a more complicated integral, like a product between frac function and log. I think should be a trick for doing it... – Dea Feb 28 '15 at 20:22
• BTW, for x > y, frac(y/x) = y/x and for x < y, frac(x/y) = x/y. – Dea Feb 28 '15 at 20:31
• Thanks RRL, I appreciate your help. Dea – Dea Mar 1 '15 at 11:19
• @Dea: You're welcome. – RRL Mar 1 '15 at 18:03