Determine all pairs $(p,q)$ of integer numbers for which all zeros of $x^2+px+q$ and $x^2+qx+p$ are integers.

103 Views Asked by At

Determine all pairs $(p,q)$ of integer numbers for which all zeros of $x^2+px+q$ and $x^2+qx+p$ are integers.

I need help trying to understand the solution of this problem. This is what it says on the solution

-If $p=q=0$ the integer root is $0$.

-If one of $p$ or $q$ is zero then for $r,t \in \mathbb Z$ we have the pairs $(0,-r^2)$ when $p=0$ and $(-t^2,0)$ when $q=0$

Now suppose that $p,q \neq 0$.

From Vieta's formula for the polynomial $x^2+px+q$ we have $|q|=|x_1x_2| \geq |x_1|+|x_2|-1 =|p|-1$ where $x_1,x_2$ are the roots of the polynomial

I know that the inequality is true from the fact that for $a\geq 1, b\geq1$ we have

$ab-a-b+1= (a-1)(b-1)\geq0$

Similar for the roots of the polynomial $x^2+qx+p$ we get $|p|\geq |q|-1$

From the two relaions, we have $||p|-|q||\leq1$. Now since $p,q \in \mathbb Z$ we have two possibilities $|p|=|q|$ or $|p|=|q|\pm 1$.

Now, this is the part where I don't understand. In my book, it says that for $|p|=|q|$ we have $p^2-4q=p^2 \pm 4p$ and since the roots should be integers we get $(p,q)=(4,4)$.

How did we get that? Do we just equal $p^2 \pm 4p$ with $0$?

Why don't we have more solutions?

Also for $|p|=|q|\pm 1$ it says that simply we show that in this case, we have the pairs $(r,-1-r), r \in \mathbb Z$ like $(5,6)$ and $(6,5)$.

I don't understand this either.

I would really appreciate some help

1

There are 1 best solutions below

1
On

$$p^2\pm 4p = a^2$$ for some integer $a$ so $$ p^2\pm 4p+4 = a^2+4$$

so $$(p\pm 2)^2-a^2=4$$or $$ (p\pm 2-a)(p\pm 2+a)=4$$ Now from here we don't have much choises, do we?