Find all ordered pairs $(p,q)$ of natural numbers such that all $4$ the roots of $$f(x)=(x^2-px+q)(x^2-qx+p)$$ are natural numbers.
I got a solution of the problem (see below) but I want some alternatives.
My solution
Let $f(x)=(x^2-px+q)(x^2-qx+p)$. Since both quadratics must be nonnegative at $x=1$, $f(1)\ge 0$. Putting $x=1$, we get $(1-p+q)(1-q+p)\ge 0$. After simplifying this we get $(p-q)^2 \le1$, which implies that either $p-q=1$ or $p=q$ or $q-p=1$.
Let the roots of $x^2-px+q$ be $m,n$ and of $x^2-qx+p$ be $r,s$. Consider $p=q$, so $m+n=mn$ therefore $m=n=2$ which implies $p=q=4$. Now consider $p-q=1$, so $m+n-mn=1$, leading to infinite solutions, so looking at $x^2-qx+p$, $r+s=q$ and $rs=p$, so $rs-(r+s)=1$ giving $r=3 $ and $s=2$. So $p=6$ and $q=5$.
Similarly if we proceed with $q-p=1$ we get $q=6$ and $p=5$. Hence the pairs are $(4,4)$, $(5,6)$, $(6,5)$.
Here's my take at the problem. Let $a\leq b$ be the roots of the first equation and $c\leq d$ of the second one. Vieta's formulas then tell us that $$\begin{array}{ccccc} a+b & = & p & = & cd \\ c+d & = & q & = & ab \\ \end{array}$$
Adding the two and moving everything to one side yields $$ab + cd - (a+b) - (c+d) = 0$$ or, equivalently, $$(a-1)(b-1) + (c-1)(d-1) = 2$$
There are three possibilities: