How did Euler realize $x^4-4x^3+2x^2+4x+4=(x^2-(2+\alpha)x+1+\sqrt{7}+\alpha)(x^2-(2-\alpha)x+1+\sqrt{7}-\alpha)$? How did Euler find this factorization?
$$\small x^4 −  4x^3 + 2x^2 + 4x + 4=(x^2-(2+\alpha)x+1+\sqrt{7}+\alpha)(x^2-(2-\alpha)x+1+\sqrt{7}-\alpha)$$
where $\alpha = \sqrt{4+2\sqrt{7}}$
I know that he had some super powers, like he was sent to us from a super intelligent alien universe just to humiliate our intelligence, but how the hell did he do that three centuries ago? :|

Once it is noticed that
$$
x^4-4x^3+2x^2+4x+4=(x-1)^4-4(x-1)^2+7
$$
the square can be completed to get
$$
\left((x-1)^2-2\right)^2+3=\color{#00A000}{\left((x-1)^2-2-i\sqrt3\right)}\color{#0000FF}{\left((x-1)^2-2+i\sqrt3\right)}
$$
Solving for $(\alpha+i\beta)^2=2+i\sqrt3$, we get $\alpha^2-\beta^2=2$ and $2\alpha\beta=\sqrt3$. Adding the squares and taking the square root gives $\alpha^2+\beta^2=\sqrt7$. Solving for $\alpha$ and $\beta$ yields
$$
\color{#00A000}{\left({\small\sqrt{\frac{2+\sqrt7}2}}+i\,{\small\sqrt{\frac{-2+\sqrt7}2}}\right)^2=2+i\sqrt3}
$$
$$
\color{#0000FF}{\left({\small\sqrt{\frac{2+\sqrt7}2}}-i\,{\small\sqrt{\frac{-2+\sqrt7}2}}\right)^2=2-i\sqrt3}
$$
The full factorization is
$$
\overset{\underbrace{\color{#0000FF}{\left[x-1-\sqrt{\frac{2+\sqrt7}2}+i\,\sqrt{\frac{-2+\sqrt7}2}\right]}\color{#00A000}{\left[x-1-\sqrt{\frac{2+\sqrt7}2}-i\,\sqrt{\frac{-2+\sqrt7}2}\right]}}_{}}
{\left[\left(x-1-\sqrt{\frac{2+\sqrt7}2}\right)^2+\frac{-2+\sqrt7}2\right]}
\overset{\underbrace{\color{#00A000}{\left[x-1+\sqrt{\frac{2+\sqrt7}2}+i\,\sqrt{\frac{-2+\sqrt7}2}\right]}\color{#0000FF}{\left[x-1+\sqrt{\frac{2+\sqrt7}2}-i\,\sqrt{\frac{-2+\sqrt7}2}\right]}}_{}}
{\left[\left(x-1+\sqrt{\frac{2+\sqrt7}2}\right)^2+\frac{-2+\sqrt7}2\right]}
$$
This gives the factorization sought.
