Can integration relate real and complex numbers? eg, considering $\int\frac{dx}{1+x^2}$ vs $\int\frac{dx}{(1+ix)(1-ix)}$ We all know that
$$\int\frac{dx}{1+x^2}=\tan^{-1}x+C$$
Let's evaluate this a bit differently,
$$\int\frac{dx}{1+x^2}=\int\frac{dx}{(1+ix)(1-ix)}$$
$$=\frac{1}{2}\int\frac{(1+ix+1-ix)dx}{(1+ix)(1-ix)}$$
$$=\frac{i}{2}\ln \left(\frac{1-ix}{1+ix}\right)+\mathbb C$$
but that must mean
$$\tan^{-1}x=\frac{i}{2}\ln \left(\frac{1-ix}{1+ix}\right)+\mathbb C$$
Plugging in $x=0$, we get
$\mathbb C=0$
$$\implies i\ln \left(\frac{1-ix}{1+ix}\right)=2\tan^{-1} x$$

Question:
Is this valid?


If yes then can someone give more examples which lead to such relations?

Thanks!
 A: Let $\,\,\mathsf{y=tan^{-1}(x)}$
$\mathsf{\implies\,x=tan(y)}$
$\mathsf{\implies\,x=\dfrac{sin(y)}{cos(y)}}$
$\mathsf{\implies\,x=\dfrac{\dfrac{e^{iy}-e^{-iy}}{2i}}{\dfrac{e^{iy}+e^{-iy}}{2}}}$
$\mathsf{\implies\,x=\dfrac{e^{iy}-e^{-iy}}{i\left(e^{iy}+e^{-iy}\right)}}$
$\mathsf{\implies\,ix=\dfrac{e^{iy}-e^{-iy}}{e^{iy}+e^{-iy}}}$
$\mathsf{\implies\,\dfrac{1}{ix}=\dfrac{e^{iy}+e^{-iy}}{e^{iy}-e^{-iy}}}$
Using componendo and dividendo,
$\mathsf{\implies\,\dfrac{1+ix}{1-ix}=\dfrac{e^{iy}+e^{-iy}+e^{iy}-e^{-iy}}{e^{iy}+e^{-iy}-e^{iy}+e^{-iy}}}$
$\mathsf{\implies\,\dfrac{1+ix}{1-ix}=\dfrac{2\,e^{iy}}{2\,e^{-iy}}}$
$\mathsf{\implies\,\dfrac{1+ix}{1-ix}=\dfrac{e^{iy}}{e^{-iy}}}$
$\mathsf{\implies\,\dfrac{1+ix}{1-ix}=e^{2iy}}$
Taking log both sides,
$\mathsf{\implies\,\ln\left(\dfrac{1+ix}{1-ix}\right)=\ln\left(e^{2iy}\right)}$
$\mathsf{\implies\,\ln\left(\dfrac{1+ix}{1-ix}\right)=2iy}$
$\mathsf{\implies\,y=\dfrac{1}{2\,i}\ln\left(\dfrac{1+ix}{1-ix}\right)}$
$\mathsf{\implies\,y=-\dfrac{i}{2}\ln\left(\dfrac{1+ix}{1-ix}\right)}$
$\mathsf{\implies\,y=\dfrac{i}{2}\ln\left(\dfrac{1-ix}{1+ix}\right)}$
$\mathsf{\implies\,tan^{-1}(x)=\dfrac{i}{2}\ln\left(\dfrac{1-ix}{1+ix}\right)}$
