$x^2+px+q=0$ where $p+q=2017$, find integers only $x_1$ and $x_2$

100 Views Asked by At

Using a program I found one pair only x1=-1 x2=-1008, maybe there are more, but I need a step by step mathematical solution.

3

There are 3 best solutions below

0
On BEST ANSWER

By Vieta: $x_1+x_2=-p$ and $x_1x_2=q$ so:

$x_1x_2-x_1-x_2+1=p+q+1=2018$

$(x_1-1)(x_2-1)=2018$

So you can get $x_1$ and $x_2$ by factoring $2018$.

The prime factoring of $2018$ is $2\cdot 1009$

So $2018=(\pm 1)\cdot(\pm2018)=(\pm 2)\cdot (\pm 1009)$

Which gives you $8$ solutions:

$(-1,-2017),(-2017,-1),(2,2019),(2019,2),(-1,-1008),(-1008,-1),(3,1010),(1010,3)$

0
On

The discriminant is $$p^2-4q=p^2-4(2017-p)=(p+2)^2-4\cdot2018$$ which needs to be perfect square.

If $(p+2)^2-4\cdot2018=r^2\iff(p+2+r)(p+2-r)=4\cdot2018$

Now as $(p+2+r)\pm(p+2-r)$ are even and the Right Hand Side, both $(p+2+r),(p+2-r)$ have to be even

$$\dfrac{p+2+r}2\cdot\dfrac{p+2-r}2=2018=2\cdot1009$$

0
On

$\begin{align}{\bf Hint}\quad x^2\! + px +q-1 \,&=\ \ {-}1\\[.1em] -\ (\, q + p\, &=\ \ \ 2017\,)\\[.1em] \hline \Rightarrow\quad { x^2\! + px - p-1} &=\, -2018\\[.1em] {\rm i.e.}\quad (x\! -\! 1)\ (x\! +\! p\!+\!1) &=\, -2018 \end{align}$