<s>[INST] Factoring $x^4+x^2+2x+6$ We have to factor $x^4+x^2+2x+6$.Factoring through factor theorem is not helpful in this question as the question does not follow the integral root theorem i.e. the root of this expression is not any of the factors of 6. I am totally confused.Please help in factoring it!
 [/INST] $$x^4+x^2+2x+6=x^4+2ax^2+a^2-\left( (2a-1)x^2-2x+a^2-6 \right)$$
Now, $\left( (2a-1)x^2-2x+a^2-6 \right)$  is a constant times perfect square if and only if $\Delta =0$ if and only if
$$4-4(2a-1)(a^2-6)=0$$
if and only if
$$(2a-1)(a^2-6)=1$$
Factoring and using the rational root test you will find that $a=\frac{5}{2}$ is (the only) rational root. 
With this choice of $a$, your polynomial becomes a difference of squares.
</s>