Lấy (1) cộng (2), ta có:
\(\left(2a+1\right)x=a^2+4a+5\)\(\Rightarrow x=\dfrac{a^2+4a+5}{2a+1}\)
Thay vào (1): \(\dfrac{\left(a^2+4a+5\right)\left(a+1\right)-10a-5}{2a+1}.\dfrac{1}{a}\)\(=\dfrac{a^3+5a^2-a}{2a+1}.\dfrac{1}{a}=\dfrac{a^2+5a-1}{2a+1}\)
Để x,y nguyên thì \(\left\{{}\begin{matrix}a^2+4a+5⋮2a+1\\a^2+5a-1⋮2a+1\end{matrix}\right.\)\(\Leftrightarrow\left\{{}\begin{matrix}a\left(a+2\right)+2a+5⋮2a+1\\a^2+2a+3a-1⋮2a+1\end{matrix}\right.\)\(\Rightarrow\left\{{}\begin{matrix}4⋮2a+1\\a+2⋮2a+1\end{matrix}\right.\)\(\Rightarrow\left\{{}\begin{matrix}4⋮2a+1\\3⋮2a+1\end{matrix}\right.\)\(\Rightarrow2a+1\in\left\{\pm1\right\}\)\(\Rightarrow a\in\left\{-1;0\right\}\)
Vậy với a=-1;0 thì hpt có nghiệm (x;y) với x,y thuộc Z.