<s>[INST] Prove $d \mid a^2b+1$ and $d \mid b^2a+1 \implies d \mid a^3+1$ and $d \mid b^3+1$ Prove for all $a, b, d$ integers greater than zero, that when $d$ is a divisor of both $a^2b+1$ and $b^2a+1$ then $d$ is also a divisor of both $a^3+1$ and $b^3+1$

There is a trivial case when $a = b$, but I found that there are more solutions, for example: $a = 1, b = 3, d = 2$. I tried to use equation $a^3+1=(a+1)(a^2-a+1)$ but I am not sure how to progress.
 [/INST] Since $d \mid a^2\ b+1$ and $d \mid a\ b^2+1$ then $d \mid (1-b\ a^2)(a^2\ b+1)+a^3(a\ b^2+1) = a^3+1$
</s>