Evaluate the definite integrals in Exercises 24 to 31.
\( \int_{1}^{4} [|x - 1| + |x - 2| + |x - 3|] dx \)Show solutionHide solution
On the interval \(1\le x\le 4\), the absolute-value expressions change form at \(x=2\) and \(x=3\). Removing the absolute values gives
\[ |x-1|=x-1,\qquad |x-2|=2-x\ \text{on }[1,2],\quad |x-2|=x-2\ \text{on }[2,4], \] \[ |x-3|=3-x\ \text{on }[1,3],\quad |x-3|=x-3\ \text{on }[3,4]. \]Thus the integrand is piecewise
\[ f(x)=|x-1|+|x-2|+|x-3|= \begin{cases} 4-x,&1\le x\le 2,\\\nx,&2\le x\le 3,\\ 3x-6,&3\le x\le 4. \end{cases} \]So
\[ \int_{1}^{4} f(x)\,dx =\int_{1}^{2}(4-x)\,dx+\int_{2}^{3}x\,dx+\int_{3}^{4}(3x-6)\,dx. \]Evaluate each part exactly:
\[ \int_{1}^{2}(4-x)\,dx =\left[4x-\frac{x^2}{2}\right]_{1}^{2} =\left(8-2\right)-\left(4-\frac12\right) =\frac52, \] \[ \int_{2}^{3}x\,dx =\left[\frac{x^2}{2}\right]_{2}^{3} =\frac{9-4}{2} =\frac52, \] \[ \int_{3}^{4}(3x-6)\,dx =\left[\frac{3x^2}{2}-6x\right]_{3}^{4} =0-\left(\frac{27}{2}-18\right) =\frac92. \]Therefore
\[ \int_{1}^{4} [|x-1|+|x-2|+|x-3|]\,dx =\frac52+\frac52+\frac92 =\frac{19}{2}. \]Hence the value is \(\boxed{\frac{19}{2}}\).