Determine the conditions for $n$ and $\theta\neq0+2k\pi$ such that $(\frac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta})^n \in\mathbb{R}$ Let $z=1+\cos\theta+i\sin\theta=|z|(\cos\alpha+i\sin\alpha)$ and $z'=1-\cos\theta+i\sin\theta=|z'|(\cos\alpha'+i\sin\alpha')$.
My line of reasoning is to convert the numerator and denominator to polar form, then knowing that in order for $(\frac{z}{z'})^n$ to be real, we must have $\arg(\frac{z}{z'})^n \equiv 0 \pmod{\pi}$ or more succinctly $$n(\arg(z)-\arg(z')) \equiv 0 \pmod{\pi}$$.
Determining $\arg(z) = \alpha$ and $\arg(z') = \alpha'$: $$\tan{\alpha}=\frac{\sin{\theta}}{1+\cos{\theta}}=\frac{2\sin{\frac{\theta}{2}\cos{\frac{\theta}{2}}}}{2\cos^2{\frac{\theta}{2}}}=\frac{\sin{\frac{\theta}{2}}}{\cos{\frac{\theta}{2}}}=\tan{\frac{\theta}{2}}$$ thus $\alpha = \frac{\theta}{2}$. $$\tan{\alpha'}=\frac{\sin{\theta}}{1-\cos{\theta}}=\frac{2\sin{\frac{\theta}{2}\cos{\frac{\theta}{2}}}}{2\sin^2{\frac{\theta}{2}}}=\frac{\cos{\frac{\theta}{2}}}{\sin{\frac{\theta}{2}}}=\frac{\sin{\alpha'}}{\cos{\alpha'}}$$ thus $$\sin{\alpha'}\sin{\frac{\theta}{2}}=\cos{\alpha'}\cos{\frac{\theta}{2}} \Leftrightarrow \frac{1}{2}(\cos(\alpha'-\frac{\theta}{2})-\cos(\alpha'+\frac{\theta}{2}))=\frac{1}{2}(\cos(\alpha'-\frac{\theta}{2})+\cos(\alpha'+\frac{\theta}{2}))$$ therefore $$-\cos(\alpha'+\frac{\theta}{2})=\cos(\alpha'+\frac{\theta}{2})$$. Knowing that $$\cos(\pi+\alpha'+\frac{\theta}{2})=\cos(\alpha'+\frac{\theta}{2})$$ is impossible, we take $$\cos(\pi-\alpha'-\frac{\theta}{2})=\cos(\alpha'+\frac{\theta}{2})$$ hence $$\pi-\alpha'-\frac{\theta}{2} = \alpha'+\frac{\theta}{2} \Leftrightarrow \alpha' = \frac{\pi-\theta}{2}$$.
So now we have $$\frac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta} = \frac{|z|(\cos{\frac{\theta}{2}}+i\sin{\frac{\theta}{2}})}{|z'|(\cos{\frac{\pi-\theta}{2}}+i\sin{\frac{\pi-\theta}{2}})}$$
Here's where I have some difficulties. Supposing 
$$\frac{\theta}{2}-\frac{\pi-\theta}{2} \equiv 0 \pmod{\pi}$$ therefore $$\frac{2\theta - \pi}{2} \equiv 0 \pmod{\pi} \Leftrightarrow 2\theta - \pi \equiv 0 \pmod{2\pi}$$ thus $$\theta \equiv \frac{\pi}{2} \pmod{\pi}$$.
However, for all $n$ and using the above condition, $$(\frac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta})^n = 1$$
It can't be for all $n$, there's something here I'm missing.
 A: Easier is to simplify the denominator using conjugates.  \begin{align*}
&\frac{1 + \cos \theta + \mathrm{i} \sin \theta}{1 - \cos \theta + \mathrm{i} \sin \theta} \cdot \frac{1 - \cos \theta - \mathrm{i} \sin \theta}{1 - \cos \theta - \mathrm{i} \sin \theta}  \\
&\quad{}= \frac{2 \sin \theta}{2 - 2 \cos \theta} (-\mathrm{i} \cos \theta + \sin \theta)  \text{,}
\end{align*}
which is the product of a real number and a complex number of magnitude $1$.  The denominator of the real number explains the constraint in the problem statement, so that division by zero is avoided.
It is worth noting 
$$  (-\mathrm{i} \cos \theta + \sin \theta)^n = \frac{(\cos \theta + \mathrm{i} \sin \theta)^n}{\mathrm{i}^n}  \text{.}  $$
When $n$ is even, this denominator is real, so you only require the numerator be real.  When $n$ is odd, the denominator is pure imaginary, so you only require the numerator be pure imaginary...
A: $$\frac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta}=\frac{2\cos^2\frac{\theta}{2}+2i\sin\frac{\theta}{2}\cos\frac{\theta}{2}}{2\sin^2\frac{\theta}{2}+2i\sin\frac{\theta}{2}\cos\frac{\theta}{2}}=-i\cot\frac{\theta}{2}(\cos\frac{\theta}{2}+i\sin\frac{\theta}{2})^2=$$
$$=\cot\frac{\theta}{2}(-\sin\theta+i\cos\theta)=\cot\frac{\theta}{2}\left(\cos\left(270^{\circ}+\theta\right)+i\sin\left(270^{\circ}+\theta\right)\right).$$
Can you end it now?
A: Use the exponential form for complex numbers, it will be much shorter:
$$\frac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta}=\frac{1+\mathrm e^{i\theta}}{1-\mathrm e^{-i\theta}}=\frac{\mathrm e^{\tfrac{i\theta}2}}{\mathrm e^{-\tfrac{i\theta}2}}\,\frac{\mathrm e^{\tfrac{i\theta}2}+\mathrm e^{-\tfrac{i\theta}2}}{\mathrm e^{\tfrac{i\theta}2}-\mathrm e^{-\tfrac{i\theta}2}}=\mathrm e^{i\theta}\,\frac{\cos\cfrac\theta2}{i\sin\cfrac\theta 2},$$
which shows that
$\arg\Bigl(\dfrac{1+\cos\theta+i\sin\theta}{1-\cos\theta+i\sin\theta}\Bigr)=\theta-\frac\pi 2$.
 The $n$-th power of this number will be a real number if and only if
$$n\Bigl(\theta-\frac\pi 2\Bigr)\equiv 0\pmod \pi\iff \theta-\frac\pi 2 \equiv 0\pmod {\frac\pi n}\iff \theta\equiv \frac\pi 2 \pmod{\frac\pi n}.$$
