proof of $\arctan(x)=\frac{i}{2}(\ln(x+i)-\ln(x-i)-i\pi)$ without solving $\int\frac{1}{x^2+1}dx$ So I know $\int\frac{1}{x^2+1}dx=\arctan(x)+c$
Now when i tried to integral $\frac{1}{x^2+1}$ in a different way i got this:
$$\frac{1}{x^2+1}=\frac{1}{(x-i)(x+i)}=\frac{A}{x-i}+\frac{B}{x+i}\\\implies1=Ax+Ai+Bx-Bi=x(A+B)+i(A-B)\\\implies
\begin{cases}
A+B=0
\\[2ex]
A-B=\frac{1}{i}=-i
\end{cases}\\\implies2A=-i\implies A=\frac{-i}{2}\implies B=\frac{i}{2}$$
So in the end i get:$$\int\frac{1}{x^2+1}dx=\int\frac{i}{2(x+i)}-\frac{i}{2(x-i)}dx=\frac{i}{2}\int\frac{1}{(x+i)}-\frac{1}{(x-i)}dx$$
After integrating this i get $\frac{i}{2}(\ln(x+i)-\ln(x-i)+C)$ after comparing this to $\arctan(x)$ at $x=0$ i find $C=-i\pi$
$\therefore~\arctan(x)=\frac{i}{2}(\ln(x+i)-\ln(x-i)-i\pi)$
now my question is how can i prove that without using the integral

Perhaps using Euler? 
$$ z= \tan w = \frac{\sin w}{\cos w} = \frac{1}{i}\frac{e^{iw}-e^{-iw}}{e^{iw}+e^{iw}} = \frac{1}{i} \frac{e^{2iw}-1}{e^{2iw}+1}$$
so for any $k\in {\Bbb Z}$ $$e^{2iw} = e^{2i(w -k)} = \frac{1+iz}{1-iz}$$
whence 
$$ w = \frac{1}{2i} \log \left( \frac{1+iz}{1-iz} \right) +  k \pi$$
where the choice of $k\in {\Bbb Z}$ depends upon the cut you want.
$k=0$ corresponds to standard choices of $\log(1)=0$ and $\arctan 0=0$.
