Show that $z^2=2i$ iff $z=\pm(1+i)$ I am reading Beardon's Algebra and Geometry.

Show that $z^2=2i$ iff $z=\pm(1+i)$.

For the problem in question, first I made the multiplication $(1+i)\times(1+i)$ which showed the result but I guess it lacked generality then I proceded by trying to find all the $x$'s and $y$'s with the following procedure, (although I'm not really sure it will solve my problem): multiplying $(x+iy)\times (x+iy)$ which yielded $x^2+2xiy-y^2=2i$. My guess is that solving for $x$ and $y$ is going to prove that but I don't know how to proceed from here, solving for $y$ yielded:
$y\to i (x-(1+i))$
$y\to i (x+(1+i))$
And solving for $x$ yielded:
$x\to -i (y-(1-i))$
$x\to -i (y+(1-i))$
From here, what should I do to show that $z^2=2i$ iff $z=\pm(1+i)$? (assuming my reasoning is valid)
 A: From $z^2 =x^2 +2ixy-y^2 =2i$.
As $x,y$ are real numbers we must have $x^2 - y^2 = 0$ and $2xy = 2$. The latter reduces to $y = 1/x$ substituting this produces $x^2 -x^{-2}=0$ which has solutions of $x = \pm1$ thus $y=\pm1$ and $z = \pm(1+i)$
A: Interestingly, your first solution of simply checking that $(\pm(1 + i))^2 = 2i$ does work, provided that you can show the following lemma:
Lemma: Let $p$ be a polynomial with complex coefficients of degree $n\geq 0$. Then $p$ has at most $n$ roots in $\Bbb C$. (With the convention that the degree of the zero polynomial is defined to be $-\infty$ or is left undefined.)
In fact, $p$ has exactly $n$ roots in $\Bbb C$ - the fundamental theorem of algebra tells us this. However, this weaker claim is enough to show that you have found all the solutions: take your polynomial to be $p(z) = z^2 - 2i$. Then you have shown $p(\pm(1 + i)) = 0$, and since $1 + i\neq -1 - i$ and $p$ cannot have more than $2$ roots, these must indeed be all the solutions of your original equation.
If you want to prove the lemma and need a hint, try using mathematical induction on the degree of $p$.
A: Use Euler form of representation right $$z=\left(2e^{i\pi/2}\right)^{1/2}=\sqrt{2}e^{i\pi/4}$$
Hence your answer. Read this.
