Find all pairs of integers $(x, y)$ such that $x^3+y^3=(x+y)^2.$ 
Find all pairs of integers $(x, y)$ such that $$x^3+y^3=(x+y)^2.$$

Since $x^3+y^3 = (x+y)(x^2-xy+y^2)$ we get that $$x^2-xy+y^2=x+y$$
this can be expressed as $$x^2-(y-1)x+y^2-y=0.$$
Since we want integers we should probably look at when the discriminant is positive?
$$\Delta = (y-1)^2-4(y^2-y)=-3y^2+6y+1$$
so for $\Delta \geqslant 0$
$$-\frac{2\sqrt3}{3}+1 \leqslant y \leqslant \frac{2\sqrt3}{3}+1$$
only possible solutions are $y=0,1,2.$ However I don't see how this is helpful at all here. What should I do?
 A: You are almost there. Substitute $y = 0, 1, 2$ and solve for $x$ in each case.
When $y=0$, the equation is $x^3 = x^2$. The two solutions for $x$ are $0, 1$.
When $y = 1$, the equation is $x^3+1 = (x+1)^2$. Expanding and rearranging gets $x^3-x^2-2x=0$, and the solutions are $x = -1, 0, 2$.
When $y = 2$, the equation is $x^3+8 = (x+2)^2$. Expanding and rearranging gets $x^3-x^2-4x+4 = 0$, and the solutions are $-2, 1, 2$. (You could use RRT to get the solutions.)
So far, we have eight pairs, namely $$(0, 0), (1, 0), (-1, 1), (0, 1), (2, 1), (-2, 2), (1, 2), (2, 2).$$
However, also note that when $x = -y$, the equation is satisfied, since $$(-y)^3+y^3 = ((-y)+y)^2 \rightarrow 0 = 0$$
Therefore, all possible solutions are $$(0, 1), (1, 0), (1, 2), (2, 1), (2, 2), \text{ and } (x, -x).$$
A: The solutions when $x=0,$ $y=0,$ $x=y$ and $x+y=0$ have already
been presented. I give a new argument for the remaining case.
Let $y=-x+t,$ where both $x$ and $t$ are nonzero. With this
substitution, the original equation becomes
$$3x^2-3tx+t^2-t=0\tag1$$
As a polynomial in $x,$ the discriminant for (1) is
$$ D=12t-3t^2=3t(4-t) \tag2$$
If $D=0,$ then $t=4,$ giving the solution $(x,y)=(2,2).$
The integer $D$ is positive iff $1\le t\le3.$
Since $D$ must be a square, it follows from (2) that
$3$ divides $t$ or $4-t.$ Hence, $t$ is $1$ or $3.$
For $t=1,$ (1) gives us $(x,y)=(0,1)\ \text{and}\  (1,0),$ which are not new.
For $t=3,$ (1) implies that $x$ is $1$ or $2,$ giving the solutions
$(1,2)\ \text{and}\  (2,1).$
