Find all positive integers $a,b$ such that each of the equations $x^2-ax+b=0$ and $x^2-bx+a=0$ has distinct positive integral roots. 
Find all positive integers $a,b$ such that each of the equations $$x^2-ax+b=0$$ and $$x^2-bx+a=0$$ has distinct positive integral roots.

Suppose $\alpha,\beta$ are roots of the first equation and $\gamma,\delta$ are of the second, then we have these two sets of equations 
$$a=\alpha+\beta$$ $$b=\alpha\beta$$
and
$$b=\gamma+\delta$$ $$a=\gamma\delta$$
How to proceed?
 A: A long answer, I'm afraid, but I think it's correct. Please let me know if anything is unclear.
Observe first that $a/b = 1/\beta + 1/\alpha < 2$ and similarly $b/a < 2$. That is, $a < 2b$ and $b < 2a$. But now, assuming wlog $\alpha > \beta$, the previous inequality says:
$$\alpha \beta < 2\alpha + 2 \beta < 4 \alpha,$$
meaning $\beta < 4$. Of course, there's a similar statement for $(\gamma, \delta)$, but let's work with $(\alpha,\beta)$, remembering that whatever we find for $(a,b)$ can be swapped to yield another solution $(b,a)$. (Which we would have found if we had used ($\gamma, \delta$).)
If $\beta = 3$, then $b = 3 \alpha < 2a = 2 \alpha + 2 \beta = 2 \alpha + 6$, i.e. $\alpha < 6$, forcing $\alpha = 4$ or $5$. Neither of these choices work, by a routine check.
If $\beta = 2$, then $4 - 2a + b = 0$ by the first equation, i.e. $b = 2a - 4$. But then 
$$b^2 - 4a = 4a^2 - 20a + 16 = 4(a^2 - 5a + 4)$$
needs to be a perfect square, meaning $a^2 - 5a + 4 = c^2$ for some $c$, so $a = (10 \pm \sqrt{9+(2c)^2})/2$ by the quadratic formula. But the expression under the square root here has to be odd, so $a$ cannot be an integer – contradiction.
Thus $\beta = 1$, and we arrive at $b = a - 1$. Now, the roots of $x^2 - (a-1)x + a = 0$ are
$$x = \frac{a-1 \pm \sqrt{(a-1)^2 - 4a}}{2};$$
thus we require the discriminant $(a-1)^2 - 4a = a^2 - 6a + 1$ to be a perfect square, say $a^2 - 6a + 1 = c^2$ for some $c$, so $a = (6 \pm \sqrt{32 + (2c)^2})/2$ by the quadratic formula again.
It will have to be plus, to ensure $a > 0$, and $32 + (2c)^2$ now has to be a square, say $32 + (2c)^2 = d^2$. But then $32 = (d-2c)(d+2c)$, forcing $d - 2c = 1, 2,$ or $4$, since it must be less than $\sqrt{32} = 4 \sqrt2$. But $d$ is even, so actually $d - 2c = 2$ or $4$. Suppose $d = 2c + 2$, so
$$32+ (2c)^2 = (2c+2)^2.$$
Then $32 = 8c + 4$, which is impossible. Hence $d = 2c + 4$ and we get $32 + (2c)^2 = (2c + 4)^2$ or $32 = 16c + 16$, i.e. $c = 1$, $a = 6, b = 5$. 
