# How to find all polynomials with rational coefficients s.t $\forall r\notin\mathbb Q :f(r)\notin\mathbb Q$

How to find all polynomials with rational coefficients$f(x)=a_nx^n+\cdots+a_1x+a_0$, $a_i\in \mathbb Q$, such that $$\forall r\in\mathbb R\setminus\mathbb Q,\quad f(r)\in\mathbb R\setminus\mathbb Q.$$ thanks in advance

-
Any suggestion of your own to approach this? – Did Feb 8 '13 at 20:33
@did:i don't know how begin to solve this kind of question – Maisam Hedyelloo Feb 8 '13 at 20:39
Guess: $ax+b$ with $a,b\in\Bbb Q,\ a\ne 0$. – Berci Feb 8 '13 at 20:56
@beci:why ax+b is answer. – Maisam Hedyelloo Feb 8 '13 at 20:58
@Berci: those are clearly some or all of them because of the closure of the rationals under addition and multiplication. The question is whether that is all of them. – Ross Millikan Feb 8 '13 at 21:40

## 1 Answer

The only candidates are those polynomials $f(x)\in\mathbb Q[x]$ that are factored over $\mathbb Q$ as product of first degree polynomials (this is because if $\deg f>1$ and $f$ is irreducible then all of its roots are irrationals.)

The first degree polynomials have this property. Can you see that these are all?

(Hint: The polynomial $f(x)+q$, for suitable $q\in\mathbb Q$, is not a product of first degree polynomials)

-
Why these are all? – Berci Feb 8 '13 at 21:04
@Berci: can you see why ax+b can take on the value $\sqrt{2}$? If I had two of these linear polynomials as factors, what would happen? – Grumpy Parsnip Feb 8 '13 at 21:10
$f(x)=(x+1)(x+1)$ then $f(\sqrt2-1)=2$. – Asaf Karagila Feb 8 '13 at 21:16
Yes, for this particular one, it is clear. Well, probably the last hint helps.. – Berci Feb 8 '13 at 21:40
Uhmm, I think this line: "The only candidates are those polynomials f(x)∈Q[x] that are factored over Q as product of first degree polynomials (this is because if degf>1 and f is irreducible then all of its roots are irrationals.)" should be fixed, as it's not really correct. What if it can be factored to some product of second degree polynomials, all of which have no real roots? – user49685 Feb 8 '13 at 22:08