Determine all pairs $(x, y)$ of integers satisfying $x^{2}=y^{2}\left(x+y^{4}+2 y^{2}\right)$
Sometimes there's no choice, you have to do ugly things. This exercise is there to train you to do ugly things, and to recognize that sometimes there's just no better way.

We see our expression as the cancellation of a polynomial in $x$:

$$
x^{2}-y^{2} x-\left(y^{6}+2 y^{4}\right)=0
$$

$x$ must be an integer, so the discriminant of the polynomial must be a perfect square. This discriminant is

$$
\Delta=y^{4}-4 \times 1 \times-\left(y^{6}+2 y^{4}\right)=4 y^{6}+9 y^{4}.
$$

$\Delta$ is a perfect square if and only if $4 y^{2}+9$ is, or $y=0$ (since $y^{4}$ is a square). We write $4 y^{2}+9=z^{2}$, with $\operatorname{spdg} z \geq 0$ and we get $(2 y-z)(2 y+z)=-9$. If $(x, y)$ is a solution, $(x,-y)$ is also a solution, so we assume $y \geq 0$ as well. This allows us to simplify the problem, we have $2 y+z \geq 0$ and $2 y+z \geq 2 y-z$. We therefore have two possibilities: the first is $2 y+z=3,2 y-z=-3$, and the second is $2 y+z=9,2 y-z=-1$. In the first case, we find $z=0, y=0$, which gives $x=0$. In the second case, we find $y=2, z=5$. Using the quadratic formula, we have

$$
x=\frac{-\left(-y^{2}\right) \pm y^{2} z}{2}=8 \text{ or } 12
$$

Conversely, all these pairs are solutions. Note also that the case $y=0$ does not need to be treated again.