<s>[INST] How does this factoring work? $$ (z^2 - 2i ) = (z -1 -i)(z + 1 +i) $$
I see if you multiply out the right-hand side, you obtain the left-hand side, but how does one know to factor like that or this?
$$ (z^2 − 3iz − 3 + i) = (z − 1 − i)(z + 1 − 2i) $$
 [/INST] If we are trying to factor $p(z) = z^2 - 2i$ we can determine the factorization by finding the zeros of the polynomial.
If $p(z) = 0$ then $z^2 = 2i$. Thus $|z| = \sqrt{2}$. Writing $z=\sqrt{2} e^{i\theta}$ we have $e^{i2\theta} = e^{i \frac{\pi}{2}}$. This yields $$\cos(2\theta) + i \sin(2\theta) = \cos(\pi/2) + i \sin(\pi/2).$$
Now if we restrict $\theta \in [-\pi,\pi]$, we find the solutions $\theta = \pi/4$ and $\theta = -\frac{3\pi}{4}$.
This means $p(\sqrt{2} e^{i  \pi/4} ) = 0$ and $p(\sqrt{2} e^{-i\frac{3\pi}{4}})$, and since it is monic, it can be factored as $$(z- \sqrt{2} e^{i\pi/4}) ( z - \sqrt{2} e^{-i3\pi/4}).$$
Finally $\sqrt{2} e^{i \pi/4} = \sqrt{2} ( \cos(\pi/4) + i \sin(\pi/4) ) = 1 + i$, and $\sqrt{2} e^{i3\pi/4} = -1-i$.
</s>