<s>[INST] Solve $f(x) = |x+1|−|x|+3|x−1|−2|x−2|−(x+2)=0$ $f(x) = |x+1|−|x|+3|x−1|−2|x−2|−(x+2)=0$
I saw this problem, and I couldn’t think of a good way to do this (initially thought about isolating a term with the modulus sign and squaring, but that seemed to take too long). The solution said something along the lines of:
‘ We have to solve f (x) = 0 in the five regions of the x-axis determined by the modulus functions’. Could someone please elaborate on what this means. Many thanks.
 [/INST] We have $|x-a| = \begin{cases}x-a,& \text{if } x\ge a \\ -(x-a), & \text{if } x< a\end{cases}$
So, $f(x) = \begin{cases}-(x+1) +x-3(x-1)+2(x-2)-(x+2) &  \text{for } x <-1 \\
(x+1) +x-3(x-1)+2(x-2)-(x+2) &\text{for }-1\le x <0 \\ (x+1) -x  -3(x-1)+2(x-2)-(x+2) &  \text{for } 0\le x<1 \\
(x+1)-x+3(x-1)+2(x-2)-(x+2)  &\text{for }1\le x<2 \\
(x+1)-x+3(x-1)-2(x-2)-(x+2) & \text{for } x\ge2\end{cases}, $
Simplify these and equate to $0$ to get the values of $x$
</s>