I want to show
$$\int_{a}^{b} \left\lfloor x \right\rfloor dx + \int_{a}^{b} \left\lfloor -x \right\rfloor dx=a-b$$
I know that \begin{equation} \left\lfloor -x \right\rfloor = \begin{cases} -\left\lfloor x \right\rfloor & \text{if } x \in \mathbb{Z} \\ -\left\lfloor x \right\rfloor-1 & \text{if } x \notin \mathbb{Z}. \end{cases} \end{equation}
In this case do I use $-\left\lfloor x \right\rfloor$ or $-\left\lfloor x \right\rfloor-1$? I think I am confused about some definitions, one of the solutions said $\left\lfloor x \right\rfloor$ is constant on the open subintervals of the partition $$P=\left(a, \left\lfloor a \right\rfloor+1 \cdots \left\lfloor a \right\rfloor + \left\lfloor b-a \right\rfloor, b\right)$$ and since there are no integers in the open subintervals of P, then we would use $-\left\lfloor x \right\rfloor - 1$.. I don't think I quite understand this point here. I know I can solve it and say \begin{align*} \int_{a}^{b} \left\lfloor x \right\rfloor dx + \int_{a}^{b} \left\lfloor -x \right\rfloor dx= \int_{a}^{b} \left\lfloor x \right\rfloor dx + \int_{a}^{b} -\left\lfloor x \right\rfloor -1 \; dx= a-b \end{align*}
but I don't understand why.