1. ## Square equation problem

Hello
I have equation:
Code:
x^2 - px + q = 0
Equation has 2 solutions. p and q are integer and positive. How many different p and q exsist if both solutions are less then 5 (x1,x2<5).

2. Originally Posted by matt12345
Hello
I have equation:
Code:
x^2 - px + q = 0
Equation has 2 solutions. p and q are integer and positive. How many different p and q exsist if both solutions are less then 5 (x1,x2<5).
I do not understand this (x1,x2<5).
Could you explain what that means in this situation?

Since p & q are integers, x must be greater than zero, and an integer.
Code:

x  p  q
1  1  0
1  2  1
1  3  2
1  4  3
2  2  0
2  3  2
2  4  4
3  4  3
That's eight solutions.
If you removed x=1, p=1, q=0 and x=2, p=2, q=0, you would still have 6 solutions.

Could you explain the restrictions so that only 2 work?

3. Originally Posted by matt12345
Hello
I have equation:
Code:
x^2 - px + q = 0
Equation has 2 roots. p and q are integer and positive. How many different p and q exsist if both roots are less then 5 (x1,x2<5).
x1 and x2 are roots
Root (mathematics) - Wikipedia, the free encyclopedia

Sorry for my English

4. ref

5. Condition 1:

Since roots are real and distinct:

$\displaystyle Discriminant>0$

$\displaystyle p^2-4q>0$

$\displaystyle 4q<p^2$................................(1)

Condition 2:

Since both roots are less than $\displaystyle 5$,the sum of the roots will be less than $\displaystyle 10$.

$\displaystyle p<10$

Condition 3:
Let $\displaystyle f(x)=x^2-px+q$

$\displaystyle f(5)>0$

$\displaystyle 25-5p+q>0$

From conditions 1,2 and 3 we can see that $\displaystyle 0<p<10$ and $\displaystyle 0<q<25$,where p and q are integers

I hope this helps.

6. THX

Why and what does this give? Why q<25 ?
What will be the resualt?

7. Since $\displaystyle x_{1}$ and $\displaystyle x_{2}$ are roots of $\displaystyle f(x)=0$,so $\displaystyle (x-x_{1})$ and $\displaystyle (x-x_{2})$ are factors of f(x)=0

$\displaystyle f(x)=x^2-px+q=(x-x_{1})(x-x_{2})$

Since both the roots are less than $\displaystyle 5$,clearly both $\displaystyle (5-x_{1})$ and $\displaystyle (5-x_{2})$ are positive.Thus

$\displaystyle f(5)=5^2-p(5)+q=(5-x_{1})(5-x_{2})>0$

Since $\displaystyle 4q<p^2$

$\displaystyle 0<p<10$

$\displaystyle \therefore 4q<p^2<100$

due to which $\displaystyle 0<q<25$

Now these values of $\displaystyle p$ and $\displaystyle q$ must also satisfy the condition $\displaystyle f(5)>0$

$\displaystyle 5p<25+q<25+25$

$\displaystyle p<10$.

Thus the values $\displaystyle 0<p<10$ and $\displaystyle 0<q<25$ also satisfy the condition $\displaystyle f(5)>0$

8. Thx
But I don't know how many p&q satisfy the condition x^2 - px + q = 0 ?
For exaple in this reason result is 16 (I have written program in c++ and check a lot of p & q, if condition was satisfied r++ and r was a resault).
How can I get that?

9. I do not understand your querry