<s>[INST] How could I know that $X^4+1$ is $(X^2+\sqrt 2X+1)(X^2-\sqrt 2X+1)$? I thought that $X^4+1$ was irreducible, but in fact, $$X^4+1=(X^2+\sqrt 2X+1)(X^2-\sqrt 2X+1).$$
In general, how can I have the intuition of such a factorisation if I don't know it ?
 [/INST] There's a sort of completion of the square that goes like this:
\begin{align}
x^4+1 & = \underbrace{(x^4+2x^2 + 1)}_\text{This is a square.} - \underbrace{(2x^2)}_\text{So is this.} \\[10pt]
& = \left( x^2+ 1 \right)^2 - (\sqrt 2\ x)^2 \\[10pt]
& = (x^2 + 1 - \sqrt 2\ x)(x^2 + 1  + \sqrt2\  x).
\end{align}
</s>