Finding integer solutions to $y^2=x^3-2$

Solution 1:

The only integral solutions to your first problem are $(3, \pm 5)$. The general class of equations are known as Mordell's equation. A fairly elaborate discussion and case by case analysis is provided here.

Solution 2:

Fact : $\mathbb{Z}[\sqrt{-2}]$ is Unique factorization domain. lemma : in every UFD, if the product of two numbers, which are relatively prime is a cube, then each of them must be a cube. There is no any solution

$$x^3 = (y+\sqrt{-2})\times(y-\sqrt{-2})$$

the greatest common divisor of these factors will divide 2-times the $\sqrt{-2}$, which is lead to only finitly many cases. (some cases can be shown impossible, only by the modular an congrunce arithmetic.)

finally we have: $$y+\sqrt{-2}=(a+b\sqrt{-2})^3$$ which lead us to the system of equations as follows: $$a^3-6ab^2=y$$ and $$3a^2b-2b^3=1$$ then $$b(3a^2-2b^2)=1$$ which implies the assertion.