\(xy+2y=x^2+5x-1\)
\(\Leftrightarrow y\left(x+2\right)=x^2+4x+4+x+2-7\)
\(\Leftrightarrow y\left(x+2\right)=\left(x+2\right)^2+\left(x+2\right)-7\)
\(\Leftrightarrow y\left(x+2\right)-\left(x+2\right)^2-\left(x+2\right)=-7\)
\(\Leftrightarrow\left(x+2\right)\left(y-x-2-1\right)=-7\)
\(\Leftrightarrow\left(x+2\right)\left(y-x-3\right)=-7\) Mà x, y \(\in Z\)
\(\Rightarrow x+2;y-x-3\in\)Ư\(\left(-7\right)=\left\{\pm1;\pm7\right\}\)
Xét bảng
Vậy (x;y) = (-1;5) ; (-3;7) ; (5;7) ; (-9;7)