Hi everyone, I was wondering if anyone can show me how these factorisations were carried out?

$\displaystyle

z^2 + i = (z + \frac{1}{\sqrt{2}}(1-i))(z - \frac{1}{\sqrt{2}}(1-i))

$

$\displaystyle

z^2 - i = (z + \frac{1}{\sqrt{2}}(1+i))(z - \frac{1}{\sqrt{2}}(1+i))

$

Any help would be much appreciated!

edit: $\displaystyle i$ is the imaginary unit, as always.

2nd edit: For anyone interested they arose while I was factorising this:

$\displaystyle x^4 + 1$

in order to evalute this:

$\displaystyle

\int_{-\infty}^{+\infty} \frac{e^{isx}}{x^4+1} dx

$

using contour integration.

I have the solution, I just can't replicate those factorisations.