Prove that the polynomial $x^4 -5x^2+x+1$ is irreducible over the ring $\mathbb{Z}[x]$. I do not have an idea on how to approach this problem. Similar problems that I found online try to show that there does not exist a linear factor of the given equation in $\mathbb{Q}$. But my question is, how is that sufficient to prove that the polynomial is irreducible? It could also be a product of two quadratic polynomials which do not have a solution in $\mathbb{Q}$. Any help is appreciated!
 A: Write $f(x):=x^4-5x^2+x+1$. Since $f$ is monic, whenever $f=gh$ in $\mathbb{Z}[x]$, we may assume without loss of generality that both $g$ and $h$ are monic. You already know that $\operatorname{deg}(g)=1$ is impossible. Assuming $\operatorname{deg}(g)=\operatorname{deg}(h)=2$, we have $$x^4-5x^2+x+1=(x^2+ax+b)(x^2+px+q)\\=x^4+(a+p)x^3+(q+ap+b)x^2+(aq+bp)x+bq$$ for some integers $a,b,p,q$. Comparing coefficients, either $b=q=1$ or $b=q=-1$, but it is easy to check that both cases lead to contradiction. Hence $f$ is irreducible in $\mathbb{Z}[x]$.
Now use Gauss's lemma to conclude that $f$ is irreducible in $\mathbb{Q}[x]$.
A: For the degree 1 factors it's sufficient to show that it has no rational solutions as you said.
If this polynomial were the product of two polynomials of degree $2$, then the coefficients of the degree $2$ and $0$ terms can only be $1$ or $-1$. One of its factors would be $x^2+ax + c$, while the other one $x^2+bx + c$, where $c \in \{ -1,1 \}$. Now it's easy since we have only one real parameter.
We can immediately see that, since in the original polynomial we don't have the degree 3 term, $a=-b$. For the degree 2 term, we have $2c + ab=-5$. Putting together these two facts, we have:
$$2c-a^2=-5 \implies a^2=2c+5 \implies a^2=b^2=3 \text{ or } a^2=b^2=7  \ , $$
but none of these two equations has an integer solution, so the original polynomial is irreducible.
