0

If $p+q=198$ find the integer solution of the equation $x^2+px+q=0$

My attempt:

Suppose the integer roots are $\alpha,\beta$ then we have $$\alpha+\beta=-p$$ and $$\alpha\beta=q$$ Also, $$p^2-4q\ge0$$ The first two equations imply that both $p$ and $q$ are also integers. Now we have to find $p$ and $q$ such that, $p+q=198$ and $p^2-4q\ge0$

I don't know how to solve these equations. I haven't learnt linear programming yet. I also found out that the inequality is strict i.e. $$p^2-4q>0$$ as if $p^2-4q=0$ then we'll not get integer $p$ and $q$ after solving.

Bill Dubuque
  • 282,220
Vanessa
  • 1,241
  • 1
    You don't just have to find $p^2 - 4q \ge 0$ you must have $\sqrt{p^2-4q}$ is a perfect square. Now you know $q=198-p$ so we need $p^2 - 4p - 796$ is a perfect square. So $p^2 -4p +4 = k^2 + 800$ and $(p-2)^2= 800+k^2$. Two answers leap immediately to mind. – fleablood Oct 26 '22 at 05:19
  • @fleablood A couple of fairly minor points are that with $q = 198-p$, we have $p^2-4q = p^2-4(198-p) = p^2+4p-792$, i.e., your $-4p$ should be $4p$, and your $796$ should be $792$, instead. – John Omielan Oct 26 '22 at 05:36
  • It's easy: solve $,\alpha\beta - (\alpha + \beta) = q + p = 198,$ by completing the product (rectangle) as explained in the linked dupe. – Bill Dubuque Oct 26 '22 at 06:19

0 Answers0