<s>[INST] Why am I getting a wrong answer on solving $|x-1|+|x-2|=1$ I'm solving the equation,
$$|x-1| + |x-2| = 1$$
I'm making cases, 
$C-1, \, x \in [2, \infty) $ 
So, $ x-1 + x-2 = 1 \Rightarrow x= 2$
$C-2, \, x \in [1, 2) $
$x-1 - x + 2 = 1 \Rightarrow 1 =1 \Rightarrow x\in [1,2) $
$C-3, \, x \in (- \infty, 1)$
$ - x + 1 - x+2 = 1 \Rightarrow x= 1 \notin (-\infty, 1) \Rightarrow x = \phi$ (null set)
Taking common of all three solution set, I get $x= \phi$ because of the last case. But the answer is supposed to be $x \in [1,2]$
But when I write this equation in graphing calculator, it shows $2$ lines $x=1$ and $ x= 2$ rather than a region between $[1,2]$

Someone explain this too?
 [/INST] By direct way we need to distinguish three cases


*

*$x<1 \implies |x-1| + |x-2| = 1-x+2-x=1 \implies -2x=-2\implies x=1$

*$1\le x<2 \implies |x-1| + |x-2| = x-1+2-x=1 \implies 1=1$

*$x\ge 2 \implies |x-1| + |x-2| = x-1+x-2=1 \implies 2x=4\implies x=2$
therefore $1\le x\le 2$.
</s>