5

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.

3 Answers3

8

The problem with your derivation is that the identity only holds true if the respective terms exist (and also you dropped an $i$ in the second $\tan^{-1}$ term).

Instead, we can turn to the complex definition of the trigonometric functions:

$$\begin{eqnarray} \cos z & = & \frac{e^{iz} + e^{-iz}}{2} \\ \sin z & = & \frac{e^{iz} - e^{-iz}}{2} \\ \tan z & = & -i \frac{e^{iz} - e^{-iz}}{e^{iz} + e^{-iz}} \end{eqnarray}$$

If we set $w = \tan z$ then we can solve for $z$:

$$\begin{eqnarray} w & = & -i \frac{e^{iz} - e^{-iz}}{e^{iz} + e^{-iz}} \\ (e^{iz} + e^{-iz}) w & = & -i(e^{iz} - e^{-iz}) \\ (w + i) e^{iz} & = & (i - w) e^{-iz}\\ e^{2iz} & = & \frac{i - w}{i + w} \\ z & = & \frac{1}{2i} \log \frac{i - w}{i + w} \end{eqnarray}$$

We have to be careful here, since the complex logarithm is a multi-valued function, but it is possible to find the desired values through a bit of algebra (which I will leave as an exercise).

ConMan
  • 24,300
  • 3
    Perhaps a bit more accurate to say that both the arctangent and logarithm are multi-valued functions, so when you choose particular branches to use for each, the formula may need to be adjusted to provide the correct coversion between those branches. – Paul Sinclair Dec 01 '23 at 14:13
  • That's true. Since the period of the logarithm is $2 \pi i$ and tangent is $\pi$, they should line up just right but it's good to double-check those kinds of things. – ConMan Dec 02 '23 at 03:46
5

The real way to do this is to write $$ w=\tan^{-1}z$$ $$z = \tan w = \frac{\sin w}{\cos w}=\frac{(e^{iw}-e^{-iw})/2i}{(e^{iw}+e^{-iw})/2} = \frac1i\frac{e^{2iw} - 1}{e^{2iw}+1}$$ $$iz(e^{2iw}+1) = e^{2iw} - 1$$ $$e^{2iw}(1-iz)= 1 + iz$$ $$e^{2iw}=\frac{1+iz}{1-iz}$$ Now you can solve for $w$ (i.e., $\tan^{-1}z$) by taking logarithms and dividing by $2i$.

MPW
  • 43,638
1

The main problem is that the purported identity doesn't even work over $\mathbb{R}$, see https://www.desmos.com/calculator/z2b80oe4ct

If you set $z=\arctan(e^{ix})$, you have $$ e^{ix}=\tan z=\frac{\sin z}{\cos z}=\frac{1}{i}\frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}} $$ and therefore $$ ie^{ix}=\frac{e^{2iz}-1}{e^{2iz}+1} $$ from which $$ e^{2iz}=\frac{1+ie^{ix}}{1-ie^{ix}} $$ The right-hand side simplifies nicely to $$ i\frac{\cos x}{1+\sin x} $$ so you know that the real part of $e^{2iz}$ is $0$. Writing $z=a+bi$ we have $$ e^{2iz}=e^{-2b}e^{2ia}=e^{-2b}(\cos2a+i\sin2a) $$ Thus $\cos2a=0$ meaning that $\sin2a=\pm1$.

If $\cos x>0$, we must have $\sin2a=1$ and $$ 2b=\log\frac{1+\sin x}{\cos x} $$ If $\cos x<0$, we must have $\sin2a=-1$ and $$ 2b=\log\frac{1+\sin x}{-\cos x} $$ Real logarithm in either case.

It remains to deal with the cases $x=\pm\pi/2$ where the expression $\cos x/(1+\sin x)$ isn't defined or is zero, but here $e^{ix}=\pm i$ and the arctangent isn't defined.

egreg
  • 238,574