TITLE: There exist no integers for which $x^2-4y=2$
QUESTION [7 upvotes]: I am working on a new exercise in my textbook:
$$\text{Prove that: (P): }\;\nexists \;x,y \in \mathbb{Z}, x^2-4\cdot y = 2 $$
I am stuck and I would really like to see a correct proof so I can move on while understanding the "trick".
Thank you.

REPLY [5 votes]: $x^2-4y=2$
$(x+2\sqrt{y})(x-2\sqrt{y})=2$
The only factors of 2 are $\{1,2\}$ and $\{-1,-2\}$
Thus, $(x+2\sqrt{y})=1$ or $(x+2\sqrt{y})=2$
I will start with $(x+2\sqrt{y})=1$.  Then $2\sqrt{y}=1-x\implies\sqrt{y}=\frac{1-x}{2}$.
By subtitution, $(x-2\sqrt{y})=2$ implies that $\left(x-2\left(\frac{1-x}{2}\right)\right)=2\implies x-1+x=2\implies x=3/2$. Note that $x$ is not an integer.
Just use the same method for the the other factor and interchange the $2$ and the $1$.