Prove that the polynomial $x^5+2x+1$ is irreducible over $\mathbb{Z}$. Show that there do not exist polynomials $p(x)$ and $q(x)$ , each having integer coefficients and of degree greater than or equal to 1 such that: $$p(x)\cdot q(x) = x^5 + 2x + 1 $$

My approach
I found that only possible integral root of the $x^5 + 2x + 1 = 0 $  is ± 1 and these are not the zeroes of the polynomial. Hence obviously it doesn't have any linear factor. So i assumed $q(x)$ to be a third degree polynomial and $p(x)$ to be a second degree polynomial . That is ;$$p(x)=x^2+ax+b$$ $$q(x)=x^3+cx^2+dx+e$$ But i don't know how to solve it further. So please help me with this. And if there is some other approach to this question, then please share it .
 A: The $f(4)=1033$ is a prime, and the polynomial is irreducible by Cohn's irreducibility criterion. 
If we invert the polynomial to $g(x)=x^5f(1/x)=x^5+2x^4+1$, we can also use Perron's criterion (can be found in Prasolov's book Polynomials, Theorem 2.2.5):

(Perron's criterion, non-sharp version) Let $f(x)=x^n+a_1x^{n-1}+\dots+a_n$ be a polynomial with integer coefficients such that $a_n\neq 0$. If $|a_1| \geq 1+|a_2|+\dots+|a_n|$ and $f(\pm 1)\neq 0$, then $f$ is irreducible. 

Since $2\geq 1+1$, and $f(1)=4\neq 0,f(-1)=2\neq 0$ and so the polynomial is irreducible.
A: $$p(x)q(x)=(x^2+ax+b)(x^3+cx^2+dx+e)=x^5+2x+1$$
Make the coefficients of same powers on both sides equal.
You will get a system to be studied.
$$c+a=0, d+ac +b=0, e+ad+bc=0,ae+bd=2,be=1$$  
We have $$be=1$$ which gives us two possibilities.
$$ b=1,e=1$$ or $$b=-1, e=-1$$ 
In both cases you will come up with no integer solutions.
A: A Complex-Analytic Proof
We shall first verify that exactly one root $\zeta\in\mathbb{C}$ of $f(x):=x^5+2x+1$  satisfies $|\zeta|<1$.  Let $\epsilon$ be an arbitrary real number such that $0<\epsilon<\frac{1}{4}$.  Consider the open ball $B_{1-\epsilon}(0)\subseteq \mathbb{C}$ centered at $0$ with radius $1-\epsilon$.  We see that, for a complex number $z$ on the boundary $\partial B_{1-\epsilon}(0)$ of $B_{1-\epsilon}(0)$, 
$$|2z|=2(1-\epsilon)\text{ and }|z^5+1|\leq |z|^5+1=(1-\epsilon)^5+1\,.$$
Observe that
$$\begin{align}(1-\epsilon)^5&=1-5\epsilon+\epsilon^2(10-10\epsilon+5\epsilon^2-\epsilon^3)
\\
&< 1-5\epsilon+\epsilon^2\left(10-0+\frac{5}{4^2}-0\right)
\\
&<1-5\epsilon+11\epsilon^2\,,\end{align}$$
as $0<\epsilon<\frac14$.
That is, $3-11\epsilon>0$, and so
$$(1-\epsilon)^5<1-5\epsilon+11\epsilon^2=(1-2\epsilon)-\epsilon(3-11\epsilon)<1-2\epsilon\,.$$
Consequently,
$$|2z|>\left|z^5+1\right|$$
for $z\in\partial B_{1-\epsilon}(0)$.  By Rouché's Theorem, the number of roots of $$f(z)=z^5+2z+1=(2z)+\left(z^5+1\right)$$ in $B_{1-\epsilon}(0)$ is the same as the number of roots of $2z$ in $B_{1-\epsilon}(0)$, which is $1$.  Hence, $f(z)$ has exactly one root $z=\zeta$ inside $\bigcup\limits_{\epsilon\in\left(0,\frac{1}{4}\right)}\,B_{1-\epsilon}(0)=B_1(0)$.
It is also easy to see that $f(x)$ has no root of modulus $1$.  This is because $f(r)=0$ with $|r|=1$ implies
$$1=|r|^5=\big|r^5\big|=|-2r-1|\geq 2|-r|-|-1|=2|r|-1=2\cdot 1-1=1\,,$$
whence we have an equality.  By the equality condition of the Triangle Inequality, we must have $r=-1$, but $f(-1)=-2\neq 0$.  Ergo, the roots of $f(z)$ other than $z=\zeta$ have moduli larger than $1$.
Finally, if $f(x)=p(x)\,q(x)$ for some nonconstant $p(x),q(x)\in\mathbb{Z}[x]$, then we can assume without loss of generality that $p(\zeta)=0$.  Ergo, all the roots of $q(x)$ must have moduli greater than $1$.  That is, the constant term of $q(x)$ must be an integer $c$ with $|c|>1$.  However, $c$ must divide the constant term of $f(x)$, which is $1$.  This is absurd.  Therefore, $f(x)$ is an irreducible polynomial over $\mathbb{Z}$ (whence also over $\mathbb{Q}$).
A: Looking at questions like these modulo a prime is not guaranteed to work but it is definitely something that should be in your toolbox. 


*

*The theoretical justification comes from a corollary to Gauss' lemma
and states that a monic polynomial $f(x)\in\Bbb{Z}[x]$ is irreducible
in $\Bbb{Q}[x]$ if and only if it is irreducible in $\Bbb{Z}[x]$.

*Should it happen that $f(x)=g(x)h(x)$ non-trivially in $\Bbb{Z}[x]$, then both $g$ and $h$ can be assumed to be monic. Reducing that equation modulo a prime $p$ tells that $\overline{f}(x)=\overline{g}(x)\overline{h}(x)$ in $\Bbb{Z}_p[x]$. As $g$ and $h$ were monic, we have $\deg g=\deg \overline{g}$ and $\deg h=\deg \overline{h}$.

*Checking for irreducibility in $\Bbb{Z}_p[x]$ is often easier because, at least in principle, we can try all the alternatives as the field of coefficients is finite. Should it happen that $\overline{f}$ is irreducible then we can immediately conclude that $f$ is also irreducible.

*Factoring in $\Bbb{Z}_p[x]$ is also easier (for small $p$ it is feasible to build a list of low degree irreducible polynomials and use those much the same way you use a list of small primes to factor smallish integers). Even if $\overline{f}$ is not irreducible we may still get information about the degrees of $g$ and $h$. Behold!


Let's look at your example polynomial $f(x)=x^5+2x+1$ modulo primes $p=2$ and $p=3$. Either choice of $p$ leads to a proof of irreducibility.


*

*When $p=2$ we get $\overline{f}=x^5+1=(x+1)(x^4+x^3+x^2+x+1)$. Here it is not immediately obvious that the degree four polynomial is irreducible, but
it does follow from the facts that A) it has no zeros modulo two (only two choices to test!), B) $x^2+x+1$ is the only irreducible quadratic in $\Bbb{Z}_2[x]$, and e.g. long division shows that the quartic is not divisible by that either. How does this help us? What we have at this point is that if $f$ is not irreducible it must be a product of a linear factor and a quartic factor. But the rational root test tells you that $f(x)$ does not have a linear factor. We are done - $f$ must be irreducible! Here the key was that a modulo $2$ consideration showed that $f$ cannot have a quadratic factor!

