Solve the following equation in the set of integers:

$$
\left(x^{2}+y\right)\left(x+y^{2}\right)=(x-y)^{3}
$$
Let's perform the multiplication and cubing, and arrange the terms on the left side:

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

If $y=0$, then this holds for any $x$. Suppose $y \neq 0$; then we can divide by $y$:

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

Arrange the terms according to powers of $y$:

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

We treat this equation as a quadratic equation with integer coefficients, where $y$ is the unknown, and we seek those values of $x$ for which the equation has integer roots.

For (1) to have integer roots, it is necessary that the discriminant $D$ of the equation be a perfect square:

$$
D=\left(x^{2}-3 x\right)^{2}-4 \cdot 2 \cdot\left(3 x^{2}+x\right)=x(x-8)(x+1)^{2}
$$

If $x=-1$, then $D=0$ and $y=-1$.

If $x \neq -1$, then $\frac{D}{(x+1)^{2}}=x(x-8)$ must also be a perfect square: $x^{2}-8 x=k^{2}$, where $k$ is some non-negative integer.

Completing the square for $x^{2}-8 x$ and rearranging:

$$
\begin{gathered}
(x-4)^{2}-k^{2}=16 \\
(x-4-k)(x-4+k)=16
\end{gathered}
$$

The possible factorizations of 16 (considering that $x-4-k \leqslant x-4+k$), and the corresponding values of $x=\frac{(x-4-k)+(x-4+k)+8}{2}$, and the corresponding integer values of $y$:

| $x-4-k$ | $x-4+k$ | $x$ | $y_{1}$ | $y_{2}$ |
| :---: | :---: | ---: | :---: | :---: |
| 1 | 16 | $12 \frac{1}{2}$ |  |  |
| 2 | 8 | 9 | -6 | -21 |
| 4 | 4 | 8 | -10 | -10 |
| -16 | -1 | $-4 \frac{1}{2}$ |  |  |
| -8 | -2 | -1 | -1 | -1 |
| -4 | -4 | 0 | 0 | 0 |

The solutions are therefore:

$x$ is any integer and $y=0$

$x=-1$ and $y=-1$;

$x=9$ and $y=-6$

$x=9$ and $y=-21$;

$x=8$ and $y=-10$;

Note. Some people rearranged the equation in powers of $x$ after dividing by $y$:

$$
(y+3) x^{2}+(1-3 y) x+2 y^{2}=0
$$

In this case, special attention must be given to the case $y=-3$, because in this case the equation (in $x$) is not quadratic.