I am stuck on finding all solutions of the equation $\cos(z) = 0$, where $z\in\mathbb{C}$.
I found this proof, however, I cannot figure out the logic behind the last few steps. \begin{align} \cos(z) &= \dfrac{e^{iz}+e^{-iz}}{z} \\\\ &= 0 \\\\ e^{iz}+e^{-iz} &= 0 \\\\ e^{i(x+iy)} &= -e^{-i(x+iy)} \\\\ e^{ix}e^{-y} &= -e^{ix}e^y \\\\ e^{ix}e^{-y} &= e^{i\pi}e^{-ix}e^y \\\\ e^{-y}e^{ix} &= e^ye^{i(\pi-x)} \\\\ |e^{-y}e^{ix}| &= |e^ye^{i(\pi-x)}| \end{align}
This is where I get a bit confused. It follows from the modulus that, [ e^{-y} = e^y ] but why? Are we just shaving off the imaginary component? Or is it because $e^{-y}$ is real so it acts as the radius in $re^{i\theta}$?
So we have \begin{align} -y &= y \\\\ y &= 0 \\\\ e^{ix} &= e^{i(\pi-x)} \end{align}
Therefore we have from this that, $x - (\pi - x)= 2\pi k, \forall k\in\mathbb{Z}$... but why is that? Where is the $2\pi k$ coming from? I understand it has to do with the unit circle... is $i = 2\pi k$?
From that result we have \begin{align} 2x &= \pi + 2\pi k \\\\ x &= \dfrac{\pi}{2} + \pi k \\\\ z &= \dfrac{\pi}{2} + \pi k, \forall k\in\mathbb{Z} \end{align}
When I tried this problem on my own I did, \begin{align} \cos(z) &= \dfrac{e^{iz}+e^{-iz}}{2} \\\\ &= 0 \\\\ e^{iz} + e^{-iz} &= 0 \\\\ e^{iz} &= -e^{-iz} \\\\ e^{iz} &= e^{i\pi}e^{-iz} \\\\ e^{iz} &= e^{i(\pi-z)} \\\\ z &= \pi - z \\\\ 2z &= \pi \\\\ z &= \dfrac{\pi}{2} \end{align}
But this does not result in the infinite solutions it should result in.
Hint for your own attempt: Just because two exponentials are equal, that doesn't mean the exponents are equal.