Trong các cách giải phương trình sau, cách giải nào là đúng?
\(\left(x-1\right)\left(x+2\right)=0\Leftrightarrow\left[{}\begin{matrix}x-1=0\\x+2=0\end{matrix}\right.\) \(\Leftrightarrow\left[{}\begin{matrix}x=1\\x=-2\end{matrix}\right.\).\(\left(x-1\right)\left(x+2\right)=0\Leftrightarrow\left\{{}\begin{matrix}x-1=0\\x+2=0\end{matrix}\right.\)\(\Leftrightarrow\left\{{}\begin{matrix}x=1\\x=-2\end{matrix}\right.\).\(\left(x-1\right)\left(x+2\right)=0\)\(\Leftrightarrow x-1+x+2=0\) \(\Leftrightarrow x=-\dfrac{1}{2}\).\(\left(x-1\right)\left(x+2\right)=0\)\(\Leftrightarrow x-1-x+2=0\)\(\Leftrightarrow1=0\) (phương trình vô nghiệm).