# Show that a rational function under some constraint is actually a polynomial.

#### caffeinemachine

##### Well-known member
MHB Math Scholar
Let $r(x)\in\mathbb Q(x)$ be a rational function over $\mathbb Q$. Assume $r(n)$ is an integer for infinitely many integers $n$. Then show that $r(x)$ is a polynomial in $\mathbb Q[x]$.

#### Opalg

##### MHB Oldtimer
Staff member
Let $r(x)\in\mathbb Q(x)$ be a rational function over $\mathbb Q$. Assume $r(n)$ is an integer for infinitely many integers $n$. Then show that $r(x)$ is a polynomial in $\mathbb Q[x]$.
Let $r(x) = \dfrac{p(x)}{q(x)}$, where $p(x),\,q(x)\in \mathbb Q[x]$. Apply Euclid's algorithm in $\mathbb Q[x]$ to see that $p(x) = a(x)q(x) + b(x)$, where $a(x),\,b(x) \in\mathbb Q[x]$ and $\deg(b(x)) < \deg(q(x)).$ Then $$r(x) = a(x) + \frac{b(x)}{q(x)}.$$ Now choose $n$ to be a multiple of the lcm of the denominators of the coefficients of $a(x)$. Then each term in the polynomial $a(n)$ is an integer except perhaps the constant term. Let $c$ be the fractional part of the constant term. If $b(x)$ is not the zero polynomial then by choosing $n$ large enough we can ensure that $|b(n)/q(n)|$ is nonzero, less than $1$ (because $\deg(b(x)) < \deg(q(x))$), and $b(n)/q(n)$ is different from $-c$ and $1-c$. That would mean that $r(n)$ is not an integer.

The conclusion is that $b(x)$ must be $0$ and therefore $r(x) = a(x) \in \mathbb{Q}[x]$.

#### caffeinemachine

##### Well-known member
MHB Math Scholar
Let $r(x) = \dfrac{p(x)}{q(x)}$, where $p(x),\,q(x)\in \mathbb Q[x]$. Apply Euclid's algorithm in $\mathbb Q[x]$ to see that $p(x) = a(x)q(x) + b(x)$, where $a(x),\,b(x) \in\mathbb Q[x]$ and $\deg(b(x)) < \deg(q(x)).$ Then $$r(x) = a(x) + \frac{b(x)}{q(x)}.$$ Now choose $n$ to be a multiple of the lcm of the denominators of the coefficients of $a(x)$. Then each term in the polynomial $a(n)$ is an integer except perhaps the constant term. Let $c$ be the fractional part of the constant term. If $b(x)$ is not the zero polynomial then by choosing $n$ large enough we can ensure that $|b(n)/q(n)|$ is nonzero, less than $1$ (because $\deg(b(x)) < \deg(q(x))$), and $b(n)/q(n)$ is different from $-c$ and $1-c$. That would mean that $r(n)$ is not an integer.

The conclusion is that $b(x)$ must be $0$ and therefore $r(x) = a(x) \in \mathbb{Q}[x]$.
That's good. Here's mine.

Let $r(x)=g(x)/f(x)$ for some $f(x),g(x)\in\mathbb Q[x]$. Clearing the denominators of $f$ and $g$ we can write $r(x)=g_1(x)/f_1(x)$ for some $g_1,f_1\in\mathbb Z[x]$. By hypothesis
\begin{equation*}
\exists N_i\in \mathbb Z\text{ such that } N_{i}<N_{i+1}\text{ and }f_1(N_i)|g_1(N_i)\text{ for all } i>0\tag{1}
\end{equation*}
Now by Euclid we can write $f(x)a(x)+g(x)b(x)=1$ for some $a(x),b(x)\in\mathbb Q[x]$. Clearing the denominators we can write the last equation as
\begin{equation*}
f_1(x)a_1(x)+g_1(x)b_1(x)=n\text{ for a fixed }n\in\mathbb Z\text{ and }a_1(x),b_1(x)\in\mathbb Z[x]\tag{2}
\end{equation*}
But from (1) and (2) we have that $f_1(N_i)|n$ for all $i>0$. Since there are only finitely many factors of $n$ we must have a factor $d$ of $n$ such that $f_1(N_i)=d$ holds for infinitely many $N_i$'s. This is impossible since if this were true then the polynomial $z(x)=f_1(x)-d$ would have infinitely many distinct roots. This furnishes the required contradiction and the proof is complete.$\blacksquare$