Method stop · When and why do we use it?

Integer Solutions of Equations

In the Chinese book: 方程的整数解

Integer solutions are lattice points: divide, factor, bound, check parity.

📖 Chapter 15 of 《方程与方程组》M6 Bounding lineM12 Parity lineM15 Estimation line

Before this stop, visit:Quadratic Systems in Two Unknowns (Skill)

One idea, one picturePens cost 3 yuan each and notebooks 5 yuan each, and you spend exactly 47 yuan. Drag t to hop along the line from one lattice point to the next. How many ways are there to shop?

Loading figure…

In one sentence

One equation in two unknowns has infinitely many real solutions, joined up into a curve. But if you only want integer solutions, everything changes: they are the lattice points the curve happens to pass through. They are few and far between, often only finitely many, sometimes none at all.

The whole art of finding integer solutions is to use the properties only integers have — divisibility, factorization, bounds, parity — to sift infinitely many candidates down to a few you can count.

Example: positive integer solutions of 3x + 5y = 47

Step 1 / 5
Loading figure…
  1. Find one first

    Try a few values of : at , , so . So is an integer solution, and the line passes through this lattice point.

Stop 1 · Divisibility: does the line ever hit a lattice point?

need not have integer solutions. Whatever integers and are, the left side is a multiple of the greatest common divisor of and . If the right side is not, there is no hope.

Break it

Counterexample lab: remove one condition

Conclusion: has integer solutions

: the gcd of and is , and is a multiple of . The line has lattice points on it, one at regular intervals.

Loading figure…

Stop 2 · Factorization: turn a sum into a product

The equation looks hard to get a grip on. But add to both sides and the left side factors:

There are only finitely many ways for two integers to multiply to . Each way of splitting it gives one lattice point on the curve.

Predict first

How many integer solutions does have? (Count both positive and negative ones.)

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

Stop 3 · Bounds: fence in the range, then check one by one

. A square is never negative, so and . The candidates shrink at once from “every integer” to about a dozen, and you can just check them one at a time.

Loading figure…
Drag from to . At each column there is only one question: is a perfect square?

The key to this move is first proving that there are only finitely many candidates. Once the range is fenced in, even the slow way is sure to finish.

Stop 4 · Parity: sometimes there are no solutions at all

One problem, several solutions

Find the positive integer solutions of .

Factor into a product

. Since and are positive integers, , so there are only two ways to split it:

  • , : ,
  • , : ,

Two solutions: and .

CostFastest, but the equation itself must factor.

Bound the range, then list

, so and . So , and .

Substitute one by one and see whether is a perfect square: only () and ().

CostDoes not need factoring, but takes more tries.

What happens to the same equation if we change to ?

x² − y² = 30 has no integer solutions

Step 1 / 4
  1. Factor first, as before

    .

Practice

Exercise 1Basic

How many positive integer solutions does have?

Exercise 2Basic

Among all integer solutions of , what is the largest value of ?

Exercise 3Advanced

How many integer solutions does have?

Exercise 4Challenge

How many positive integer solutions does have?

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

Swapping the step sizes in the general solution

The wrong step: One solution of is , so all integer solutions are , .
What went wrong? Think first, then open

Diagnosis Try : , and . Adding to adds to the left side, and taking from takes away . They do not cancel.

The right step: The changes must cancel: add (the coefficient of ) to and the left side gains ; take (the coefficient of ) from and it loses . So , .

“The step for x is the coefficient of y, the step for y is the coefficient of x, one up and one down”

Exhibit

Thinking only of positive factors

The wrong step: Find the integer solutions of : , so there are .
What went wrong? Think first, then open

Diagnosis The question asks for integer solutions, not positive integer solutions. Two negative numbers can also multiply to : , , , .

The right step: There are factor pairs, positive and negative, and each gives one solution: in all. For example, , gives .

“First make sure whether you want integer solutions or positive integer solutions”