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? :|
Euler lived a century after Isaac Newton and Blaise Pascal, so he must have been familiar with the former's binomial theorem and the latter's triangle. Indeed, the polynomial you presented looks quite similar to the binomial expansion of $(x-1)^4$, whose coefficients are found on the fourth row of Pascal's triangle. By subtracting the two, we are left with $4x^2-8x-3$, whose roots are $1\pm\dfrac{\sqrt7}2$ which is a quarter of $\alpha$. So, $$P(x)=(x-1)^4-4\bigg[(x-1)-\dfrac{\sqrt7}2\bigg]\bigg[(x-1)+\dfrac{\sqrt7}2\bigg],$$ which, after substituting $u=(x-1)^2$, becomes $u^2-4u+7$. Then, by completing the square, we arrive at the desired result.