# Suppose the cofficients of a quadratic are rational. How can we use the discriminant to determine if the roots are also rational?

Suppose the cofficients of a quadratic are rational. How can we use the discriminant to determine if the roots are also rational?

Firstly the discriminant has to be nonnegative.

I've had a read of Rational root theorem. I kinda get it but i'm not quite sure how to apply it to find a solution for the problem.

$$\sqrt{b^2-4ac} = \frac{p}{q}$$, where $$p, q \in \mathbb{Z}$$ and are coprime. $$b^2-4ac = \frac{p^2}{q^2}$$ $$q^2(b^2-4ac) = p^2$$ Am I going in the right direction ? I want reason that some $$p/q$$ does exist. Please guide me.

• I think you have this turned around. It is presumed that $a$, $b$, and $c$ are given. One then computes the single number $d = b^2 - 4ac$. Either this $d$ is or it is not a square rational number -- there is no solving to be done. Commented Dec 12, 2021 at 2:01

To find out if the roots are rational, you need to check if the discriminant $$b^2-4ac$$ (which is a rational number $$s/t$$) is a square of a rational number. We can assume that the fraction $$s/t$$ is in the lowest terms, i.e., $$s$$, $$t$$ are coprime integers. Then you just need to find out if $$s$$ and $$t$$ are perfect squares (of integers).

For example $$1/2x^2-x+1/4$$ has discriminant $$1/2$$ but $$2$$ is not a perfect square, so the roots are not rational. On the other hand, $$1/2x^2-3/2x+1$$ has discriminant $$9/4-2=1/4$$, where both $$1$$ and $$4$$ are perfect squares, so roots are rational.

• So we really answer this probelm rhetorically? And end by saying either $s$ and $t$ are perfect squares or not. There is no solving to be done?
– user839943
Commented Dec 12, 2021 at 2:29
• I don't quite understand the first sentence of your comment. Note that $s$ and $t$ are integers, not arbitrary rational numbers. To check that, say, $s$ is a perfect square, one needs, for example, to find its prime decomposition. Does this qualify for "solving"? Commented Dec 12, 2021 at 2:33
• Sorry, I mean the answer you gave is mainly words. Not a long drawn out algebra equations. I assume this is because for example it isn't possible to do a prime decomposition on variable.
– user839943
Commented Dec 12, 2021 at 2:40
• We don't have say much/do much to conclude this solution.
– user839943
Commented Dec 12, 2021 at 2:41
• To check if $s$ or $t$ is a square, you may need to say a lot. It is quite difficult in general. There are other methods to find rational solutions, and it is not clear which method is faster. Commented Dec 12, 2021 at 3:18