\(\int_{0}^{2}\displaystyle |x-1|\,dx=\)
Answer & explanation
Correct answer: option 1
The correct answer is Option (1) → 1
The expression \(x-1\) changes sign at x = 1, so the integral is split at x = 1:
\(|x-1| = 1-x\) for \(0 \le x \le 1\)
\(|x-1| = x-1\) for \(1 \le x \le 2\)
\( \displaystyle \int_{0}^{2}|x-1|\,dx = \int_{0}^{1}(1-x)\,dx + \int_{1}^{2}(x-1)\,dx \)
\( \displaystyle = \Big[x-\frac{x^2}{2}\Big]_{0}^{1} + \Big[\frac{x^2}{2}-x\Big]_{1}^{2} \)
\( \displaystyle = \frac{1}{2} + \left(0-\left(-\frac{1}{2}\right)\right) \)
\( \displaystyle = \frac{1}{2}+\frac{1}{2} = 1 \)