This is a homework problem. From Fourier Series and Boundary Value problems, Brown/Churchill 8th ed.
I should begin with $2\cos{A}\cos{B}=\cos{(A+B)}+\cos{(A-B)}$, substitute with $A=n\theta$ and $B=\theta$, and sum from $n=1$ to $\infty$ both sides. So far I got here
$\sum_{n=1}^{\infty} a^n \cos{(n\theta)}= \sum_{n=1}^{\infty} \frac{a^n\cos{(n\theta+\theta)}+a^n\cos{(n\theta-\theta)}}{2\cos{\theta}}$
Hints on how to proceed from here?
Consider that: $$\cos(n\theta)=\frac{\mathbb e^{n\theta i}+\mathbb e^{-n\theta i}}{2}$$ So: $$r^n\cos(n\theta)=\frac{r^n\mathbb e^{n\theta i}+r^n\mathbb e^{-n\theta i}}{2}$$ When: $|r|\lt1$, both of the following series are convergence:$$\sum_{n=1}^\infty r^n\mathbb e^{n\theta i}\,\,\,,\,\,\,\sum_{n=1}^\infty r^n\mathbb e^{-n\theta i}$$ Thus: $$ \begin{align} \sum_{n=1}^\infty r^n\cos(n\theta)&=\frac12(\sum_{n=1}^\infty r^n\mathbb e^{n\theta i}+\sum_{n=1}^\infty r^n\mathbb e^{-n\theta i})\\ &=\frac12(\frac{r\mathbb e^{i\theta}}{1-r\mathbb e^{i\theta}})+\frac12(\frac{r\mathbb e^{-i\theta}}{1-r\mathbb e^{-i\theta}}) \end{align} $$