A question about the log of a rational function We have the rational function :
$$f(x)=\frac{(1+ix)^{n}-1}{(1-ix)^{n}-1}\;\;\;,\;\;n\in \mathbb{Z}^{+}$$
It's not hard to prove that :
$$\frac{(1+ix)^{n}-1}{(1-ix)^{n}-1}=(-1)^{n}\prod_{k=1}^{n-1}\frac{x+i(\xi_{n}^{k}-1)}{x-i(\xi_{n}^{k}-1)}\;\;\;,\;\;\xi_{n}^{k}=e^{2\pi i k/n}$$
Now we want to compute $\log f(x)$ for $x>0$. The logarithm of the individual factors can be written as : 
$$\log\left(\frac{x+i(\xi_{n}^{k}-1)}{x-i(\xi_{n}^{k}-1)}\right)=2i\tan^{-1}\left(\frac{x}{1-\xi_{n}^{k}}\right)+i\pi;\;\;\;\;x>0$$
So, one would expect:
$$\log f(x)=-i\pi+2i\pi n+2i\sum_{k=1}^{n-1}\tan^{-1}\left(\frac{x}{1-\xi_{n}^{k}}\right)$$
But it looks nothing like what wolframalpha returns. What am i doing wrong here ?

I think that, if you use the standard branch of $\log$ used by Wolfram Alpha, your third identity should read:
$$\log\left(\frac{x+i(\xi_{n}^{k}-1)}{x-i(\xi_{n}^{k}-1)}\right)=2i\tan^{-1}\left(\frac{x}{1-\xi_{n}^{k}}\right)-\pi i,\quad x>0.$$
Compare for exampe: arctan and log.
You are using a branch of the logarithm, so in general it is not true that $\log (ab) = \log(a) + \log(b)$. You can check that the difference between the corrected expression 
$$\log f(x)=-\pi(n-1)i + 2i\sum_{k=1}^{n-1}\tan^{-1}\left(\frac{x}{1-\xi_{n}^{k}}\right),$$
and the original $\log f(x)$ is a multiple of $\pi$.
