Well you got the intervals correct.
So you have three pieces.
1) |x+1|
2) |x+2|
3) | x-1|
Think/imagine the number line for these three pieces.
Convert them into "distances"
1) |x-(-1)|
2) |x-(-2)|
3) |x-(1)|
So for 1) imagine the number line --------(-1)--------------
In your first interval
x<=-2
Ask your self for (1) are we to the LEFT OR RIGHT of -1? The interval is to the left of -1 (x<=-2) hence |x+1|=|x-(-1)|=-(x+1)
ie you put the negative sign infornt of the expression.
Same thing for (2). Is the interval left of -2 ? Yes, so we put a negative infront of -(x+2)
What about (3)? Is the interval x<=-2 left or right of 1? Left, so we put a negative infront of -(x-1)
So for the interval x<=2 our equation |x+1| + |x+2| + | x-1|= 20
becomes: -(x+1)-(x-2)-(x-1)=20
Another quick one:
-1 <= x <= +1
(1) The interval is to the right of -1. So |x+1|=+(x+1)
(2) The interval is to the right of -2. Hence, |x+2|=+(x+2)
3) The interval is to the left 1. So |x-1|=-(x-1)
Now evaluate and solve.
You have to do this step for all the intervals. It sucks. But nothing we can do about it. Make sure to either plug the solutions into the equations to validate they are correct OR make sure the value x equals is within the interval. Hope this helps