Note: |x–a|={−(x–a);forx<ax–a;forx≥a}.
∫40(|x–1|+3|x–2|+4|x–3|)dx
=∫10–(x–1+3x–6+4x–12)dx
+
∫21(x–1–3x+6–4x+12)dx
+
∫32(x–1+3x–6–4x+12)dx
+
∫43(x–1+3x–6+4x–12)dx
=∫01(19–8x)dx+∫21(17–6x)dx+∫325dx+∫43(8x–19)dx
=[19x–4x2]10+[17x–3x2]21+[5x]32+[4x2–19x]43
=15+(22–14)+(15–10)+(−12–(−21))
=37
∴∫40(|x–1|+3|x–2|+4|x–3|)dx=37