*As Lulu pointed out, $f(x)$ is irreducible modulo $p=3$. It is, of course,
easy to see that none of $f(0),f(1),f(2)$ are congruent to $0$ modulo $3$, so $f(x)$ has no linear factors. To exclude the possibility of a quadratic factor takes a bit more work here than it did with $p=2$. Anyway, with a bit of work we can show that $p_1(x)=x^2+1$, $p_2(x)=(x-1)^2+1$ and $p_3(x)=(x+1)^2+1$ are all the irreducible monic quadratics in $\Bbb{Z}_3[x]$.
It takes a bit of work to show that none of them are factors of $f(x)$. We can do that in one swoop if we use the fact that
$$(x-1)(x+1)p_1(x)p_2(x)p_3(x)=x^8-1$$
(this comes from a general related result, ask if you want to know more), and then compute with Euclid's algorithm that $\gcd(x^8-1,f(x))=1$ in $\Bbb{Z}_3[x]$. Anyway, we then know that $f$ is irreducible modulo three, and we are done.



For comparison, the methods in other answers are all very fine. They work well here as well as in many other cases. They work in many cases where modular techniques may fail. But, modular tricks are good to know. For example, instead of your $f(x)$ consider the polynomial
$$
f(x)=x^5+2x+7^n,
$$
where $n$ is either a parameter or some ridiculously large natural number. AFAICT all the other answers fail or lead to uncomfortably many cases. But,
the above proof using reduction modulo $3$ goes through verbatim. The modulo $2$ argument survives if you can do the part with the rational root test and show that $f(\pm 7^\ell)\neq0$ for all $\ell, 0\le\ell\le n$. One term will usually dominate the others.
