Integration of some floor functions Can anyone please answer the following questions ?
1) $\int\left \lfloor{x}\right \rfloor dx$
2) $\int$ $ \left \lfloor{\sin(x)}\right \rfloor $ $dx$
3) $\int_0^2$ $\left \lfloor{x^2+x-1}\right \rfloor$ $dx$
4) $\int_o^\pi$ $\left \lfloor{x(1+\sin(\pi x)}\right \rfloor$
Also can anyone please make me understand the way in which to proceed in these types of sums?
$\left \lfloor{x}\right \rfloor$ is the floor function
Thanks

$1)$ The area under the graph of $\lfloor{x}\rfloor$ is $0+1+2 +\cdots+(x-1)$ so $$\int{\lfloor{x}\rfloor} \, dx =\frac{x(x-1)}{2}$$ $2)$ The graph of $\lfloor{\sin(x)}\rfloor$ alternates between $0$ and $-1$ every $\pi$ values, so every $2\pi$ values the integral will $-1$. So $$\int\big\lfloor{\sin(x)}\big\rfloor \, dx = -\lfloor{\frac{x}{2\pi}}\rfloor-\frac{\operatorname{sgn}\big((x\bmod{2\pi}) - \pi\big)+1}{2}$$
$3)$ $$\int_{0}^{2}\Big\lfloor\left(x^{2}+x-1\right)\Big\rfloor \, dx\approx1.726$$
$4)$ $$\int_0^\pi  \big\lfloor x(1+\sin(\pi x)\big\rfloor \, dx\approx4.530$$
