TITLE: Solution of this Diophantine Equation
QUESTION [6 upvotes]: If $x$ and $y$ are prime numbers which satisfy $x^2-2y^2=1$, solve for $x$ and $y$.

My attempt: 
$x^2-2y^2=1$
$\implies (x+\sqrt{2}y)(x-\sqrt{2}y)=1$
$\implies (x+\sqrt{2}y)=1$ and $(x-\sqrt{2}y)=1$
$\implies x=1$ and $y=0$
Clearly $x$ and $y$ are not prime numbers . Why is my solution not working. I have been able to solve similar type of equations by factorizing and then listing down the integer factors and the different cases. Why is it not working here?

REPLY [24 votes]: The fault is that irrationals can also produce the product to $1$.
Consider $x=3$ and $y=2$ then we get, $(3+\sqrt{2} \cdot 2)(3-\sqrt{2}\cdot 2)=1$
Hence, the fault is moving from step 2 to step 3. You should look under the ring of $a+b\sqrt{2}$ in that step.