# Showing $\int_{a}^{b} \left\lfloor x \right\rfloor dx + \int_{a}^{b} \left\lfloor -x \right\rfloor dx=a-b$

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 $$$$\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}$$$$

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.

What happens at the integers does not matter since they have content 0. Suppose $$n < x < n + 1.$$ then $$\lfloor x \rfloor = n$$, and $$-n > x > -(n+1)$$, so $$\lfloor -x \rfloor = -(n+1)$$. Adding gives $$\lfloor x\rfloor + \lfloor -x \rfloor = -1$$.
Because you can simply ignore the intergers, sice they do not contribute to the integral. Think of a rectangle with height 1 and width 0, it has zero area, and finitely (in the interval $$(a,b)$$) many of them still sum to zero.