Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If $x^2-bx+a = 0$ and $x^2-ax+b = 0$ both have distinct positive integers roots, then $(a,b)$ is $______$?

My Try:: for first :: $\displaystyle x^2-ax+b = 0\Rightarrow x = \frac{a\pm \sqrt{a^2-4b}}{2}$

So Here $(a^2-4b)\in $ perfect square.

Similarly $\displaystyle x^2-bx+a = 0\Rightarrow x = \frac{b\pm \sqrt{b^2-4a}}{2}$

So Here $(b^2-4a)\in $ perfect square.

But I did not understand how can i solve after that.

plz help me


share|cite|improve this question
Then (a,b) is what? – Ian Coley Sep 15 '13 at 19:39
I mean ordered pair $(a,b)$ is – juantheron Sep 15 '13 at 19:45
You don't mean $\gcd$? – Git Gud Sep 15 '13 at 19:46
Yes Git Gud all ordered pair $(a,b)$ – juantheron Sep 15 '13 at 19:48
Git Gud is not referring to an ordered pair. Git Gud is asking if you are using the symbol, $(a,b)$, to mean the gcd (greatest common divisor) of $a$ and $b$. – user71352 Sep 15 '13 at 19:52
up vote 7 down vote accepted

Let the roots of $x^2 - ax +b$ be $r$ and $s$, and the roots of $x^2 - bx + a$ be $u$ and $v$. Then

$$\begin{align} r+s &= a\\ rs &= b\\ u+v &= b\\ uv &= a. \end{align}$$

Let, without loss of generality, $a \leqslant b$. Thus

$$\begin{align} uv &\leqslant u+v\\ \iff uv - u - v + 1 & \leqslant 1\\ \iff (u-1)(v-1) & \leqslant 1. \end{align}$$

So $u = 1$ or $v = 1$ or $u = v = 2$. But the roots are supposed to be distinct, hence $u = 1$ or $v = 1$. Without loss of generality, $u = 1$.

Thus $a = v = r+s$, $b = v+1 = rs$, so

$$rs = r+s+1 \iff (r-1)(s-1) = 2,$$

and that leaves $r = 2$, $s = 3$ (or vice versa), so $a = 5, b = 6$.

share|cite|improve this answer

Suppose $x^2-ax+b$ and $x^2-bx+a$ have positive integer roots. Then $$x^2-ax+b=(x-c)(x-d)\qquad\text{and}\qquad x^2-bx+a=(x-e)(x-f),$$ for some positive integers $c$, $d$, $e$ and $f$. As the roots are must be distinct, we may assume without loss of generality that $c>d$ and $e>f$. Now compare coefficients.

Hint 1:

It follows that $c+d=a=ef$ and $cd=b=e+f$.

Hint 2:

If $c>d>1$ then $cd>c+d$.

Hint 3:

If $d>1$ and $f>1$ then $cd>c+d=ef>e+f=cd$, a contradiction.

Hint 4:

Without loss of generality we have $f=1$, so $e=c+d$ and $e+1=cd$.

Hint 5:

It follows that $(c-1)(d-1)=2$, so $c=3$ and $d=2$, and hence $e=5$.

share|cite|improve this answer

Would a=b=4 work? In that case the (double) solution in both cases is 2 and that's positive

share|cite|improve this answer
The OP states that the roots are distinct. – Daryl Sep 15 '13 at 20:05
Bummer, couldn't be that easy I guess :) – imranfat Sep 15 '13 at 20:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.