Solving $\cos z = i$ for $z$

\begin{align} & e^{iz} + e^{-iz} = 2i \\ & e^{2iz} + 1 = 2ie^{iz} \qquad \text{(Both sides were multiplied by $e^{iz}$.)} \\ & w^2 + 1 = 2iw \\ & w^2 -2iw = -1 \\ & w^2 - 2iw - 1 = -2 \qquad\text{(completing the square)} \\ & (w- i)^2 = -2 \\ & w-i = \pm i\sqrt 2 \\ & w = i \pm i\sqrt 2 \\ & e^{iz} = i(1\pm\sqrt 2) = e^{i\pi/2} e^{\log(1\pm\sqrt 2)} \end{align} etc. (And notice that $\log(1-\sqrt 2) = -\log(1+\sqrt 2)$.)


You got to $e^{iz}+e^{-iz}=2i$. Let $u=e^{iz}$, this becomes:

$$u+\frac{1}{u}=2i$$ $$u^2+1=2iu$$ $$u^2-2iu+1=0$$ Thus $$u=\frac{2i\pm\sqrt{-4-4}}{2}$$

$$ u=\frac{2i\pm i\sqrt{8}}{2}$$ $$ u = i(1\pm\sqrt{2})$$

Then $$e^{iz}=i(1\pm\sqrt{2})$$


It's convenient to use the decomposition of $z$ and $\cos z$ into real and imaginary parts, namely, $$\cos(x + iy) = \cos x \cosh y - i \sin x \sinh y$$ (for $x, y \in \mathbb{R}$).

Using this formula to decompose $\cos z = i$ into real and imaginary parts gives the (equivalent) system \begin{align} \cos x \cosh y &= 0 \\ \sin x \sinh y &= 1 . \end{align}

Now, $\cosh y > 0$ for all $y$, so the first equation is equivalent to $\cos x = 0$, which has solution $$x = \pi\left(m + \frac{1}{2}\right), \quad m \in \mathbb{Z}.$$ We can now substitute for $x$ in the other equation; in particular, $$\sin \pi\left(m + \frac{1}{2}\right) = (-1)^m,$$ so the second equation becomes $$(-1)^m \sinh y = 1,$$ and solving gives (recall here that $\sinh$ is injective, and so $\text{arsinh}$ is a bona fide inverse) $$y = \text{arsinh} [(-1)^m] = (-1)^m \ln(1 + \sqrt{2}).$$ So, the solutions of $\cos z = i$ are precisely $$z = \pi\left(m + \frac{1}{2}\right) + i (-1)^m \ln(1 + \sqrt{2}), \quad m \in \mathbb{Z}.$$ Specializing to $m = 2k$ and $m = 2k + 1$, together with the fact that $(\sqrt{2} + 1)(\sqrt{2} - 1) = 1$ and an appropriate logarithm identity, yields the given solutions.