In one sentence
For a quadratic equation with integer coefficients, the roots are . For the roots to be integers, must first be an integer, that is, must be a perfect square. Perfect squares are rare, so this one condition sifts out most of the possibilities at once.
It works together with two other tools: Vieta's formulas (the sum and product of integer roots are integers too, so you can factor), and swapping roles (solve for the parameter as if it were the unknown and look at divisibility).
Sifting: when does x² + kx + 6 = 0 have integer roots?
Step 1 / 5- k = 3
. There are not even real roots, let alone integer ones.
Stop 1 · The discriminant is a perfect square
The method above comes down to three steps:
- Work out (an expression in the parameter) and set , where is a non-negative integer.
- Rearrange into “product of two integers = a specific number”, often using the difference of squares.
- List all the factor pairs, sift again using same parity, solve for the parameter in each case, and finally check that the roots really are integers.
Predict first
is a positive integer and both roots of are integers. How many such are there?
. For this to be a perfect square, must be a perfect square: ( gives , which is not positive).
So : values in all, with roots , , .
Another way is quicker: the roots add up to and multiply to , so both are positive integers, and the only pairs of positive integers with sum are , , .
Stop 2 · Vieta's formulas plus factoring
When the parameter appears in two coefficients, is often ugly. Then let the roots speak for themselves: you can read off their sum and product, eliminate the parameter, and what is left is an integer equation in and alone.
Find all integers for which both roots of are integers.
One problem, several solutions
Find all integers for which both roots of are integers.
Vieta's formulas
and . Subtract to eliminate : .
Add to both sides and the left side factors: .
The integer factor pairs of (taking ): , , , .
The roots are then , , , , so .
CostYou have to spot an expression that factors, but there is the least calculation.
The discriminant
.
Let (with ): . The two factors have the same parity, and the first is not larger than the second.
So they can only be , , , , giving .
So . Substitute back: the roots are all integers.
CostThe most routine path, but you must complete the square again and watch the parity.
Treat k as the unknown
appears only to the first power. “Solve” for it: .
At the left side is and the right side is , which is impossible, so and .
is an integer, so divides : , that is, .
This gives . So . (If one root is an integer and the sum is an integer, the other root is automatically an integer too.)
CostOnly works when the parameter appears to the first power, but then it is very quick.
Stop 3 · If it factors, factor first
Find all integers for which the roots of are all integers.
Work out the discriminant: . It is a perfect square for every ! Does every work, then? Open a few cells and see.
Break it
Counterexample lab: remove one condition
Conclusion: for the values of where is a perfect square, the roots are all integers ← still true?
Work the roots out honestly. The left side factors by the cross method: , so for the roots are and .
is an integer if and only if divides : . (At the equation becomes the linear equation , with the single root .)
If you judge only by “is a perfect square?”, then , , … all go into the answer.
At , , yet the roots are and . A perfect-square only tells you the roots are rational; to be integers they still have to get past “divide by ”. So the best method for this problem is not the discriminant at all: factor first.
Practice
Find all integers for which has integer roots. (Separate them with commas.)
is a positive integer, and the roots of are two different integers. Find the smallest possible .
Find all integers for which both roots of are integers.
and are both primes, and both roots of are positive integers. Find .