\(\left\{{}\begin{matrix}mx-y=2\\x+my=1\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x+m\left(mx-2\right)=1\\y=mx-2\end{matrix}\right.\\ \Leftrightarrow x\left(m^2+1\right)=2m+1\Leftrightarrow x=\dfrac{2m+1}{m^2+1}\\ \Leftrightarrow y=\dfrac{m\left(2m+1\right)}{m^2+1}-2=\dfrac{2m^2+m-2m^2-2}{m^2+1}=\dfrac{m-2}{m^2+1}\)
Ta có \(x+y=1\Leftrightarrow\dfrac{2m+1+m-2}{m^2+1}=1\)
\(\Leftrightarrow3m-1=m^2+1\\ \Leftrightarrow m^2-3m+2=0\\ \Leftrightarrow\left[{}\begin{matrix}m=1\\m=2\end{matrix}\right.\)