Using the Lagrange interpolation theory for $x_{0}=-i$ and $x_{1}=i$ we have
$\displaystyle \int \frac{dx}{(x^{2}+1)}= \frac{-1}{2i}\int \frac{dx}{x+i} + \frac{1}{2i}\int\frac{dx}{x-i}=\frac{1}{2i}(\ln|x-i|+\ln|x+i|)+ C$
So I was wondering in how to prove the equivalence with the trigonometric solution given when we do $x=tg( \theta)$ that we obtain
$arc tg(x)+ C_{1}$
You can do this algebraically. Set
$$y=\arctan x$$
$$\tan y =x$$
$$\frac{e^{iy} - e^{-iy}}{i(e^{iy} + e^{-iy})} = x$$
$$e^{iy} - e^{-iy} = i(e^{iy}x + e^{-iy}x)$$
$$e^{2iy}-1=e^{2iy}ix+ix$$
$$e^{2iy}(1-ix) = 1+ix$$
$$e^{2iy} = \frac{1+ix}{1-ix}$$
$$2iy = \ln\left(\frac{i(-i+x)}{i(-1-x)}\right)$$
$$y = \frac{1}{2i}\ln\left(-\frac{x-i}{x+i}\right)$$
$$y =\frac{1}{2i}\left( \ln(x-i) -\ln(x+i) +\ln(-1)\right)$$