The Diophantine equation $x^2 + 2 = y^3$ [duplicate]

How to solve the Diophantine equation $x^2 + 2 = y^3$ with $x,y>0$ ? ($x,y$ are integers.)


Although I prefer an answer without ring theory here is a solution by using the extension $\mathbb{Z}[\sqrt{-2}]$.

All variables in this proof are integers.

$x^2+2=y^3$ factors as $(x+\sqrt{-2})(x-\sqrt{-2})=y^3$.

Since

$1)$ $\mathbb{Z}[\sqrt{-2}]$ is a UFD.

$2)$ the LHS factors into $2$ conjugates which implies that the LHS must have $2n$ primefactors. (A conjugate factors analogue to its Original in a UFD , this is easy to show when using the norm)

3) the RHS must have $3m$ prime factors and the smallest common multiple of $2$ and $3$ is $6$.

We can conclude that :

$1)$ both LHS and RHS has $6A$ prime factors.

$2)$ Since we have two conjugates on the LHS we can conclude that $(x+\sqrt{-2})$ is a cube in $\mathbb{Z}[\sqrt{-2}]$.

Hence we get the equation $(x+\sqrt{-2})=(a+b\sqrt{-2})^3$

We proceed by expanding the cube :

$x+\sqrt{-2} = a^3 - 6 a b^2 + (3 a^2 b-2 b^3)\sqrt{-2}$

We can solve the sqrt part $3 a^2 b-2 b^3 = 1$ because $b^2$ must be $1$ because $b$ is a factor on the LHS !!

Let $b=1$ then we get $3a^2 - 2 = 1$ hence $a=1$.

It follows $x=a^3 - 6a b^2 = 5$.

If we took $b=-1$ or factored $x-\sqrt{-2}$ we get the same or a negative solution for $x$ hence $x=5$ is the only positive solution.

We thus get $5^2 + 2 = 3^3$

Q.E.D.

mick


I would like to supplement Mick's answer by adding in some explanation to part 2 of his answer. Here is why we can conclude that $x+\sqrt{-2}$ is a cube in $\mathbb{Z}[\sqrt{-2}]$:

If we have the prime factorization

$$x+\sqrt{-2} = \alpha_1\alpha_2\cdots \alpha_{3A}$$ then we also have the prime factorization $$x-\sqrt{-2} = \bar{\alpha_1} \bar{\alpha_2}\cdots \bar{\alpha_{3A}}$$ Suppose also that we have the prime factorization: $$y=\beta_1 \beta_2 \cdots \beta_{2A}$$ Then the equation $(x+\sqrt{-2})(x-\sqrt{-2})=y^3$ becomes:

$$\alpha_1\alpha_2\cdots \alpha_{3A} \bar{\alpha_1} \bar{\alpha_2}\cdots \bar{\alpha_{3A}} = \beta_1^3 \beta_2^3 \cdots \beta_{2A}^3$$ Suppose WLOG that $\alpha_1=\beta_1$, so $\alpha_1 | (x+\sqrt{-2})$. Then $\alpha_1 \not |(x-\sqrt{-2})$, since that would imply $\alpha_1 |[(x+\sqrt{-2})-(x-\sqrt{-2})]$, i.e. $\alpha_1 | \; 2\sqrt{-2}$. But since $\alpha_1$ is prime, this forces $\alpha_1=\pm\sqrt{-2}$, which is impossible, since $\pm\sqrt{-2}$ does not divide $x+\sqrt{-2}$.(We are here assuming $x \neq 0$). Therefore all of $\beta_1^3$ must divide $x+\sqrt{-2}$ (and similarly all of $\bar{\beta_1}^3$ must divide $x-\sqrt{-2}$). The only way this can happen then, is if, say $\alpha_1 = \alpha_2 =\alpha_3 = \beta_1$.

Continuing this grouping, we conclude that we can collect the prime factors of $x+\sqrt{-2}$ into groups of three, so it must be a cube number.


A completely elementary proof can be found on page 561 of the Nov 2012 edition of The Mathematical Gazette, where a descent mechanism first used by Stan Dolan in the March 2012 edition is adapted (as per his challenge to the “interested reader”) to solve Fermat’s two “elliptic curve” theorems. The method uses math which was clearly available in Fermat’s time, and in particular to Fermat himself.

I personally believe this finally puts to rest any questions of whether Fermat could have had a proof of these two claims.


Lemma. Let $a$ and $b$ be coprime integers, and let $m$ and $n$ be positive integers such that $a^2+2b^2=mn$. Then there are coprime integers $r$ and $s$ such that $m=r^2+2s^2$ divides $br-as$. Furthermore, for any such choice of $r$ and $s$, there are coprime integers $t$ and $u$ such that $a=rt-2su$, $b=ru+st$, and $n=t^2+2u^2$ divides $bt-au$.

Proof. Assume the theorem is false, and let $m$ be a minimal counterexample. Evidently $m > 1$ since the theorem is trivially true for $m=1$.

Note that $b$ is coprime to $m$. Let $A$ be an integer such that $Ab \equiv a\!\pmod{m}$, chosen so that $\tfrac{-m}{2} < A \le \tfrac{m}{2}$. Then $A^2+2 = lm$ for some positive integer $l < m$. Clearly $l$ cannot be a smaller counterexample than $m$, and so there exist coprime integers $r$ and $s$ such that $m=r^2+2s^2$ divides $br-as$.

Let $t = \tfrac{ar+2bs}{m}$ and $u=\tfrac{br-as}{m}$. Direct calculation confirms the equations for $a$, $b$, and $n$. From $n=t^2+2u^2$, we deduce that $t$ is an integer because $u$ is an integer, and $t$ and $u$ are coprime because $\gcd(t,u)$ divides both $a$ and $b$. Finally, note that $n$ divides $bt-au=sn$.

Hence $m$ is not a counterexample, contradicting the original assumption. $\blacksquare$

Corollary. Let $a$ and $b$ be coprime integers with $m$ an integer such that $m^3=a^2+2b^2$. Then there are coprime integers $r$ and $s$ such that $a=r(r^2-6s^2)$ and $b=s(3r^2-2s^2)$.

Proof. Evidently $m$ is odd since $a^2+2b^2$ is at most singly even. And $a$ and $m$ must be coprime. Using the theorem, we have $m=r^2+2s^2$ and $m^2=t^2+2u^2$. Then $m$ divides $a(ur-ts)=t(br-as)-r(bt-au)$, and therefore $m \mid (ur-ts)$. The lemma can then be reapplied with $a$ and $b$ replaced by $t$ and $u$. Repeating the process, we eventually obtain integers $p$ and $q$ such that $p^2+2q^2=1$. The only solution is $q=0$ and $p=\pm1$. Ascending the path back to $a$ and $b$ (reversing signs along the way, if necessary) yields $a=r(r^2-6s^2)$ and $b=s(3r^2-2s^2)$, as claimed. $\blacksquare$

Theorem. The Diophantine equation $X^3 = Y^2+2$ has only one integer solution, namely $(x,y) = (3, \pm 5)$.

Proof. Evidently $y$ and $2$ are coprime. By the corollary, we must have $b=1=s(3r^2-2s^2)$ for integers $r$ and $s$. The only solutions are $(r,s)=(\pm 1,1)$. Hence $a=y=r(r^2-6s^2)=\pm 5$, so $(x,y)=(3,\pm 5)$. $\blacksquare$