If $a=\cos \theta+i \sin \theta$, find the value of $\frac{1+a}{1-a}$
$\frac{1+a}{1-a}=\frac{1+\cos \theta+i \sin \theta}{1-\cos \theta-i \sin \theta}$
$=\frac{(1+\cos \theta)+i \sin \theta}{(1-\cos \theta)-i \sin \theta} \times \frac{(1-\cos \theta)+i \sin \theta}{(1-\cos \theta)+i \sin \theta}$
$=\frac{1-\cos \theta+i \sin \theta+\cos \theta-\cos ^{2} \theta+i \cos \theta \sin \theta+i \sin \theta-i \sin \theta \cos \theta+i^{2} \sin ^{2} \theta}{(1-\cos \theta)^{2}-i^{2} \sin ^{2} \theta}$
$=\frac{1-\cos ^{2} \theta-\sin ^{2} \theta+2 i \sin \theta}{1+\cos ^{2} \theta-2 i \cos \theta+\sin ^{2} \theta}$ $\left[\because i^{2}=-1\right]$
$=\frac{\sin ^{2} \theta-\sin ^{2} \theta+2 i \sin \theta}{2-2 i \cos \theta}$ $\left[\because \cos ^{2} \theta+\sin ^{2} \theta=1\right]$
$=\frac{i \sin \theta}{1-\cos \theta}$
$=\frac{2 i \sin \frac{\theta}{2} \cos \frac{\theta}{2}}{2 \sin ^{2} \frac{\theta}{2}}$
$=2 i \cot \frac{\theta}{2}$
Thus, $\frac{1+a}{1-a}=2 i \cot \frac{\theta}{2}$.