# Polynomials with same image on the rationals?

I am struggling with this problem:

If $P_1$ and $P_2$ are two polynomials such that $P_1(\mathbb{Q})=P_2(\mathbb{Q})$, show that $P_1(x)=P_2(ax+b)$ for some constants $a,b$.

Here is what I have done. First, taking a linearly independent basis over $\mathbb{Q}$ and expressing the coefficients with it, you can reduce the problem to that of rational polynomials $P_1,P_2$. If both are of odd degree, you can translate both polynomials so that near $x=0$, they are asymptotic to $kx$ for some $k$. Make them integer polynomials too (by multiplying them by a large enough number). Then evaluate $P_1(\frac{1}{q})$ for large primes $q$; then $P_2$ has to "catch up" with the denominator, so that $P_1(\frac{1}{q})=P_2(\frac{p}{kq})$. Constraints on $k$ quickly show that $P_1=P_2$. (I will not write all the details.)

I have, however, a technical difficulty with polynomials of even degree. They tend to positive infinity in both directions, and I cannot be sure that "these" large values of $x$ correspond to those, which would allow me to equate neighbourhoods and run the above argument. Or have I missed the best strategy by miles?

• Are the coefficients in $\mathbb Q$? Or $\mathbb R$? Am I understanding that it's $\mathbb R$ but by using a basis of $\mathbb R$ over $\mathbb Q$ you can reduce the problem to rational coefficients? – user4894 May 8 '17 at 0:13
• That's right. $\mathbb{Q}$ is enough to prove the real case – Yon Teh May 8 '17 at 2:18
• Is this problem from a well-known source? – Jose Brox Feb 6 '18 at 9:57
• I believe this is a problem from 1962 Miklós Schweitzer Competition. – user2249675 Nov 20 '18 at 4:20