# Evaluate the definite integrals: $\int\limits_1^4 [\; |x-1|+|x-2|+|x-3|\;]dx$

This question has appeared in modelpaper 2012

Toolbox:
• $\int |x+a| dx$ where $-(x+a) \geq 0\; for\; -a \leq x \leq 0\qquad (x+a) \leq 0\;for \; -a \geq x\geq 0$
• $\int\limits_a^b f(x)dx=\int \limits_a^b f(a-x)dx$
Given $I=\int\limits_1^4[|x-1|+|x-2|+|x-3|]dx$

On seperating the terms we get

$I=\int \limits_1^4 |x-1|\;dx+\int \limits_1^4 |x+2|\;dx+\int \limits _1^4 |x-3|\;dx$

(ie)$I=I_1+I_2+I_3$

Consider $I_1=\int \limits_1^4 (x-1)dx$

where $(x+1) \geq 0\; for\; 1 \leq x \leq 4$

Hence the limit is 1 to 4

Therefore $I_1=\int \limits_1^4 (x-1)dx$

On integrating we get

$[\frac{x^2}{2}]_1^4-[x]_1^4$

On applying limits

$[\frac{16}{2}-\frac{1}{2}]-[4-1]$

$=8-\frac{1}{2}-3$

$=\frac{9}{2}$

Consider $I_2=\int \limits_1^4 |x-2|dx$

$(x-2) \geq 0\; =>\; 2 \leq x \leq 4$

$(x-2) \leq 0\; => \; 1 \leq x \leq 2$

Hence $I-2=\int \limits_1^2 -(x-2) dx +\int \limits_2^4(x-2) dx$

On integrating we get

$-[\frac{x^2}{2}-2x]_1^2-[\frac{x^2}{2}-2x]_4^2$

On applying limits we get,

$-[\frac{4}{2}-4-\frac{1}{2}+2]+[\frac{16}{2}-8-\frac{4}{2}+4]$

$=-(\frac{-1}{2})+2 \qquad = \frac{1}{2}+2\qquad=\frac{5}{2}$

Consider $I_3=\int \limits_1^3 |x-3|dx$

$(x-3) \geq 0\;for\; 3 \leq x \leq 4$

$(x-3) \leq 0\;for \; 1 \leq x \leq 3$

Hence $I-3=\int \limits_1^3 -(x-3) dx +\int \limits_3^4(x-3) dx$

On integrating we get

$-[\frac{x^2}{2}-3x]_1^3+[\frac{x^2}{2}-3x]_3^4$

On applying limits,

$-[\frac{9}{2}-9-\frac{1}{2}+3]+[\frac{16}{2}-12-\frac{9}{2}-9]$

$=-[-2]+[\frac{1}{2}]$

$=2+\frac{1}{2}=\frac{5}{2}$

Therefore $I=I_1+I_2+I_3$

$=\frac{9}{2}+\frac{5}{2}+\frac{5}{2}$

$=\frac{9}{2}+5$

$I=\frac{19}{2}$