Evaluate $\int_0^1\int_0^1 \left\{ \frac{e^x}{e^y} \right\}dxdy$
I want compute this integral $$\int_0^1\int_0^1 \left\{ \frac{e^x}{e^y} \right\}dxdy, $$ where $ \left\{ x \right\} $ is the fractional part function.
Following PROBLEMA 171, Prueba de a), last paragraph of page 109 and firts two paragraphs of page 110,here in spanish, I say the case $k=1$.
When I take $x=\log u$ and $y=\log v$ then I can show that $$\int_0^1\int_0^1 \left\{ \frac{e^x}{e^y} \right\}dxdy=\int_1^e\int_1^e \left\{ \frac{x}{y} \right\}\frac{1}{xy}dxdy=I_1+I_2$$ since following the strategy in cited problem and take $t=\frac{1}{u}$ $$I_1:=\int_1^e\int_1^x \left\{ \frac{x}{y} \right\}\frac{1}{xy}dydx=\int_1^e\frac{1}{x}\int_{\frac{1}{x}}^1 \left\{ \frac{1}{t} \right\}\frac{dt}{t}dx=\int_1^e\int_1^x\frac{ \left\{ u \right\} }{u}dudx,$$ and since if there are no mistakes $$ \int_1^x\frac{ \left\{ u \right\} }{u}du = \begin{cases} x-1-\log x, & \text{if $1\leq x<2$} \\ 1+\log 2+(x-2)-2\log x, & \text{if $2\leq x\leq e$} \end{cases}$$ then $$I_1=\int_1^2\frac{1}{x}(x-1-\log x)dx+\int_1^2\frac{1}{x}(1+\log 2+(x-2)-2\log x)dx,$$ It is $I_1=-3+\log 2-\frac{\log^22}{2}+e$. On the other hand following the cited problem, since $y>x$ then $ \left\{ \frac{x}{y} \right\}= \frac{x}{y}$ and the second integral is computed as $$I_2:=\int_1^e\int_x^e \left\{ \frac{x}{y} \right\}\frac{1}{xy}dydx=\int_1^e\int_x^e \frac{x}{y} \frac{1}{y^2}dydx.$$ Thus I've computed $I_2=\frac{1}{e}$.
Question. I would to know if my computations with the fractional part function $ \left\{ x \right\} $ were rights (the evaluation of $ \int_1^x\frac{ \left\{ u \right\} }{u}du$ and $I_1$). Can you compute $$\int_0^1\int_0^1 \left\{ \frac{e^x}{e^y} \right\}^kdxdy$$ for the case $k=1$? (At least this case to see it as a proof verification of my computations; your are welcome if you provide us similar identities for integers $k\geq 1$, as in the cited problem). Thanks in advance.
Here is a solution:
By WP we have $\{x\}=x-\lfloor x \rfloor$. Then $$\iint_0^1 \left \{ \text{e}^x\text{e}^{-y} \right \} dxdy=\iint_0^1 \text{e}^x\text{e}^{-y} dxdy-\iint_0^1 \left \lfloor \text{e}^x\text{e}^{-y} \right \rfloor dxdy.$$
We also have $\left \lfloor \text{e}^x\text{e}^{-y} \right \rfloor =$ $0$ $(x<y)$, 2 $(y<x-\ln 2), 1$ (otherwise), in the region $0\leq x \leq 1$ $0 \leq y \leq 1$. Then $$\iint_0^1 \left \lfloor \text{e}^x\text{e}^{-y} \right \rfloor dxdy = \int_{0}^{1}\int_{x}^{1} 0\, dydx + \int_{0}^{1}\int_{0}^{x}1\,dydx + \int_{\ln 2}^{1}\int_{0}^{x-\ln 2}1\,dydx\\= 1 -\ln 2 + (\ln 2)^2 /2. $$
Putting this together gives $$\iint_0^1 \left \{ \text{e}^x\text{e}^{-y} \right \} dxdy= 1/\text{e} + \text{e} +\ln 2 - (\ln 2)^2/2 - 3 \approx 0.54 $$
Now we can use the same technique, along with the binomial formula, to find the solution to the general case. I assume $n \geq 1$. We have $$\iint_0^1 \left \{ \text{e}^{x-y} \right \}^n dxdy=\iint_0^1 \left ( \text{e}^{x-y}-\lfloor \text{e}^{x-y} \rfloor\right )^n dxdy\\ = \sum_{k=0}^n \begin{pmatrix}n \\ k\end{pmatrix} (-1)^k \iint_0^1 \text{e}^{(n-k)(x-y)}\lfloor \text{e}^{x-y} \rfloor^k dxdy.$$
We have $\lfloor\text{e}^{x-y} \rfloor^k$ = $0$ ($x<y$), $2^k$ ($y<x-\ln 2$), 1 (otherwise) in the domain $0\leq x \leq 1$, $0 \leq y \leq 1$, except for the case $k=0$ in which case $\lfloor\text{e}^{x-y} \rfloor^k=1$. Then
$$ \iint_0^1 \left \{ \text{e}^{x-y} \right \}^n dxdy = \sum_{k=0}^n \begin{pmatrix}n \\ k\end{pmatrix} (-1)^k \left [ \int_{0}^{1}\int_{0}^{x}\text{e}^{(n-k)(x-y)}dydx + \delta_{k,0}\int_{0}^{1}\int_{x}^{1}\text{e}^{(n-k)(x-y)}dydx\\ + (2^k-1)\int_{\ln 2}^{1}\int_{0}^{x-\ln 2}\text{e}^{(n-k)(x-y)}dydx \right],$$ where $\delta_{a,b}$ is the Kronecker delta. Solving the integrals and simplifying gives:
$$ \iint_0^1 \left \{ \text{e}^{x-y} \right \}^n dxdy = \frac{(-1)^n}{2}(2^n-2^{n+1}\ln 2 + [2^n-1][\ln 2]^2+\ln 4)+\frac{n-1+\text{e}^{-n}}{n^2}+\sum_{k=0}^{n-1} \begin{pmatrix}n \\ k\end{pmatrix} \frac{(-1)^k}{(n-k)^2} \left [ (k-n-1+\text{e}^{n-k}) + (2^k-1)(2\text{e})^{-k}(2^k\text{e}^n+2^n\text{e}^k[k-1+n(\ln 2 -1)-k\ln 2]) \right]$$
Let $u=x-y$ and $v=x+y$. Then $$ \left\{(x,y):0\le x,y\le1\right\} =\left\{(u,v):0\le\left|u\right|\le1,\left|v-1\right|\le1-\left|u\right|\right\} $$ The change of coordinates makes things a bit easier $$ \begin{align} &\int_0^1\int_0^1\left\{\frac{e^x}{e^y}\right\}\,\mathrm{d}x\,\mathrm{d}y\\ &=\int_0^1\int_0^1\left\{e^{x-y}\right\}\,\mathrm{d}x\,\mathrm{d}y\\ &=\frac12\int_{-1}^0\int_{-u}^{2+u}\left\{e^u\right\}\,\mathrm{d}v\,\mathrm{d}u +\frac12\int_0^1\int_u^{2-u}\left\{e^u\right\}\,\mathrm{d}v\,\mathrm{d}u\\ &=\int_{-1}^0(1+u)\left\{e^u\right\}\,\mathrm{d}u +\int_0^1(1-u)\left\{e^u\right\}\,\mathrm{d}u\\ &=\int_0^1(1-u)\left\{e^{-u}\right\}\,\mathrm{d}u +\int_0^1(1-u)\left\{e^u\right\}\,\mathrm{d}u\\ &=\int_0^1(1-u)\,e^{-u}\,\mathrm{d}u +\int_0^{\log(2)}(1-u)\left(e^u-1\right)\,\mathrm{d}u +\int_{\log(2)}^1(1-u)\left(e^u-2\right)\,\mathrm{d}u\\ &=\int_0^1(1-u)\left(e^{-u}+e^u\right)\,\mathrm{d}u -\int_0^{\log(2)}(1-u)\,\mathrm{d}u -2\int_{\log(2)}^1(1-u)\,\mathrm{d}u\\[3pt] &=\left[(2-u)e^u+ue^{-u}\right]_0^1 -\left[u-\tfrac12u^2\right]_0^{\log(2)} -2\left[u-\tfrac12u^2\right]_{\log(2)}^1\\[6pt] &=\left[(2-u)e^u+ue^{-u}\right]_0^1 -\left[u-\tfrac12u^2\right]_0^1 -\left[u-\tfrac12u^2\right]_{\log(2)}^1\\[9pt] &=2\cosh(1)-2-\tfrac12-\tfrac12+\log(2)-\tfrac12\log(2)^2\\[12pt] &=2\cosh(1)-3+\log(2)-\tfrac12\log(2)^2 \end{align} $$
The following solution is similar to SDiv's, but he was four minutes faster.
1. Note that $\{e^u\}=e^u$ when $u<0$, that $\{e^u\}=e^u-1$ when $0\leq u<\log2$, and that $\{e^u\}=e^u-2$ when $\log 2\leq u\leq 1$.
2. One has $$\int_{[0,1]^2} e^{x-y}\>{\rm d}(x,y)=\int_0^1 e^x\>dx\cdot\int_0^1 e^{-y}\>dy={(e-1)^2\over e}\ .$$ 3. From the value obtained in 2 we have to subtract the area of the triangle $x-y\geq0$ as well as the area of the triangle $x-y\geq\log2$, in order to take care of the observations made in 1. It follows that $$\int_{[0,1]^2} \left\{{e^x\over e^y}\right\}\>{\rm d}(x,y)={(e-1)^2\over e}-{1\over2}-{1\over2}(1-\log2)^2\ .$$