Evaluate
$\int_{-1}^{3} [ x+ \frac{1}{2}] dx$ where $[.]$ denotes the greatest integer less than or equal to $x$.
My attempt : $\int_{-1}^{3} [ x+ \frac{1}{2}] dx= \int_{-1}^{0} [x +1/2]dx + \int_{0}^{1} [x +1/2]dx + \int_{1}^{2} [x +1/2]dx + \int_{2}^{3} [x +1/2]dx = - 1 + 0 +1 +2=2$
Is it true ?
No.
$\int_{-1}^3\lfloor x+\frac12\rfloor dx$
$$=\int_{-1}^{-1/2}-1 dx+\int_{-1/2}^{1/2} 0 dx + \int_{1/2}^{3/2} 1 dx + \int_{3/2}^{5/2} 2 dx + \int_{5/2}^3 3 dx $$
$= -\frac12+1+2+\frac32=4$