I think you might be referring to the definite integral,
[tex]\displaystyle \int_{-1}^2|x-1|\,\mathrm dx[/tex]
Recall the definition of absolute value:
[tex]|x| = \begin{cases}x&\text{if }x\ge0\\-x&\text{if }x<0\end{cases}[/tex]
Then [tex]|x-1|=x-1[/tex] if [tex]x\ge1[/tex], and [tex]|x-1|=1-x[/tex] is [tex]x<1[/tex]. So spliting up the integral at x = 1, we have
[tex]\displaystyle \int_{-1}^2|x-1|\,\mathrm dx = \int_{-1}^1(1-x)\,\mathrm dx + \int_1^2(x-1)\,\mathrm dx[/tex]
The rest is simple:
[tex]\displaystyle \int_{-1}^2|x-1|\,\mathrm dx = \left(x-\dfrac{x^2}2\right)\bigg|_{-1}^1 + \left(\dfrac{x^2}2-x\right)\bigg|_1^2 \\\\ = \left(\left(1-\frac12\right)-\left(-1-\frac12\right)\right) + \left(\left(2-2\right)-\left(\frac12-1\right)\right) \\\\ = \boxed{\frac52}[/tex]