# Number Theory Question - prove no integer solutions

Show that the equation $$x^2+xy-y^2=3$$ does not have integer solutions.

I solved the equation for $x$:

$x=\displaystyle \frac{-y\pm\sqrt{y^2+4(y^2+3)}}{2}$ $\displaystyle =\frac{-y\pm\sqrt{5y^2+12}}{2}$

I was then trying to show that $\sqrt{5y^2+12}$ can not be an integer using $r^2\equiv 12 \pmod{5y^2}$. I got stuck here.

-
You were close to finished. We have $5y^2+12\equiv 2\pmod{5}$, but $2$ is not congruent to a square modulo $5$. For the squares modulo $5$ are in order, congruent to $0,1,4,4,1$. –  André Nicolas Sep 19 '13 at 5:42

Just note that $5y^2$ is a multiple of $5$ and hence it ends on $0$ or $5$. Thus, $5y^2+12$ ends in $2$ or $7$, but there are no perfect squares that have this endings.
Generally, If $f(x) \equiv 0 \pmod{mn}$ has a solution, then that means $mn \mid f(x)$ for some $x$. But since $m \mid mn$ and $n \mid mn$ you can see $m,n \mid f(x)$, i.e. $f(x) \equiv 0 \pmod{m}$ and $f(x) \equiv 0 \pmod{n}$. So in your case you could conclude $r^2 \equiv 12 \pmod{5}$ and get rid of $y^2$ that is unknown. The rest is obvious as others said.