Find the real and imaginary part of z let $z=$ $$ \left( \frac{1 + \sin\theta + i\cos\theta}{1 + \sin\theta - i\cos\theta} \right)^n$$

Rationalizing the denominator:
$$\frac{1 + \sin\theta + i\cos\theta}{1 + \sin\theta - i\cos\theta}\cdot\left( \frac{1 + \sin\theta + i\cos\theta}{1 + \sin\theta + i\cos\theta}\right) = \frac{(1 + \sin\theta + i\cos\theta)^2}{(1 + \sin\theta)^2 + \cos^2\theta}$$
$$=\frac{(1 + \sin\theta)^2 + \cos^2\theta + 2i(1 + \sin\theta)\cos\theta }{(1 + \sin\theta)^2 + \cos^2\theta}$$
thus
$$x = \frac{(1 + \sin\theta)^2 + \cos^2\theta }{(1 + \sin\theta)^2 + \cos^2\theta} $$
$$y= \frac{2i(1 + \sin\theta)\cos\theta }{(1 + \sin\theta)^2 + \cos^2\theta}$$
According to the binomial theorem, 
$$(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k}y^k$$
we get 
$$z = \frac{1}{(1 + \sin\theta)^2 + \cos^2\theta}\sum_{k=0}^n \binom{n}{k} ((1 + \sin\theta)^2 + \cos^2\theta)^{n-k}\cdot(2i(1 + \sin\theta)\cos\theta)^k$$
...and that is where I'm stuck. What do you think? Thanks for the attention.

HINT: Express the fraction as $r e^{i\theta}$ and compute $r^n e^{i n\theta}$.
