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

Here is another way to look at this: consider that $z=|z|e^{i\theta}$ and that $z^*=|z^*|e^{-i\theta}$. Then
$$
\frac{|z|}{|z^*|}=e^{2i\theta}\\
\theta=\frac{1}{2i}(\ln |z|-\ln |z^*|)
$$
Now, let $z=x+i$, then
$$
\theta=\cot^{-1}x=\frac{1}{2i}(\ln |x+i|-\ln |x-i|)
$$
Now,
$$
\cot^{-1}x+\tan^{-1}x=\frac{\pi}{2}
$$
so that
$$
\begin{align}
\tan^{-1}x
&=-\frac{1}{2i}(\ln |x+i|-\ln |x-i|)+\frac{\pi}{2}\\
&=\frac{i}{2}(\ln |x+i|-\ln |x-i|-i\pi)
\end{align}
$$
