Using Reduce over integers produces weird result
Regarding the title of the question, is the result of Reduce
really odd? Reduce
simply reduces systems of equations, inequalities, domain specifications, logical expressions etc. And so it is not too odd.
Quite frequently we get similar expressions in the output. A natural suggestion is to reformulate the input since there are two variables $x$ and $y$ while we have the only one equation and so in general there is a continuum (a submanifold) of solutions, even in integers one might expect infinitiely many solutions, although the latter is not the case here.
Given the equation there are some options in Reduce
, e.g. Backsubstitution -> True
which is sometimes helpful in similar problems, however not in our case. Nonetheless one can make Reduce
find all integer solutions adding some restriction on y
since there are infinitely many integer y
, however when you put e.g. -100 <= y <= 100
this solves the problem
{x, y} /. {ToRules @ Reduce[x^2*(1 + x) == y*(-1 + 3*y) &&
-100 <= y <= 100, {x, y}, Integers]}
{{-1, 0}, {0, 0}, {1, 1}, {4, -5}, {6, -9}}
Such a suplement is quite natural for those who are familiar with equation solving functionality.
I found later a question (Solutions given by WolframAlpha, asked a few hours ago) regarding the same equation. To answer a question on how many solutions one might expect, we observe that the original equation is an example of an elliptic cure equation ($q^2 = 4 p^3-g_2 p -g_3)$), we know that if there are two integer pairs of solutions there is also a third integer pair. With the original Reduce
result one can find that is equivalent to
$(6y-1)^2=12 x^3+12 x^2$ and it is straightforward to get the canonical elliptic cure equation by a simple linear transformation of $x$. There are five solutions since there is $(k y -1)^2$ , which doubles three integer solutions of elliptic curve and one is degenerate.
Use Solve
instead of Reduce
, with an extra constraint as given by @Artes:
Solve[x^2*(1 + x) == y*(-1 + 3*y) && -10^3 <= x <= 10^3, {x, y}, Integers]
(* {{x -> -1, y -> 0}, {x -> 0, y -> 0}, {x -> 1, y -> 1},
{x -> 4, y -> -5}, {x -> 6, y -> -9}} *)