<s>[INST] Inverse tangent of a complex variable Show that
$$\tan^{-1}(z) = \frac{i}{2}\ln\left(\frac{i + z}{1 - z}\right)$$

I tried this approach:
$$\tan(w) = z$$
$$\tan(w) = \frac{\sin(w)}{\cos(w)}$$
$$\tan(w) = \frac{\frac{e^{iw}-e^{-iw}}{2i}}{\frac{e^{iw}+e^{-iw}}{2}}$$
let $$ u = e^{iw}$$
$$\tan(w) = \frac{u - u^{-1}}{i(u + u^{-1})}$$
But I don't see a way from there
 [/INST] A useful trick: $\frac{a}{b}=\frac{c}{d} \iff \frac{a+b}{a-b}=\frac{c+d}{c-d}$
\begin{align*}
  i\tan w &= \frac{e^{iw}-e^{-iw}}{e^{iw}+e^{-iw}} \\
  \frac{iz}{1} &= \frac{e^{iw}-e^{-iw}}{e^{iw}+e^{-iw}} \\
  \frac{1+iz}{1-iz} &= \frac{e^{iw}}{e^{-iw}} \\
  e^{2iw} &= \frac{1+iz}{1-iz} \\
  2iw &= \ln \frac{1+iz}{1-iz} \\
  w &= \frac{1}{2i} \ln \frac{1+iz}{1-iz} \\
    &= \frac{i}{2} \ln \frac{1-iz}{1+iz} \\
  \tan^{-1} z  &= \frac{i}{2} \ln \frac{i+z}{i-z}
\end{align*}
</s>