Which quadratic equations with integer coefficients have rational roots?

611 Views Asked by At

$$ax^2+bx+c=0$$

How to choose $a$, $b$, $c$ so that the solutions of the quadratic equation are rational, $x_{1,2}\in\mathbb Q$ ?
$(a,b,c\in\mathbb Z\ne0)$

Surely, that's the case if and only if the $D$ is a square number.


Since $D = b^2-4ac = d^2$, I went to find the differences between $2$ squares which are divisible by $4$ and found out that by picking any integer $b$, then $a$, $c$ can be picked as any two integers that satisfy the following conditions (where $k$ is used to represent $b$, and $n$ can be any valid integer as the conditions state):

$$ b=2k, k\in\mathbb N \\ a\times c = -(n-k)(n+k) \\ n\in\mathbb Z, n\ge0, n\ne k \\ \ \\ b=2k-1, k\in\mathbb N \\ a\times c = -n(n+b) \\ n\in\mathbb Z, n\ge-k, n\ne 0$$

For a chosen $b$ depending if it's even or odd, we can first chose $n$, and then choose $a$ and $c$ as any combination satisfying the given conditions. If $a$, $b$, $c$ are chosen this way, the roots of the coresponding equation will always be rational.

Each set of solutions $(a,b,c)$ given this way can be of course multiplied by any integer $\ne0$ to give a "new" sets of solutions which will all have of course the same roots as the original set.


I believe that if I haven't made a mistake, that these conditions can solve my initial question and can produce all valid sets of $(a,b,c)$.

My question is firstly if I'm wrong, to be corrected, otherwise/then how would one combine such conditions so that we can generate all sets of $(a,b,c)$ ?
Since there are $\infty$ many solutions we can't simply write them down but rather a way to generate them.
(Of course we can omit cases which produce the same two roots as a previous case)


All in all, I'm specificly asking for the answer to the first question below the title and the rest is basically my thoughts and the progress I managed to make so far.

1

There are 1 best solutions below

4
On BEST ANSWER

Hint:

These equations factor as

$$a(x-p)(x-q)=a(x^2-(p+q)x+pq)=0$$ where $p,q$ are rational. Take any rationals such that $apq$ is an integer.

More specifically, consider all factorizations $a=a_0a_1$ and let $p=m/a_0,q=n/a_1$.

The coefficients are

$$a,-(ma_1+na_0),mn.$$

But there are duplicates.