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!
 A: Hint: It is $$1+x^4=(x^2+1)^2-2x^2$$ and then use $$a^2-b^2=(a-b)(a+b)$$
A: Use the binomial formula $x^4+1=(x^2+i)(x^2-i)$ and compute the roots of the factors
$$x_{1,2} = \pm \tfrac{1}{2}\sqrt{2}(1+i)$$
$$x_{3,4} = \pm \tfrac{1}{2}\sqrt{2}(1-i)$$
Now multiply 
$$(x-x_1)(x-x_3) = x^2 - \sqrt{2}x +1$$
$$(x-x_2)(x-x_4) = x^2 + \sqrt{2}x +1$$
A: $$x^4+1= \underbrace{x^4+\color{red}{2x^2}+1}-\color{red}{2x^2} = (x^2+1)^2-2x^2=...$$
A: There is a general procedure to solve quartic equations. The first step is to depress the polynomial, i.e. translate the variable to cancel the cubic term. Your polynomial is already in depressed form.
Then you try a factorization of the form
$$(x^2-ax+b)(x^2+ax+c)=x^4+(-a^2+b+c)x^2+(ab-ac)x+bc$$
which is built to yield a depressed polynomial.
By identification with $x^4+1$,
$$a^2=b+c,\\b=c,\\bc=1,$$
which easily gives
$$a=\sqrt2,\\b=c=1.$$

In more general cases (more nonzero coefficients), the procedure leads to a cubic equation, for which there is also a systematic procedure. More at https://en.wikipedia.org/wiki/Quartic_function#Solution_methods.
A: 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).$$
A: You are trying to "complete the square" but in a different way. Usually, when you complete the square, you make sure that your square term "absorbs" the highest order term and the second highest order term. For example, you would write something like
$$ x^4+3x^2+1 = (x^2+3/2)^2 - 5/4$$
where outside the squared term, you only have the constant, which is (hopefully) negative so you can use $a^2-b^2=(a+b)(a-b)$. Here, however, there's no second highest order ($x^2$) term to "absorb" into the square, so you "absorb" the constant instead so that the $x^2$ term remains outside the square:
$$ x^4+1 = (x^2+1)^2-2x^2 $$
from which the conclusion follows. Note that we can technically write
$$ x^2+1 = (x+1)^2-2x = (x+\sqrt 2x^{-1/2}+1)(x-\sqrt2x^{-1/2}+1)$$
too, but since we have a noninteger power, people usually resolve to just saying that $x^2+1$ is not factorisable.
