As we know, $\cos{(z)}=\frac{e^{iz}+e^{-iz}}{2}$ and $\sin{(z)}=\frac{e^{iz}-e^{-iz}}{2i}$. From these, we can easily find that $\tan{(z)}=-i\frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}}$, and with a bit of simple algebra, we can further find definitions for the inverse functions of cosine and sine - namely, $\arccos{(z)}=-i\operatorname{Ln}(z\pm\sqrt{z^2-1})+2n\pi$ and $\arcsin{(z)}=-i\operatorname{Ln}(iz\pm\sqrt{1-z^2})+2n\pi$, with $n\in\mathbb{Z}$ in both cases and $\operatorname{Ln}(z)$ being the principal value of the complex natural log.
For the sake of this example, I will illustrate how I found the former formula. Say we solve the equation $\cos{(z)}=w$, and we want a function in terms of $w$. We first replace $\cos{(z)}$ with its equivalent formula shown above and multiply both sides by two, yielding $e^{iz}+e^{-iz}=2w$. Then, we multiply both sides of the equation by $e^{iz}$ and rearrange, yielding $e^{i^2z^2}-2we^{iz}+1=0$. From here, we use the quadratic formula to find $e^{iz}=w\pm\sqrt{w^2-1}$, and then it's merely a matter of taking the log of each side and dividing by $i$, or equivalently, multiplying by $-i$.
To illustrate this, we may find a value of the arccosine function that is outside the interval of $[-1,1]$. Let's plug in $i$. We then get $\arccos{(i)}=-i\operatorname{Ln}(i(1\pm\sqrt{2}))+2n\pi$. Choosing a plus instead of a minus, we get $\arccos(i)=-i(\ln(1+\sqrt2)+i\frac{\pi}{2})+2n\pi$, and then $\arccos(i)=\frac{\pi}{2}-i\ln(1+\sqrt{2})+2n\pi$. Sure enough, we find that $\cos(\frac{\pi}{2}-i\ln(1+\sqrt{2}))=i$, thus proving the formula correct.
However, it seems we cannot do a similar thing with the inverse tangent formula. Let's try the same formula as outlined in the second paragraph and find a value for $z$ in terms of $w$ in the equation $\tan(z)=w$.
- We first say $-i\frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}}=w$.
- We then multiply both sides by $i(e^{iz}+e^{-iz})$, yielding $e^{iz}-e^{-iz}=iw(e^{iz}+e^{-iz})$.
- Now multiply both sides by $e^{iz}$ for $e^{-z^2}-1=iw(e^{-z^2}+1)$.
- Rearrange for $(1-iw)e^{-z^2}=1+iw$.
- Divide both sides by $1-iw$ for $e^{-z^2}=\frac{1+iw}{1-iw}$.
- Take the natural log for $-z^2=\operatorname{Ln}(\frac{1+iw}{1-iw})$.
- Solve algebraically for $z=\pm i\sqrt{\operatorname{Ln}(\frac{1+iw}{1-iw})}$
Let's plug in $2i$ to our function and see what happens. Ideally, $\arctan(2i)=\pm i\sqrt{\operatorname{Ln}(-\frac{1}{3})}=\pm i\sqrt{-\ln(3)+i\pi}$.
However, $\tan(i\sqrt{-\ln(3)+i\pi})\not=2i$! Instead, it's equal to some unwieldy value that WolframAlpha gives as approximately $-.052+1.270i$. What's causing the discrepancy here? Why is it that this method for finding the inverse complex trigonometric functions works for sine and cosine, but not for tangent? Thank you!