Method stop · When and why do we use it?

Integer Roots of Quadratic Equations

In the Chinese book: 二次方程的整数根

For integer roots Δ must be a perfect square; Vieta and factoring do the rest.

Before this stop, visit:Integer Solutions of Equations (Method)

One idea, one pictureOpen the cells for one at a time. For which is a perfect square? What do the roots look like then?

Loading figure…

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
Loading figure…
  1. 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:

  1. Work out (an expression in the parameter) and set , where is a non-negative integer.
  2. Rearrange into “product of two integers = a specific number”, often using the difference of squares.
  3. 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?

Choose an answer first; then you can see the result.

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.

Loading figure…
Sift it yourself first and note the values of you find. Then look at the three solutions below.

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

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 .)

Loading figure…
Only get a ✓. is marked !, because it is not a quadratic equation.

Practice

Exercise 1Basic

Find all integers for which has integer roots. (Separate them with commas.)

Exercise 2Basic

is a positive integer, and the roots of are two different integers. Find the smallest possible .

Exercise 3Advanced

Find all integers for which both roots of are integers.

Exercise 4Challenge

and are both primes, and both roots of are positive integers. Find .

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Concluding the roots are integers because Δ is a perfect square

The wrong step: : is a perfect square, so both roots are integers.
What went wrong? Think first, then open

Diagnosis A perfect-square only guarantees that the square root comes out exactly, so the roots are rational. The formula still divides by : , giving and .

The right step: Use “ is a perfect square” as the first sieve. After that, actually work out the roots and see whether the numerator is divisible by .

“A square Δ is a necessary condition, not a sufficient one”

Exhibit

Writing down only the positive factor pairs

The wrong step: , so can only be , , .
What went wrong? Think first, then open

Diagnosis The problem only says the roots are integers, not positive integers. are integer factorizations too. Leave them out and you lose and .

The right step: List every integer factor pair of : , , , with matching signs. Then work out for each one.

“Integer factors can be positive or negative. List them all, then sift”