I'm trying to find a general solution for $\displaystyle\iint_{S}[[x+y]] dA$ where $S=[a,b] \times [c,d]$ and $[[x]]$ is the greatest integer function. I know that if $a,b,c,d \in \mathbb{Z}$, then the answer is just $\frac{(d-c)(b-a)(a+b+c+d-1)}{2}$ (proven below), but how do I account for the extra volume when $a,b,c,d\in \mathbb{R}$?
By looking at the function itself, it's clear that the volume of the region above $S=[a,a+1]\times[b,b+1]$ is $a+b+\frac{1}{2}$ (the volume of the rectangular prism is $a+b$ while the volume of the triangular prism on top of it is $\frac{1}{2}$).
Therefore, the total volume is: $$\displaystyle\sum_{y=c}^{d-1}\sum_{x=a}^{b-1} x+y+\frac{1}{2}=\sum_{y=c}^{d-1}\frac{b^2-a^2}{2}+(b-a)y=\frac{(d-c)(b-a)(a+b+c+d-1)}{2}$$
One other question I'd like to confirm is that $\displaystyle\underset{S}{\int \cdots \int} [[x_1+x_2+\cdots+x_n]] dx_1 \cdots dx_n$ over $S=[i_1,i_2] \times [i_3,i_4] \times \cdots \times [i_{2n-1},i_{2n}]$ is: $$\displaystyle\frac{1}{2}\left(\sum_{j=1}^{2n}i_j\right)\left(\prod_{k=1}^{n}(i_{2k}-i_{2k-1})\right)$$
Is this true if $i_k\in\mathbb{Z}$ for all $k\in[0,n]$? Can this, too, be extended to all reals?