Solve the equation $\left(x^{2}+y\right)\left(x+y^{2}\right)=(x-y)^{3}$ in the set of integers.
Solution. Let's expand the parentheses in the expression:

$$
x^{3}+y^{3}+x y+x^{2} y^{2}=x^{3}-3 x^{2} y+3 x y^{2}-y^{3}
$$

Further simplifying:

$$
x^{2} y^{2}+x y+2 y^{3}+3 x^{2} y-3 x y^{2}=0, \quad \text { then } \quad y\left(2 y^{2}+\left(x^{2}-3 x\right) y+3 x^{2}+x\right)=0
$$

If $y=0$, then $x$ can be any integer, so the pair $(x ; 0)$ is a solution.

If $y \neq 0$, then we can divide by $y$, resulting in a quadratic polynomial in $y$:

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

Using the quadratic formula for this equation:

$$
y_{1,2}=\frac{-\left(x^{2}-3 x\right) \pm \sqrt{\left(x^{2}-3 x\right)^{2}-24 x^{2}-8 x}}{4}
$$

The expression under the square root is:

$$
x^{4}+9 x^{2}-6 x^{3}-24 x^{2}-8 x=x \cdot\left(x^{3}-6 x^{2}-15 x-8\right)=x(x-8)(x+1)^{2}
$$

Thus,

$$
y_{1,2}=\frac{-x^{2}+3 x \pm(x+1) \sqrt{x(x-8)}}{4}
$$

The value under the square root must be rational (otherwise, we would not get an integer solution for $y$), and since $x(x-8)$ is an integer, it must be a perfect square.

$x(x-8)=d^{2}$, rearranging gives $x^{2}-8 x-d^{2}=0$, from which

$$
x_{1,2}=\frac{8 \pm \sqrt{64+4 d^{2}}}{2}=4 \pm \sqrt{4^{2}+d^{2}}
$$

$4^{2}+d^{2}$ must be a perfect square. The trivial solution is $d=0$, otherwise we need to find Pythagorean triples where one of the numbers is 4. There is only one such triple: 3, 4, 5. Therefore, $d=0$ or $d^{2}=9$.

If $d=0$, then $x=0$ or $x=8$, if $d^{2}=9$, then $x=9$ or $x=-1$.

The corresponding $y$ values for these $x$ values are:

$$
\begin{aligned}
& x=0 \quad \text { when } y=0 \\
& x=8 \quad \text { when } y=-10 \\
& x=9 \quad \text { when } y=-6 \text { or } y=-21 \\
& x=-1 \text { when } y=-1
\end{aligned}
$$

In addition to these, we found the solutions where $y=0$ and $x$ is any integer.