A homework problem from my complex analysis class:
Show that $\sum_{n = 1}^{\infty} r^n \cos n\theta = \frac{r \cos \theta - r^2}{1-2r\cos \theta + r^2}\,$ whenever $\, 0 < r < 1$.
I know that I must show $\Re(\frac{1}{1-z}) - 1 = \frac{r \cos \theta - r^2}{1-2r\cos \theta + r^2}\,$ since $\sum_{n=0}^{\infty}z^n = \frac{1}{1-z}$ whenever $|z| < 1$, but I am not sure how to calculate the real part of the complex number $\frac{1}{1-z}$.
More generally, what is a good approach to take when we want to find the real and imaginary parts of a complex number that has $i$ in the denominator?