Answer
$\frac{5}{2}.$
Work Step by Step
We have
$$
\int_{-2}^{1}|x| d x= \int_{-2}^{0}|x| d x+ \int_{0}^{1}|x| d x\\
= -\int_{-2}^{0}xd x+ \int_{0}^{1}x d x =-\frac{1}{2}x^2|_{-2}^0+\frac{1}{2}x^2|_{0}^1\\
=-\frac{1}{2}(0-4)+\frac{1}{2}=\frac{5}{2}.
$$