\(\Leftrightarrow x^3-\left(m-1\right)x^2-\left(m-1\right)x-2x^2+2\left(m-1\right)x+2m-2=0\)
\(\Leftrightarrow x\left(x^2-\left(m-1\right)x-m+1\right)-2\left(x^2-\left(m-1\right)x-m+1\right)=0\)
\(\Leftrightarrow\left(x-2\right)\left(x^2-\left(m-1\right)x-m+1\right)=0\)