Question:medium

If $f(x) = |x-1| + |x-2| + |x-3|, \forall x \in [1,4]$, then $\int_1^4 f(x) dx =$

Show Hint

For absolute value integrals over a range, visualize the function. Since $|x-1| + |x-2| + |x-3|$ is convex, the area is simply the sum of trapezoids/triangles formed between the breaking points!
Updated On: Jun 1, 2026
  • 1/2
  • 7
  • 9/2
  • 19/2
Show Solution

The Correct Option is D

Solution and Explanation

Step 1: Break the range at the corner points.
The absolute values bend at $x=1,2,3$, so split the integral over $[1,2]$, $[2,3]$ and $[3,4]$ and write $f$ without bars on each part.

Step 2: Simplify $f$ on each piece.
On $[1,2]$: $f = (x-1)-(x-2)-(x-3) = 4-x$. On $[2,3]$: $f = (x-1)+(x-2)-(x-3) = x$. On $[3,4]$: $f = (x-1)+(x-2)+(x-3) = 3x-6$.

Step 3: Integrate each part.
$\int_1^2 (4-x)\,dx = 4(1) - \tfrac{4-1}{2} = 4 - 1.5 = 2.5$. $\int_2^3 x\,dx = \tfrac{9-4}{2} = 2.5$. $\int_3^4 (3x-6)\,dx = [\tfrac{3x^2}{2}-6x]_3^4 = 0 - (-4.5) = 4.5$.

Step 4: Add them up.
$2.5 + 2.5 + 4.5 = 9.5$. \[ \boxed{\tfrac{19}{2}} \]
Was this answer helpful?
0