Prove :$\tan^{-1}\left(e^{i\theta}\right)=\frac{n\pi}{2}+\frac{\pi}{4}-\frac{i}{2}\ln\left(\tan\left(\frac{\pi}{4}-\frac{\theta}{2}\right)\right)$ 
Prove:
  $$\tan^{-1}\left(e^{i\theta}\right)=\frac{n\pi}{2}+\frac{\pi}{4}-\frac{i}{2}\ln\left(\tan\left(\frac{\pi}{4}-\frac{\theta}{2}\right)\right)$$

My Attempt :
Is $\tan^{-1}$ defined for imaginary quantity?
$\tan^{-1}\left(e^{i\theta}\right)=\tan^{-1}\left(\cos\theta + i\sin \theta\right)$
Is there a series expansion for $\tan^{-1}x$?
 A: let 
$arctan(e^{i\theta}) = x + iy$,
then
$arctan(e^{-i\theta}) = x - iy$
adding these two, we get
$2 \cdot x = arctan(e^{i\theta}) + arctan(e^{-i\theta})
 = arctan(\frac{e^{i\theta} + e^{-i\theta}}{1 - e^{i\theta} \cdot e^{-i\theta}})$
notice that the fraction tends to $\infty$, thus
$2\cdot x = \frac{\pi}{2} + n\pi$
$x = \frac{\pi}{4} + \frac{n\pi}{2}$
solve for imaginary part by subtracting the 2 initial equations
A: Take the derivative to get 
$$\frac{d}{d\theta}\left(\tan^{-1}\left(e^{i\theta}\right)\right) = \frac{ie^{i\theta}}{e^{i2\theta}+1} = \frac{e^{i\theta}}{2}\left(\frac{1}{e^{i\theta}-i}-\frac{1}{e^{i\theta}+i}\right)$$
Now integrate the right hand side
$$\int  \frac{e^{i\theta}}{2}\left(\frac{1}{e^{i\theta}-i}-\frac{1}{e^{i\theta}+i}\right)\:d\theta = \frac{1}{2i}\ln\left(\frac{e^{i\theta}-i}{e^{i\theta}+i}\right)+C = -\frac{i}{2}\ln\left(\frac{e^{i\theta}-e^{i\frac{\pi}{2}}}{e^{i\theta}+e^{i\frac{\pi}{2}}}\right)+C$$
$$= -\frac{i}{2}\ln\left(\frac{e^{i\left(\frac{\theta}{2}-\frac{\pi}{4}\right)}-e^{-i\left(\frac{\theta}{2}-\frac{\pi}{4}\right)}}{e^{i\left(\frac{\theta}{2}-\frac{\pi}{4}\right)}+e^{-i\left(\frac{\theta}{2}-\frac{\pi}{4}\right)}}\right)+C = -\frac{i}{2}\ln\left(i\tan\left(\frac{\theta}{2}-\frac{\pi}{4}\right)\right)+C$$
and we can absorb the $-\frac{i}{2}\ln\left(i\right)$ into the $+C$. From here, since $e^{i\theta}$ is $2\pi$-periodic, plug in $\theta = 2\pi n$ $(n\in\mathbb{Z})$ on both sides to solve for $C$:
$$\tan^{-1}\left(e^{i2\pi n}\right) = -\frac{i}{2}\ln\left(\tan\left(\frac{2\pi n}{2}-\frac{\pi}{4}\right)\right)+C \implies \frac{\pi}{4} = -\frac{i}{2}\ln(-1)+C$$
then use $\ln(-1) = i(\pi + 2\pi n)$ to get that
$$C = \frac{\pi n}{2} - \frac{\pi}{4}$$
giving us our final answer:
$$\tan^{-1}\left(e^{i\theta}\right) = \frac{\pi n}{2} - \frac{\pi}{4} -\frac{i}{2}\ln\left(\tan\left(\frac{\theta}{2}-\frac{\pi}{4}\right)\right)$$
A: Hint:
Let $\tan^{-1}(e^{it})=x+iy$
$\iff\tan^{-1}(e^{-it})=x-iy$
$2x=\tan^{-1}(e^{it})+\tan^{-1}(e^{-it})=\tan^{-1}\dfrac{e^{-it}+e^{it}}{1-1}=\tan^{-1}\dfrac{2\cos t}0=n\pi+$sign of $(\cos t)\cdot\dfrac\pi2$
$$2iy=\tan^{-1}(e^{it})-\tan^{-1}(e^{-it})=\tan^{-1}\dfrac{e^{it}-e^{-it}}{1+1}=\tan^{-1}(2i\sin t)$$
$$2i\sin t=\tan(2iy)=\dfrac{2i(e^{i(2iy)}-e^{-i(2iy)})}{e^{i(2iy)}+e^{-i(2iy)}}$$
$$\iff\sin t=\dfrac{e^{-2y}-e^{2y}}{e^{-2y}+e^{2y}}$$
Apply Componendo et Dividendo
$$\dfrac{e^{2y}}{e^{-2y}}=\dfrac{1-\sin t}{1+\sin t}=\left(\dfrac{1-\tan\dfrac t2}{1+\tan\dfrac t2}\right)^2$$
$$4y=2\ln\left|\dfrac{1-\tan\dfrac t2}{1+\tan\dfrac t2}\right|$$
