<s>[INST] Calculating $ \tan w$ for $ w = \dfrac{1} {i} \log\dfrac{1-iz} {1+iz}$ Let $ w = \dfrac{1} {i} \log\left(\dfrac{1-iz} {1+iz}\right)$ and calculate $\tan w$.
I begin by using the fact that
$$ \tan w =  \frac{\sin w}{\cos w} =  \frac1i\frac{e^{iw} - e^{-iw}}{e^{iw}+e^{-iw}}$$
I now replace $  w = \dfrac{1} {i} \log(\dfrac{1-iz} {1+iz})$ and get
$$\tan w = \frac{1} {i} \left(\frac{{e^{\log(\frac{1-iz} {1+iz})} - e^{-{\log(\frac{1-iz} {1+iz})}}}} {e^{\log(\frac{1-iz} {1+iz})} + e^{-\log(\frac{1-iz} {1+iz})}}\right). $$
It is at this point that i run into troubles. The next step should be to use the fact that
$$e^{-{\log(\frac{1-iz} {1+iz})}} = e^{{\log(\frac{1-iz} {1+iz})^{-1}}} = e^{{\log(\frac{1+iz} {1-iz})}}.  $$
The thing that i have a hard time grasping is why
$$e^{-{\log(\frac{1-iz} {1+iz})}} = e^{{\log(\frac{1-iz} {1+iz})^{-1}}} $$ is true for complex numbers aswell, since i've always worked under the assumption that the normal logarithmical rules doesn't always apply when it comes to complex numbers. How come it applies here?
 [/INST] Use
$$e^{\log (a)} = a,$$
and
$$e^{-\log(a)} = \frac{1}{a}.$$
Then:
$$\tan w = \frac{1} {i} \left(\frac{{e^{\log\left(\frac{1-iz} {1+iz}\right)} - e^{-{\log\left(\frac{1-iz} {1+iz}\right)}}}} {e^{\log\left(\frac{1-iz} {1+iz}\right)} + e^{-\log\left(\frac{1-iz} {1+iz}\right)}}\right) = \\
= \frac{1}{i} \frac{\frac{1-iz}{1+iz} - \frac{1+iz}{1-iz}}{\frac{1-iz}{1+iz} + \frac{1+iz}{1-iz}} = \\
= \frac{1}{i} \frac{\frac{(1-iz)^2 - (1+iz)^2}{(1+iz)(1-iz)}}{\frac{(1-iz)^2 + (1+iz)^2}{(1+iz)(1-iz)}} = \\
= \frac{1}{i} \frac{(1-iz)^2 - (1+iz)^2}{(1-iz)^2 + (1+iz)^2} = \\
= \frac{1}{i} \frac{1-z^2-2iz - 1 + z^2 - 2iz}{1-z^2-2iz + 1 -z^2 + 2iz} = \\
= -\frac{1}{i} \frac{4iz}{2(1-z^2)} = \\
= \frac{2z}{z^2-1}.$$
</s>