Finding the integer solutions of $y^2 = x^3 - 12$

I tried to find the solution of this equation, or conclude there are none. This i what i found out:

I noticed that $x \neq -1$ mod $3$.

We can write $y^2 + 4 = x^3 - 8 = (x-2)(x^2+2x+4)$

I tried to find a prime divider from the righthand side so i could use legendre on the left hand side, but couldnt solve it. Can someone help me?

• It is not true that $x$ odd implies $x^3-12\equiv 5$ mod($8$). For example, $5^3-12=113\equiv 1$ mod ($8$). – lulu Dec 11 '15 at 12:20
• Oh thanks, you are right. Something went wrong there! – S. Ferwerda Dec 11 '15 at 12:22
• If $x$ is even then you can divide through by $4$ to get the new Diophantine equation $y^2=2x^3-3$. That one is impossible (just check it mod($8$). So if there is a solution to the original equation, $x$ is odd. – lulu Dec 11 '15 at 12:25
• Continuing from @lulu , for $x$ odd mod(8), $x^3\equiv x\pmod 8$. Since the squares mod 8 are $0$, $1$, and $4$, the only option is $x\equiv 5\pmod 8$ (all other possibilities do not leave you with squares, mod 8, on the RHS). – Michael Burr Dec 11 '15 at 12:30

As you've noticed, $y^2+4=(x-2)\left(x^2+2x+4\right)$.

If $x$ is even, then let $x=2k$. Then $y=2m$, so $m^2=2k^3-3$, impossible (use mod $8$, as has been suggested in the comments. $2k^3\equiv \{0,2,6\}\pmod{8}$, but then $m^2\equiv \{5,7,3\}\pmod{8}$, contradiction, because $5,7,3$ are not quadratic residues mod $8$).

If $x$ is odd, then: let $p$ be a prime divisor of either $x-2$ or $x^2+2x+4$. Then $p$ is odd and $p\mid y^2+4$, so $\left(y2^{-1}\right)^2\equiv -1\pmod{p}$, so $p=4t+1$ (by Quadratic Reciprocity).

Therefore all the prime divisors of $x-2$, $x^2+2x+4$ are of the form $4t+1$. Also $x^2+2x+4=(x+1)^2+3>0$ and $y^2+4>0$, so $x-2>0$, so $x-2\equiv 1\pmod{4}$ and $x^2+2x+4\equiv 1\pmod{4}$. The first congruence gives $x\equiv 3\pmod{4}$, but $3^2+2\cdot 3+4\not\equiv 1\pmod{4}$, contradiction.

• I can't understand what you mean by $y2^{-1}$, it seems there is a typo (and I'm not able to correct it). – Tom-Tom Dec 11 '15 at 12:59
• @Tom-Tom $2^{-1}$ denotes the modular inverse of $2$ mod $p$. See Wikipedia. – user236182 Dec 11 '15 at 13:00
• That makes sense, then. Thanks. – Tom-Tom Dec 11 '15 at 13:03
• If x-2 only has prime divisors of p = 1 mod 4, then x-2 = 1 mod 4? Thats good to know! This aint true for other numbers right? Like if we only have prime divisors p = 3 mod 4, – S. Ferwerda Dec 11 '15 at 15:19
• @S.Ferwerda We also need to know $x-2>0$ (because e.g. the only prime divisors of $-5$ are of the form $4k+1$, but $-5\not\equiv 1\pmod{4}$). Also, if all the prime divisors of $m>0$ are of the form $4k+3$, then we could either have $m\equiv 1$ or $3\pmod{4}$, e.g. $3^2\equiv 1\pmod{4}$ and $3^3\equiv 3\pmod{4}$. – user236182 Dec 11 '15 at 15:26

A general problem considering the equations of the form $$y^2 = x^3 + k$$ are known as Bachet equations. There is a known theorem as follows (which could be found in Richard Mollin's Algebraic Number Theory: theorem 4.2) :

Let $F=\mathbb{Q}(\sqrt{k})$ be a complex quadratic field with radicand $k< -1$ such that $k \neq 1 \pmod 4,$ and $h_{\mathfrak{D}_F} \neq 0\pmod 3.$ Then there are no solutions to the Batchet equation in integers $x,y$ except in the following cases: there exists an integer $u$ such that $$(k,x,y) = (\pm 1-3u^2, 4u^2 \mp 1, \epsilon \cdot u(3 \mp 8u^2) ),$$

where the $\pm$ signs correspond to the $\mp$ signs and $\epsilon = \pm 1$ is allowed in either case.

In this case, $k=-12<-1$ and $k\equiv0\pmod 4$, $h_{\mathfrak{D}_F}=1$, however, $12\pm 1\neq0\pmod 3$, hence there is no integer solutions.

• Also called Mordell's equations. – user236182 Dec 11 '15 at 12:52
• @user236182 Yes. One could check A054504 and A081121 to see for which $k$ has no integral solutions. – user297600 Dec 11 '15 at 13:11
• $17$ years ago Mordell's equation was fully solved by Gebel for all $0\le |k|\le 10^4$. OEIS has the amounts of solutions for each of those $k$. Once you know the amount, you can found all the solutions using a program. – user236182 Dec 11 '15 at 13:14