If $a^3+a^2+a=9b^3+b^2+b$ and $a,b$ are integers then show $a-b$ is a perfect cube.

It turns out that there are only two rational solutions of $a^3+a^2+a = 9b^3+b^2+b$. One is the obvious integer solution $(a,b)=(0,0)$, for which $a-b$ is the cube $0$. The other is $(a,b) = (-7/5, -3/5)$, for which $a-b = -4/5$ is not a cube but $a,b$ are not integers. So $a-b$ is indeed a cube for all the integer solutions, as desired.

The proof that there are no other rational solutions is elementary, but requires Fermat's method of descent. The equation $a^3+a^2+a = 9b^3+b^2+b$ defines a smooth cubic curve with a rational point at $(a,b)=(0,0)$, so it's an elliptic curve that we can bring to standard form $y^2=\text{cubic}(x)$ by projecting from the origin.

Let $(a,b)$ be any rational solution other than $(0,0)$. Then $b\neq 0$ because the nonzero solutions of $a^3+a^2+a$ are not rational (or even real). Write $a=mb$ and divide by $b$ to get $$ (9-m^3) b^2 + (1-m^2) b + (1-m) = 0. $$ This equation is quadratic in $b$, so it has rational solutions iff the discriminant is a square. The discriminant is $$ -3 m^4 + 4 m^3 - 2 m^2 + 36 m - 35 = (1-m)(3m-7)(m^2+2m+5). $$ Taking $m=1$ yields $8b^2 = 0$, so we're back to the $b=0$ solution; and $m=7/3$ yields $-4(5b+3)^2/27 = 0$, so $b=-3/5$ and $a=-7/5$. We claim that there are no other solutions.

If $m\neq 1$ we may write $m = 1+(8/x)$ and calculate $$ -3 m^4 + 4 m^3 - 2 m^2 + 36 m - 35 = \frac{2^8}{x^4} (x^3-2x^2-16x-48), $$ so we seek rational points on the elliptic curve $$ y^2 = x^3-2x^2-16x-48 = (x-6)(x^2+4x+8) $$ other than the "point at infinity". The point $(x,y)=(6,0)$ brings us back to $m = 1 + (8/6) = 7/3$, and it turns out there are no others. Since the cubic on the right-hand side has a linear factor, we can try to prove this using Fermat's descent, which turns out to be enough. But these days there are other resources we can try first: Cremona's mwrank or the LMFDB, and either of these tells us that there are no other solutions and that Fermat-style descent suffices to prove it. In the case of mwrank we'd need a bit of additional computation to exclude other torsion points, so let's go the database route: enter the coefficients [0,-2,0,-16,-48] into the "curve, label or isogeny class label" search window for elliptic curves over $\bf Q$, and find the entry for this curve of conductor 544 (which is small enough that it's also in Cremona's book). We find that the curve has only the known two torsion points and rank zero, and moreover that the 2-part of the Tate-Shafarevich group is trivial, so a 2-descent suffices to establish rank zero. This completes the proof.


Note: This is not a complete solution. It may give others some clues.

We have that $$(a-b)(a^2+b^2+ab+a+b+1)=8b^3 \tag{1}$$ Let

$$d=\gcd(a-b, a^2+b^2+ab+a+b+1).$$

And let $p$ be an odd prime divisor of $d$. Then $p \mid a-b$ and $p \mid b$. It follows that $p|a$. Since $p \mid a^2+b^2+ab+a+b+1$ we get $p \mid 1$. Contradiction. Thus only prime divisor of $d$ is $2$.

From equation $(1)$ observe that $a$ and $b$ have the same parity. Thus $a-b$ is even. So let $a-b=c=2^k (2l+1)$, where $l$ is an integer. Equation $(1)$ becomes.

$$c(3b^2+c^2+3bc+2b+c+1)=8b^3 \tag{2}$$

Notice that if $b$ is an even number then $3b^2+c^2+3bc+2b+c+1$ will be odd. Hence

$$d=\gcd\big(c, 3b^2+c^2+3bc+2b+c+1\big)=1.$$ And $c$ is a perfect cube. Now, suppose that $b$ is odd. Then, since $3b^2+1 \equiv 0 \pmod{4}$ we get $$3b^2+c^2+3bc+2b+c+1=3b^2+1+c(c+1+3b)+2b \\ =4m+2b=2(2m+b)$$Thus the highest power of $2$ dividing LHS of equation $(2)$ is $k+1$. And since $v_2($RHS$)=3$ we get that $k=2$. Thus $a-b=4(2l+1)$ cannot be a cube.

Maybe in this case there is no solution for the equation at all.


If $a-b=0\Longrightarrow b=0$ and $a-b$ is a perfect cube.
Also $a=0\Longleftrightarrow b=0$ and $a-b$ is a perfect cube.


Assume $a-b\ne0~\wedge~a\ne0~\wedge~b\ne0$.

Let's factorize $a^3+a^2+a=9b^3+b^2+b$.
$\begin{array}{rrcl} & (a^3-b^3)+(a^2-b^2)+(a-b) & = & 8b^3\\ \Longrightarrow & (a-b)(a^2+ab+b^2)+(a-b)(a+b)+(a-b) & = & 8b^3\\ \Longrightarrow & (a-b)(a^2+b^2+ab+a+b+1) & = & (2b)^3\\ \Longrightarrow & (a-b)\big(a^2+b^2+a(b+1)+(b+1)\big) & = & (2b)^3\\ \Longrightarrow & \underbrace{(a-b)}_X\underbrace{\big(a^2+b^2+(a+1)(b+1)\big)}_Y & = & (2b)^3 \end{array}$

