<s>[INST] How to separate real and imaginary parts of $\arccos(x+iy)$? I know how to separate the real and imaginary parts of $\ln z$ and $\arctan z$:
$$\begin{align}\ln(x+iy)&=\frac{1}{2}\ln(x^2+y^2)+i\arctan\frac{y}{x}\\
\arctan(x+iy)&=\frac{1}{2}\arctan\frac{2x}{1-x^2-y^2}+\frac{i}{2}\operatorname{artanh}\frac{2y}{1+x^2+y^2}\end{align}$$
and I know how to prove both of these; in particular for the second one we can make use of the fact that $\arctan z=-i\operatorname{artanh}(iz)$. I would now like to know how to separate the real and imaginary parts of $\arccos(x+iy)$; I've thought of using the identity $\arccos(z)=\operatorname{arcosh}(iz)$, but I don't know how to use this, as the argument of the $\ln$ becomes very complicated.
Thank you very much for your help.
 [/INST] Let
$$
\arccos(x+iy)=u+iv.\tag1
$$
Then
$$\begin{align}
x+iy&=\cos(u+iv)=\cos u\cosh v-i\sin u\sinh v\\
\\
&\implies
\begin{cases}
x=\hphantom-\! \cos u\,\!\cosh v\\
y=-\sin u\,\sinh v
\end{cases}.
\end{align}$$
Eliminating $u$ one obtains:
$$\begin{align}
&\left(\frac x{\cosh v}\right)^2+\left(\frac y{\sinh v}\right)^2=1\\
&\implies\cosh^4v-(x^2+y^2+1)\cosh^2v+x^2=0\\
&\implies\cosh^2v=\frac12\left[x^2+y^2+1+\sqrt{(x^2+y^2+1)^2-4x^2}\right]\tag{$*$}\\
&\implies\cosh^2v=\frac14\left[\sqrt{(x+1)^2+y^2}+\sqrt{(x-1)^2+y^2}\right]^2\\
&\implies\cosh v=\frac12\left[\sqrt{(x+1)^2+y^2}+\sqrt{(x-1)^2+y^2}\right],\tag2
\end{align}$$
and from this:
$$
\cos u=\frac{x}{\cosh v}=\frac12\left[\sqrt{(x+1)^2+y^2}-\sqrt{(x-1)^2+y^2}\right].\tag3
$$
Resolving $(2)$ and $(3)$ and plugging the obtained values of $u$ and $v$ into $(1)$ gives rise to the final expression:
$$\begin{align}
\arccos(x+iy)&=\arccos\frac{\sqrt{(x+1)^2+y^2}-\sqrt{(x-1)^2+y^2}}2\\
&+i\operatorname{arccosh}\frac{\sqrt{(x+1)^2+y^2}+\sqrt{(x-1)^2+y^2}}2.\tag4
\end{align}$$
Note added:
In implication $(*)$ the possibility
$$
\cosh^2v=\frac12\left[x^2+y^2+1-\sqrt{(x^2+y^2+1)^2-4x^2}\right]
$$
was disregarded since for $y\ne0$ it would imply $\cosh^2v<1$, which is impossible for real $v$.
</s>