<s>[INST] Factoring $x^4-2x^3+2x^2+x+4$ 
I need to show that the polynomial is not irreducible and I am trying to factor the polynomial 
  $$x^4-2x^3+2x^2+x+4$$

I checked from a calculator that it has a factor but how do I get it by myself?
I tried grouping but It didnt work I got 
$x^2(x^2-2x+2)+x+4$ And I dont know how should I proceed. My guts tell me that it should be of the form:
$(x^2-ax+k)(x^2+bx+l)$, should I just try to figure out the constants by trying out?
 [/INST] Actually, if you just try to solve this like a general quartic equation you get a break: let $x=t+1/2$. Then
$$\begin{align}x^4-2x^4+2x^2+x+4&=\left(t+\frac12\right)^4-2\left(t+\frac12\right)^3+2\left(t+\frac12\right)^2+\left(t+\frac12\right)+4\\
&=t^4+\frac12t^2+2t+\frac{77}{16}\\
&=\left(t^2+at+b\right)\left(t^2-at+c\right)\\
&=t^4+\left(b-a^2+c\right)t^2-a(b-c)t+bc\end{align}$$
So we have
$$\begin{align}b+c&=\frac12+a^2\\
b-c&=-\frac2a\end{align}$$
With solutions
$$\begin{align}2b&=a^2+\frac12-\frac2a\\
2c&=a^2+\frac12+\frac2a\end{align}$$
Then
$$4bc=a^4+a^2+\frac14-\frac4{a^2}=\frac{77}4$$
Which simplifies to
$$a^6+a^4-19a^2-4=0$$
And here is our break: the resolvent cubic has a rational root: $a^2=4$. If we pick $a=2$, then $b=7/4$, $c=11/4$ and
$$\begin{align}x^4-2x^4+2x^2+x+4&=\left(t^2+2t+\frac74\right)\left(t^2-2t+\frac{11}4\right)\\
&=\left(\left(x-\frac12\right)^2+2\left(x-\frac12\right)+\frac74\right)\left(\left(x-\frac12\right)^2-2\left(x-\frac12\right)+\frac{11}4\right)\\
&=\left(x^2+x+1\right)\left(x^2-3x+4\right)\end{align}$$
</s>