# Evaluate $\int_{0}^{[x]}\left(\int_{0}^{[t]}[s]-\left[s-\frac{1}{2}\right] \mathrm{d}s\right) \mathrm{d}t$

Evaluate $$\int_{0}^{[x]}\left(\int_{0}^{[t]}[s]-\left[s-\frac{1}{2}\right] \mathrm{d}s\right) \mathrm{d}t$$

Where $$[x]$$ denotes the greatest integer function . But I don't know how to approach this kind of problem. So I want to know how to think to solve this type of problems.
If there are more than one way to approach, I would like to gather the knowledge.
• +1 for the interesting question. Attention SPOILER ! After some careful inspection based on graphic representations of intergrand and integral I found this simple solution for the integral $i(x) = \frac{1}{4} (\lfloor x\rfloor -1) \lfloor x\rfloor$. – Dr. Wolfgang Hintze Mar 13 at 8:33
Since $$x$$ only appears in a floor function in a limit of the outer integral, we can assume $$x$$ is an integer: $$\int_0^x\int_0^{[t]}[s]-[s-1/2]\,ds\,dt$$ $$[s]-[s-1/2]$$ is $$0$$ when the fractional part of $$s$$ is greater than $$\frac12$$ and $$1$$ when it is not. Since the bounds of the inner integral are also integers, it simply evaluates to half of the distance between the bounds: $$=\int_0^x\frac12[t]\,dt$$ Now assuming $$x>0$$ (the other case is similar), $$t$$ assumes the same value for each of $$x$$ intervals of length $$1$$: the values from $$0$$ to $$x-1$$ inclusive. Thus the integral becomes a finite sum. $$=\frac12(0+1+\dots+(x-1))=\frac{x(x-1)}4$$ The final answer is $$\frac{[x]([x]-1)}4$$.