<s>[INST] Complex analysis: Rewrite $\cos^{-1}{i}$ in algebraic form I'm stuck in this problem (complex analysis), my answer is not the one reported in the book:

Rewrite $\cos^{-1}{i}$ in the algebraic form. A: $k\pi + i \frac{\ln{2}}{2}\ \forall\ k \in \mathbb{Z}$

So I tried this approach in order to solve it:


*

*As $\cos^{-1}{z} = -i \ln{\left( z \pm \sqrt{z^2 - 1} \right)}$, doing $z = i$ and $i^2 = -1$ where necessary, we have


$$\cos^{-1}{i} = -i \ln{\left( i \pm \sqrt{i^2 - 1} \right)} = -i \ln{\left( i \pm \sqrt{-2} \right)} = -i \ln{\left( i \pm i \sqrt{2} \right)}$$


*

*Factoring $i$ and separating the obtained logarithm of product into sum of logarithms:


$$\cos^{-1}{i} = -i \ln{\left[ i \left( 1 \pm \sqrt{2} \right) \right]} = -i \big[ \ln{i} + \ln{\left( 1 \pm \sqrt{2} \right)} \big]$$


*

*Solving $\ln{i}$ separately, we obtain $\ln{i} = \pi i \left( 2k + \frac{1}{2} \right)$

*Solving $\ln{\left( 1 \pm \sqrt{2} \right)}$, on the other hand, yields
$$\ln{\left( 1 \pm \sqrt{2} \right)} = \begin{cases} \ln{\left( \sqrt{2} + 1 \right)} + \pi i \cdot 2k & (+) \\ \ln{\left( \sqrt{2} - 1 \right)} + \pi i \left( 2k + 1 \right) & (-) \end{cases}$$


*

*Substituting these expressions into the original one, we have


$$\cos^{-1}{i} = \begin{cases} \pi \left( 4k + \frac{1}{2} \right) -i \ln{\left( \sqrt{2} + 1 \right)} & (+) \\ \pi \left( 4k + \frac{3}{2} \right) -i \ln{\left( \sqrt{2} - 1 \right)} & (-) \end{cases}$$
which obviously doesn't correspond with the book. Is something wrong?
Thanks in advance :)
 [/INST] Let me obtain an answer similar to yours by different means. Rather than use the algebraic form of the inverse cosine, I'll invert to solve for $x=e^{iz}$ and then invert again to get $z$. Carrying this out gives 
\begin{align}
z=\cos^{-1} i
&\underset{\text{invert}}{\implies} i=\cos z=\frac{1}{2}(x+x^{-1})\implies x^2-2i x+1=0\\
&\underset{\text{solve}}{\implies} x=\dfrac{1}{2}\left(2i\pm \sqrt{-8}\right)=\pm i(\sqrt{2}\pm 1)\\
&\underset{\text{invert}}{\implies} z=-i\log x=\pm \frac{\pi}{2}+2\pi n-i\log(\sqrt{2}\pm 1)
\end{align}
This does not appear to agree with the book either...
</s>