I am trying to simplify $$\tan^{-1}\left(e^{ix}\right), x\in\mathbb{R}$$
$$=\\tan^{-1}\left(\cos x+i\sin x\right)$$
Using $$\tan^{-1}\left(a+b\right)=\frac12\tan^{-1}\left(\frac{2a}{1-a^2+b^2}\right)+\frac12\tan^{-1}\left(\frac{2b}{1+a^2-b^2}\right)$$
Gives $$\frac12\tan^{-1}\left(\frac{2\cos x}{1-\cos^2x-\sin^2x}\right)+\frac12\tan^{-1}\left(\frac{2\sin x}{1+\cos^2x+\sin^2x}\right)$$
$$\frac12\tan^{-1}\left(\frac{2\cos x}{0}\right)+\frac12\tan^{-1}\left(\sin x\right)$$
Which is undefined (?), however if I enter the expression into my HP Prime with a value of x, say 0.23 it gives 0.785+0.116i
So which of these is correct, thanks for the help.