# $I=\int_{-1}^2 \{|x-1| - \lfloor x \rfloor \}dx$

$$I=\int_{-1}^2 \{|x-1| - \lfloor x \rfloor \}dx$$ I need to find value of $I$ . Here $\{\}$ represents fractional function that is $$\{x\}= x - [x]$$ so I broke the integral in integer limits $$I=\int_{-1}^0 \{-x+1 - 1\}dx + \int_{0}^1 \{-x+1 \}dx + \int_{1}^2 \{x-1 - 1\}dx$$ which comes $$1/2+1/2+1/2$$ but answer does not matches

You did not get the right integrand. Let $y = |x-1| - \lfloor x \rfloor$ then

$$\{y\} = y - \lfloor y \rfloor \implies \{|x-1| - \lfloor x \rfloor \} = |x-1| - \lfloor x \rfloor - \lfloor |x-1| - \lfloor x \rfloor \rfloor$$