Evaluate $\int_0^1\int_0^1 \left\{ \frac{e^x}{e^y} \right\}dxdy$

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\ .$$