Ta có \(y\left(x-1\right)=x^2+2\)
\(\Leftrightarrow y\left(x-1\right)-x^2=2\)
\(\Leftrightarrow y\left(x-1\right)-x^2+1=3\)
\(\Leftrightarrow y\left(x-1\right)-\left(x^2-1\right)=3\)
\(\Leftrightarrow y\left(x-1\right)-\left(x-1\right)\left(x+1\right)=3\)
\(\Leftrightarrow\left(x-1\right)\left(y-x-1\right)=3\)
Vì x,y nguyên nên ta có bảng
x-1 | 3 | 1 | -1 | -3 |
y-x-1 | 1 | 3 | -3 | -1 |
x | 4 | 2 | 0 | -2 |
y | 6 | 8 | 2 | 4 |
Vậy\(\left(x,y\right)=\left\{\left(4,6\right),\left(2,8\right),\left(0,2\right),\left(-2,4\right)\right\}\)thỏa mãn
\(y\left(x-1\right)=x^2+2\)
\(\Leftrightarrow x^2-xy+y+2=0\)
\(\Leftrightarrow x\left(x-1\right)-y\left(x-1\right)+\left(x-1\right)+3=0\)
\(\Leftrightarrow\left(x-1\right)\left(x-y+1\right)=-3\)
\(\Leftrightarrow\left[{}\begin{matrix}\left\{{}\begin{matrix}x-1=-1\\x-y+1=3\end{matrix}\right.\\\left\{{}\begin{matrix}x-1=3\\x-y+1=-1\end{matrix}\right.\\\left\{{}\begin{matrix}x-1=1\\x-y+1=-3\end{matrix}\right.\\\left\{{}\begin{matrix}x-1=-3\\x-y+1=1\end{matrix}\right.\end{matrix}\right.\)\(\Leftrightarrow\left[{}\begin{matrix}\left\{{}\begin{matrix}x=0\\y=-2\end{matrix}\right.\\\left\{{}\begin{matrix}x=4\\y=6\end{matrix}\right.\\\left\{{}\begin{matrix}x=2\\y=6\end{matrix}\right.\\\left\{{}\begin{matrix}x=-2\\y=-2\end{matrix}\right.\end{matrix}\right.\)
Vậy \(\left(x;y\right)\in\left\{\left(0;-2\right),\left(4;6\right),\left(2;6\right),\left(-2;-2\right)\right\}\)