Let $f: R \in R$ be given by
$f(x)=\left\{\begin{array}{l} |x-[x]|, \quad \text { when }[x] \text { is odd } \\ |x-[x]-1|, \quad \text { when }[x] \text { is even, } \end{array}\right.$
where [.] denotes the greatest integer function, then $\int\limits_{-2}^4 f(x) d x$ is equal to
Answer & explanation
Correct answer: option 4
We have,
$f(x) =\left\{\begin{array}{ll}
|x-[x]|, & \text { when }[x] \text { is odd } \\
|x-[x+1]|, & \text { when }[x] \text { is even }
\end{array}\left[\begin{array}{c}
∵[x+1] \\
=[x]+1
\end{array}\right]\right.$
$\Rightarrow f(x) = \begin{cases}\{x\}, & \text { when }[x] \text { is odd } \\
1-\{x\}, & \text { when }[x] \text { is even }\end{cases}$
The graph of $f(x)$ is as shown in Figure.