Find a condition on real numbers $a$ and $b$ such that $\left(\frac{1+iz}{1-iz}\right)^n = a+ib$ has only real solutions I´m new on this. I need to find a condition that relates  two real numbers $a$ and $b$ such that 
 $$\left(\frac{1+iz}{1-iz}\right)^n = a+ib$$
has only real solutions
This is what I got till now.
$$\left(\frac{1+i(a+ib)}{1-i(a+ib)}\right)^n = a+ib$$
$$\left(\frac{(1-b)+ia}{(1+b)-ia}\right)^n = a+ib$$
$$\frac{(1-b)+ia}{(1+b)-ia}.\frac{(1+b)+ia}{(1+b)+ia} = \frac{1-b^2+2ia-a^2}{1+2b+b^2+a^2}$$
then 
$$\left(\frac{1-b^2-a^2}{1+2b+b^2+a^2}+\frac{2ia}{1+2b+b^2+a^2}\right)^n = a+ib$$
where
$$a=0  \text{; & } 1+2b+b^2\neq0$$

that is an awesome answer given by Martin R. 
alternatively, let
$$
a+ib = \sqrt{a^2+b^2} e^{i \theta}
$$
$c$ be the real solution for satisfied $a,b$.  One would obtain 
$$
\label{eq}
\sqrt[n]{a^2+b^2} e^{ \frac{i (\theta + 2k\pi )}{n} } = \frac{1-c^2 +i 2c}{1+c^2}   \tag1
$$
note that
$$
 ( \frac{1-c^2 }{1+c^2} ) ^2 + ( \frac{2c}{1+c^2} ) ^2 = 1
$$
which means $\sqrt[n]{a^2+b^2} =1$ equivalently
$$a^2+b^2 =1 $$
And for each $e^{ \frac{i (\theta + 2k\pi )}{n} } $ there exists only one $c \in \mathbb{R}$ satisfy $\eqref{eq}$
