# Solution of this Diophantine Equation

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?

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.

• This is not an answer to the question. If it's a comment on the other answer, then it goes under the comments section there. Mar 28, 2019 at 18:17
• "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?" Mar 28, 2019 at 18:18
• @B.Goddard: this answer addresses precisely what the OP asked. Why would you think it should be a comment and not an answer? Mar 29, 2019 at 18:29

\begin{align*}&x^2-2y^2=1\tag{1}\\\iff & x^2-1=(x+1)(x-1)=2y^2\end{align*}

Since $$2\mid (x+1)(x-1)$$, we conclude that both $$(x+1)$$ and $$(x-1)$$ have to be even, and hence $$4\mid 2y^2\implies 2\mid y^2\implies 2\mid y$$ and since $$y$$ is prime, $$\color{red}{y=2}$$. Can you end it now?

From (1), it follows immediately that $$x^2-2y^2=x^2-8=1$$. Thus, the only solution is $$\color{blue}{(3, 2)}$$.

The problem with your method is that for $$a,b\in\mathbb R$$
$$a·b=1\not\Rightarrow a=1\;\text{ and }\;b=1$$
In fact, this only works if $$a·b=0\implies a=0\;\text{ or }\;b=0$$