\(\text{Th1: }\hept{\begin{cases}x-1< 0\\x-2\ge0\end{cases}\Rightarrow\hept{\begin{cases}x< 1\\x\ge2\end{cases}\Rightarrow}x\in\varnothing}\)
\(\text{Th2: }\hept{\begin{cases}x-1>0\\x-2\le0\end{cases}\Rightarrow\hept{\begin{cases}x>1\\x\le2\end{cases}\Rightarrow1< x\le}2}\)
\(\text{Khi đó: }\left|x-1\right|+\left|x-2\right|=4\)
\(\Leftrightarrow x-1+2-x=4\)
\(\Leftrightarrow x-x=4-2+1\)
\(\Leftrightarrow0x=3\left(\text{vô lí}\right)\)
Vậy \(x\in\varnothing\)
\(\text{TH3: }\hept{\begin{cases}x-1\ge0\\x-2\ge0\end{cases}\Rightarrow\hept{\begin{cases}x\ge1\\x\ge2\end{cases}\Rightarrow}x\ge1}\)
\(\text{Khi đó: }\left|x-1\right|+\left|x-2\right|=4\)
\(\Leftrightarrow x-1+x-2=4\)
\(\Leftrightarrow2x=7\)
\(\Leftrightarrow x=\frac{7}{2}\left(\text{nhận}\right)\)
\(\text{TH4: }\hept{\begin{cases}x-1\le0\\x-2\le0\end{cases}\Rightarrow\hept{\begin{cases}x\le1\\x\le2\end{cases}\Rightarrow}x\le2}\)
\(\text{Khi đó: }\left|x-1\right|+\left|x-2\right|=4\)
\(\Leftrightarrow1-x+2-x=4\)
\(\Leftrightarrow-2x=1\)
\(\Leftrightarrow x=-\frac{1}{2}\left(\text{nhận}\right)\)
Vậy \(x\in\left\{\frac{-1}{2};\frac{7}{2}\right\}\)