TITLE: Compute $\int_0^1\int_0^1...\int_0^1\lfloor{x_1+x_2+...+x_n}\rfloor dx_1dx_2...dx_n$
QUESTION [8 upvotes]: Compute $\int_0^1\int_0^1...\int_0^1\lfloor{x_1+x_2+...+x_n}\rfloor dx_1dx_2...dx_n$ where the integrand consists of the floor (or greatest integer less than or equal) function.
The case $n=1,2,3$ all can be solved geometrically. Actually the case $n=3$ is pretty fun where you get to dissect the unit cube. I guess the cases $n\ge4$ don't have useful geometric interpretations... so how to approach them (well, you still get to divide the sum into different cases: sum between 0 and 1, between 1 and 2, ..., between $n-1$ and $n$, and multiply the floor of the sum with the measure of the corresponding region) ?

REPLY [7 votes]: This can be done entirely through regular algebra and calculus.
Consider that
$$
\int_0^1 \lfloor x+a\rfloor dx = \int_a^{\lceil a\rceil}\lfloor a\rfloor dx+\int_{\lceil a\rceil}^{a+1} \lceil a\rceil dx \\
= \lfloor a\rfloor(\lceil a\rceil-a)+\lceil a\rceil(a+1-\lceil a\rceil)\\
= (\lceil a\rceil -\lfloor a\rfloor)a + \lceil a\rceil(\lfloor a\rfloor+1-\lceil a\rceil)\\
=a
$$
(if $a\in\mathbb{Z}$, then $\lceil a\rceil - \lfloor a\rfloor = 0$ and $\lfloor a\rfloor+1-\lceil a\rceil = 1$; otherwise, $\lceil a\rceil - \lfloor a\rfloor = 1$ and $\lfloor a\rfloor+1-\lceil a\rceil = 0$ - in either case, the result is $a$)
As such, only the inner integral involves the floor function, and we get
$$
\int_0^1\!\!\! \cdots\! \int_0^1\!\!\! \int_0^1 \lfloor x_1\!\!+\!x_2\!\!+\!\cdots\!+\!x_n\rfloor dx_1 dx_2 \cdots dx_n= \int_0^1\!\!\! \cdots\! \int_0^1 (x_2\!\!+\!\cdots\!+\!x_n)dx_2\cdots dx_n
$$
Which can be easily evaluated as
$$
1^{n-2}\int_0^1 x_2 dx_2+1^{n-2}\int_0^1 x_3 dx_3 + \cdots = \frac{n-1}2
$$