Find all integer solutions to $x^2+xy+y^2=((x+y)/3 +1)^3$

diophantine equationsnumber theorypolynomials

Find all ordered pairs of integers $(x,y)$, that satisfy the following relation:

$$x^2+xy+y^2=((x+y)/3 +1)^3$$

I tried bashing at first. Then I assumed $x+y = 3k$ for some integer $k$ so that $y=3k-x$, substituted in the given equation and got a cubic polynomial involving $k$ and $x$ if I had solved it right. But I dont know how to proceed further. Please help. Any other solution is also welcome.

Best Answer

Bashing seems like a good approach. Setting $x+y=3k$ as you suggest, the equation becomes $$x^2-3kx+9k^2=(k+1)^3.$$ For a fixed integer $k$, we can consider this as a quadratic in $x$, and it has integer roots iff the discriminant $$(-3k)^2-4(9k^2-(k+1)^3))=-27k^2+4(k+1)^3$$ is a perfect square. Serendipitously, this discriminant factors as $$(k-2)^2(4k+1),$$ so it is a perfect square iff either $k=2$ or $4k+1$ is a perfect square. When $k=2$, $4k+1$ is in fact also a perfect square, so $4k+1$ is a perfect square in all cases.

We can thus write $4k+1=(2a+1)^2$ for some integer $a$, so $k=a^2+a$ and the discriminant is $(a^2+a-2)^2(2a+1)^2$. The quadratic formula then gives $$x=\frac{3a^2+3a\pm(a^2+a-2)(2a+1)}{2}$$ and $$y=3a^2+3a-x=\frac{3a^2+3a\mp(a^2+a-2)(2a+1)}{2}$$ which are a solution for any integer $a$. Or, simplified, we can say $x$ and $y$ are $a^3+3a^2-1$ and $-a^3+3a+1$ in some order.

Related Question