Ta có:
\(x^2-2xy+2y^2-2x+6y+5=\left(x^2-xy+y^2\right)+y^2-2\left(x-y\right)+4y+5\)
\(=\left[\left(x-y\right)^2-2\left(x-y\right)+1\right]+\left(y^2+4y+4\right)\)
\(=\left(x-y-1\right)^2+\left(y+2\right)^2=0\)
\(\Rightarrow\hept{\begin{cases}x-y=1\\y=-2\end{cases}\Rightarrow\hept{\begin{cases}x=y+1=-1\\y=-2\end{cases}}}\)