<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] $\begin{eqnarray}{\bf Hint}\quad x^4\!+x^2\!+2x+6\, &=& \qquad x^4 + 4 &+& x^2\!+2x+2\\
&=&\!\! (x^2\!+\!2)^2\!\!-(2x)^2 &+& x^2\!+2x+2\\
&=&\!\! (x^2\!+\!2 -2x)(\color{#c00}{x^2\!+2 + 2x})\!\! &+& \color{#c00}{x^2\!+2x+2}\\
&=&\!\! (x^2\!-2x+3)(\color{#c00}{x^2\!+ 2x\! + 2})\!\!\!\
\end{eqnarray}$
</s>