<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] If you're looking for real coefficients, every polynomial factors into a product of linear and quadratic terms.  Writing down the coefficients, on the other hand, can be nearly impossible.  Therefore, for your given polynomial, you know that it can be factored into quadratic terms.
There are deeper reasons behind the factorization in Galois theory over the rationals, but I'll go for the elementary approach - although we will need a detour through complex numbers.
To factor $x^4+1$, let's start by setting $y=x^2$.  Then, $x^4+1$ becomes $y^2+1$.  A quadratic can easily be factored, in this case we use the quadratic formula to get that the roots are $y=\pm i$.  Hence, this factors as
$$
y^2+1=(y-i)(y+i).
$$
Since $y=x^2$, we now know that
$$
x^4+1=(x^2-i)(x^2+i).
$$
Each of these are quadratics and can be factored with the quadratic formula.  In particular, $x^2-i$ has solutions $x=\pm\sqrt{i}=\pm\frac{\sqrt{2}}{2}\pm\frac{\sqrt{2}}{2}i$.  Therefore,
$$
x^2-i=\left(x-\frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2}i\right)\left(x+\frac{\sqrt{2}}{2}+\frac{\sqrt{2}}{2}i\right).
$$
Similarly, 
$$
x^2-i=\left(x-\frac{\sqrt{2}}{2}+\frac{\sqrt{2}}{2}i\right)\left(x+\frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2}i\right).
$$
Since we're looking for quadratics with real coefficients, we can try to pair these factors to get real coefficients after multiplying.  We can test out a few cases to find that the product
$$
\left(x-\frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2}i\right)\left(x-\frac{\sqrt{2}}{2}+\frac{\sqrt{2}}{2}i\right)=x^2-\sqrt{2}x+1.
$$
Similarly, the other pair results in $x^2+\sqrt{2}x+1$.
</s>