Decomposition of polynomials like $1+x^4$ What is the "trick" to get from $1+x^4$ to $$(x^2-\sqrt{2}x+1)(x^2+\sqrt{2}x+1)?$$ Of course I can calculate it's true, but I don't understand what steps to take to get from one to the other.
Next to this specific question, I am also looking for the general rules for such decompositions?
Cheers!

By the factor theorem, the linear of $x^n + 1$ are of the form $x - a$, where $a$ is one of the $n$th roots of $-1$ in $\mathbb{C}$. These form complex conjugate pairs, and when two such paired factors multiply together, we get an irreducible quadratic over $\mathbb{R}$.
We know that $-1 = e^{i\pi}$, which makes the four roots of unity
\begin{align*}
e^{i\frac{\pi}{4}} &= \cos\left(-\frac{3\pi}{4}\right) + i\sin\left(-\frac{3\pi}{4}\right) = -\frac{1}{\sqrt{2}} - \frac{i}{\sqrt{2}} \\
e^{i\frac{\pi}{4}} &= \cos\left(-\frac{\pi}{4}\right) + i\sin\left(-\frac{\pi}{4}\right) = \frac{1}{\sqrt{2}} - \frac{i}{\sqrt{2}} \\
e^{i\frac{\pi}{4}} &= \cos\left(\frac{\pi}{4}\right) + i\sin\left(\frac{\pi}{4}\right) = \frac{1}{\sqrt{2}} + \frac{i}{\sqrt{2}} \\
e^{i\frac{3\pi}{4}} &= \cos\left(\frac{3\pi}{4}\right) + i\sin\left(\frac{3\pi}{4}\right) = -\frac{1}{\sqrt{2}} + \frac{i}{\sqrt{2}}.
\end{align*}
Thus, we have
\begin{align*}
x^4 + 1 &= \left(x + \frac{1}{\sqrt{2}} + \frac{i}{\sqrt{2}}\right)\left(x + \frac{1}{\sqrt{2}} - \frac{i}{\sqrt{2}}\right)\left(x - \frac{1}{\sqrt{2}} + \frac{i}{\sqrt{2}}\right)\left(x - \frac{1}{\sqrt{2}} - \frac{i}{\sqrt{2}}\right) \\
&= \left(\left(x + \frac{1}{\sqrt{2}}\right)^2 + \frac{1}{2}\right)\left(\left(x - \frac{1}{\sqrt{2}}\right)^2 + \frac{1}{2}\right) \\
&= (x^2 + \sqrt{2}x + 1)(x^2 - \sqrt{2}x + 1).
\end{align*}
Using similar methods, we can also factorise $x^{2n} + 1$. For example,
$$x^6 + 1 = (x^2 + \sqrt{3}x + 1)(x^2 + 1)(x^2 - \sqrt{3}x + 1).$$
