Find all $m,n$ such that
$(m^2+n)(n^2+m)=(m-n)^3$ where $m,n$ are nonzero integers.
I expand this and found some equation.By checking ,I found two solutions $(-1,-1)$&$(8,-10)$. Please help me some this. My expression failed to find some finite relation so that I can find these.
I had gotten my answer . So don't post any command, answer .
From $(m^2 + n)(n^2+m) = (m-n)^3$ we get $$m^2 n^2 + 3 m^2 n - 3 m n^2 + m n + 2 n^3 = 0.$$ Since $n,m$ are non-zero, we can safely divide the whole thing by $n$ to get $$2n^2 + (m^2-3m)n + (3m^2 + m) = 0.$$ We can solve this quadratic equation in $n$: $$n = \dfrac{3m-m^2 \pm \sqrt{m(m-8)(m+1)^2}}{4}.$$
This means that $m(m-8)$ is a perfect square, say $p^2$. Let $q = m+4$ then $(q+p)(q-p) = q^2- p^2 = 16$.
There are up to $10$ integral solutions to the system of equations
$$\begin{cases}q+p = \pm 2^u \\ q-p = \pm2^v\end{cases} \qquad u,v \geq 0, u+v = 4.$$
Then you'd have to test if that solution for $m$ yields a valid solution for $n$ (we want the numerator to be a non-zero multiple of $4$). This yields all solutions.