Define $d=\gcd(X,Y)$.
Suppose $d>1\Longrightarrow\exists p\in\mathbb{N}:p\mid d$ and $p$ is prime.
Suppose $p>2\Longrightarrow p\mid X\Longrightarrow p\mid8b^3\Longrightarrow p\mid b^3\Longrightarrow p\mid b$.
Then $p\mid X~\wedge~p\mid b\Longrightarrow p\mid a\Longrightarrow p\mid a^2~\wedge~p\mid b^2$.
Then $p\mid Y~\wedge~p\mid(Y-1)\Longrightarrow p\mid1$.
Contradiction because $p>1\Longrightarrow p=2~\vee~d=1$.

If $a$ and $b$ are either both even neither both odd, then $X$ is odd and $a^2+b^2$ is odd and $(a+1)(b+1)$ is even, then $Y$ is odd so $2\nmid d$, and that's a contradiction because $8\mid XY$.

So $a$ and $b$ have the same parity, then $2\mid X$.

Suppose both $a$ and $b$ are even, then $a^2+b^2$ is even and $(a+1)(b+1)$ is odd, then $Y$ is odd. So $\gcd(X,Y)=1$, then $a-b$ is a perfect cube (it's easy to prove it).

Suppose both $a$ and $b$ are odd, then $\gcd(X,Y)=2$.
Also $\gcd(X,b)=1$, since $X\mid8b^3\Longrightarrow X\mid8\Longrightarrow8\le|X|\le8$.
But $|X|\ne8$ otherwise $Y\mid b^3$ but $2\mid Y\Longrightarrow2\mid b$.
Contradiction because $2\nmid b\Longrightarrow|X|=2~\wedge~|X|=4$.

Note: From now, the exercise contains a lot of work of pick & spade.

Since $\gcd(X,b)=\gcd(a-b,b)=1\Longrightarrow\gcd(a,b)=1$ (It's easy to prove it). We have $a^3+a^2+a=9b^3+b^2+b\Longrightarrow a(\underbrace{a^2+a+1}_A)=b(\underbrace{9b^2+b+1}_B)$
Then $a\mid B~\wedge~b\mid A$.
Let's define $f(x)=x^3+x^2+x$ and $g(x)=9x^3+x^2+x$, so we need $f(a)=g(b)$.

  • First case: $a-b=2\Longrightarrow a=b+2~\wedge~b=a-2$.
    $\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b+2)^2+(b+2)+1 & & \\ & = & b^2+4b+4+b+2+1 & & \\ & = & b^2+5b+7 & \Longrightarrow & b=\pm1~\vee~b=\pm7\\ B & = & 9b^2+b+1\\ & = & 9(a-2)^2+(a-2)+1\\ & = & 9a^2-36a+36+a-2+1\\ & = & 9a^2-35a+35 & \Longrightarrow & a=\pm1~\vee~a=\pm5~\vee~a=\pm7~\vee~a=\pm35 \end{array}$
    Here are only two possible solutions $(a,b)\in\left\{(1,-1),(-5,-7)\right\}$.
    But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
  • Second case: $a-b=-2\Longrightarrow a=b-2~\wedge~b=a+2$.
    $\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b-2)^2+(b-2)+1 & & \\ & = & b^2-4b+4+b-2+1 & & \\ & = & b^2-3b+3 & \Longrightarrow & b=\pm1~\vee~b=\pm3\\ B & = & 9b^2+b+1\\ & = & 9(a+2)^2+(a+2)+1\\ & = & 9a^2+36a+36+a+2+1\\ & = & 9a^2+37a+39 & \Longrightarrow & a=\pm1~\vee~a=\pm3~\vee~a=\pm13~\vee~a=\pm39 \end{array}$
    Here are only three possible solutions $(a,b)\in\left\{(-1,1),(1,3),(-3,-1)\right\}$.
    But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
  • Third case: $a-b=4\Longrightarrow a=b+4~\wedge~b=a-4$.
    $\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b+4)^2+(b+4)+1 & & \\ & = & b^2+8b+16+b+4+1 & & \\ & = & b^2+9b+21 & \Longrightarrow & b=\pm1~\vee~b=\pm3~\vee~b=\pm7~\vee~b=\pm21\\ B & = & 9b^2+b+1\\ & = & 9(a-4)^2+(a-4)+1\\ & = & 9a^2-72a+144+a-4+1\\ & = & 9a^2-71a+141 & \Longrightarrow & a=\pm1~\vee~a=\pm3~\vee~a=\pm47~\vee~a=\pm141 \end{array}$
    Here are only three possible solutions $(a,b)\in\left\{(1,-3),(3,-1),(-3,-7)\right\}$.
    But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.
  • Fourth case: $a-b=-4\Longrightarrow a=b-4~\wedge~b=a+4$.
    $\begin{array}{rclcl} A & = & a^2+a+1 & & \\ & = & (b-4)^2+(b-4)+1 & & \\ & = & b^2-8b+16+b-4+1 & & \\ & = & b^2-7b+13 & \Longrightarrow & b=\pm1~\vee~b=\pm13\\ B & = & 9b^2+b+1\\ & = & 9(a+4)^2+(a+4)+1\\ & = & 9a^2+72a+144+a+4+1\\ & = & 9a^2+73a+149 & \Longrightarrow & a=\pm1~\vee~a=\pm141 \end{array}$
    Here are no possible solutions $(a,b)\in\left\{\right\}$.
    But there are no solutions for this case because $\forall a,b:f(a)\ne g(b)$.

So it is proved.

PD: also I think $a=b=0$ is the unique (integer) solution for this equation, but I haven't proved this, what I proved is $a-b$ is a perfect cube and both $a$ and $b$ are even for all solutions to this equation.