<s>[INST] Is the polynomial $x^5 - 5x^4 + 7x^3 + x^2 + x - 1$ irreducible in $\mathbb{Z} [x]$ or in $\mathbb{Q} [x]$? Is the following polynomial irreducible in $\mathbb{Z}[x]$ or in $\mathbb{Q}[x]$?
$x^5 - 5x^4 + 7x^3 + x^2 + x - 1$
If it's reducible, there should be a linear factor with degree $1, 2$ or $3.$
I try $\mathbb{Z}_2[x]$ and we get $x^5 +x^4 + x^3 + x^2 + x + 1$ looking for roots $f(0) = 1$ and $f(1) = 6 = 6 \mod 2 = 0$. So it's reducible in $\Bbb Z_2[x]$?
Does this help me?
I see the polynomial is also primitive, so if I prove that it's irreducible in $\mathbb{Q}[x]$ or $\mathbb{Z}[x]$, then it's also irreducible in $\mathbb{Z}[x]$ or $\mathbb{Q}[x]$.
If I use rational root system, there is no root for $x^5 - 5x^4 + 7x^3 + x^2 + x - 1$, so there can only be a decomposition in degree $2+3$.
I don't know how to show now, that it's irreducible.
 [/INST] By the Rational Root Theorem, the only possible linear factors are $(x\pm1)$, but evaluation at $\mp1$ shows that this is not the case.
Modulo $2$, we have the factorization
$$x^5+x^4+x^3+x^2+x+1\equiv (x^2+x+1)(x^3+1)\equiv (x^2+x+1)^2(x+1)$$
Hence any quadratic factor in $\Bbb Z[x]$ must $\equiv x^2+x+1\pmod 2$, i.e, all coefficients odd, moreover leadeing $1$, and of course constant term $\pm1$, in other words: $ x^2+ax\pm1$ with odd $a$. Similarly, the corresponding cubic factor must be $x^3+bx^2+cx\mp1$ with $b,c$ even.
We compute
$$(x^2+ax\pm1)(x^3+bx^2+cx\mp1)
=x^5+(a+b)x^4+(ab+c\pm1)x^3+(ac\pm b\mp1)x^2+(\pm c\mp a)x-1 $$
so from the linear term
$$ c=a\pm1$$
and from the fourth power term
$$ b= -a-5.$$
Plug this into the cubic term
$$ ab+c=7\mp1$$
to arrive at
$$ a(a+4)=\pm2-7=-5\text{ or }-9,$$
which has no integer solution (two factors of $-5$ or $-9$ must  differ by at least $6$).
</s>