<s>[INST] 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$$
 [/INST] Note that
$$
|1-iz|^2 - |1+iz|^2  = -2i(z -\bar z) = 4 \operatorname{Im}(z)
$$
so that
$$
 z \in \Bbb R \iff \left | \frac{1+iz}{1-iz}\right|= 1 \, .
$$
It follows that
$$
\left(\frac{1+iz}{1-iz}\right)^n = a+ib
$$
has only real solutions $z$ if and only if $|a+ib|=1$, i.e. if $a^2+b^2=1$.
</s>