Simplifying $i \left[ \ln(x+i)-\ln(x-i)-\ln(1+ix)+\ln(1-ix) \right]$ Can the following expression further be simplified and expressed in terms of usual functions such as inverse hyperbolic or inverse trigonometric functions?
$$
f(x) = i \left[ \ln(x+i)-\ln(x-i)-\ln(1+ix)+\ln(1-ix) \right] \, , 
$$
where $x\ge 0$ is a real number. 
Inputs and ideas welcome.
Thanks
 A: Using the exponential form of $\tan{(x)}$ one can prove that
$$\arctan{(x)}=\frac{i}2(\ln{(1-ix)}-\ln{(1+ix)})$$
Using the principal valued logarithm we can write
$$\ln{(1+ix)}=\ln{(x-i)}+\ln{(i)}=\ln{(x-i)}+\frac{i\pi}2$$
$$\ln{(1-ix)}=\ln{(x+i)}+\ln{(-i)}=\ln{(x+i)}-\frac{i\pi}2$$
Hence we can rewrite the inverse tangent function as
$$\begin{align}
\arctan{(x)}
&=\frac{i}2\left(\ln{(x+i)}-\frac{i\pi}2-\left(\ln{(x-i)}+\frac{i\pi}2\right)\right)\\
&=\frac{i}2\left(\ln{(x+i)}-\ln{(x-i)}-i\pi\right)\\
&=\frac{\pi}2+\frac{i}2\left(\ln{(x+i)}-\ln{(x-i)}\right)\\
\end{align}$$
Hence the given function is
$$f(x)=2\left(\arctan{(x)}-\frac{\pi}2\right)+2\arctan{(x)}=4\arctan{(x)}-\pi$$
A: We have that
$$f(x) = i \left[ \ln(x+i)-\ln(x-i)-\ln(1+ix)+\ln(1-ix) \right] =\\= i \left[\ln i-\ln i +\ln(1-ix)-\ln(-1-ix)-\ln(1+ix)+\ln(1-ix) \right]=$$
$$= i \left[2\ln(1-ix)+\ln (-1)-\ln(1+ix)-\ln(1+ix) \right]=$$
$$= i \left[2\ln(1-ix)-2\ln(1+ix)+\ln (-1) \right]=2i\ln\left(\frac{1-ix}{1+ix}\right)+2i\ln i$$
then refer to Logarithmic forms.
A: We can use the definition of a branch cut of log for positive real part:
$$\text{Log}_k( z) = \log |z| + i \tan^{-1}\left(\frac{\text{Im}(z)}{\text{Re}(z)}\right)+i2\pi k$$
for $k\in\mathbb{Z}$. The principal branch of log is given by $k=0$. We can show the expression above has the same value no matter the branch. Plugging things in we have:
$$i\Bigr[i\tan^{-1}\left(\frac{1}{x}\right) - i\tan^{-1}\left(-\frac{1}{x}\right)  - i\tan^{-1}(x) + i\tan^{-1}(-x)\Bigr]$$
$$= 2\Biggr[\tan^{-1}(x)-\tan^{-1}\left(\frac{1}{x}\right)\Biggr]$$
Since all of the magnitudes were identical, they canceled. Then we can use the fact that $\tan^{-1}(x) + \tan^{-1}\left(\frac{1}{x}\right) = \frac{\pi}{2}$ for $x>0$:
$$= 2\Biggr[2\tan^{-1}(x) - \tan^{-1}(x) - \tan^{-1}\left(\frac{1}{x}\right)\Biggr] = 4\tan^{-1}(x)-\pi$$
A: Another approach to simplifying $f(x)$ is to simply use the expansion in power series of $x$.
Specifically,
\begin{align}
i \left( \ln(x+i)-\ln(x-i) \right) &=-\pi+ 2\left( x - \frac{x^3}{3} + \frac{x^5}{5} + \cdots \right) , \\
i \left(-\ln(1+ix)+\ln(1-ix) \right) &= 2\left( x - \frac{x^3}{3} + \frac{x^5}{5} + \cdots \right).
\end{align}
Thus
$$
f(x) = -\pi + 4 \left( x - \frac{x^3}{3} + \frac{x^5}{5} + \cdots \right) = -\pi+4\arctan x.
$$
