Let's consider $$ f(x) = \log (1+q^2+2q\cos x) = \log |1+qe^{ix}|^2 , $$ which differs from your function only by the additive constant $2\log a_1$ if we take $q=a_0/a_1$. Since $|q|<1$, we can use the Taylor series of $\log(1+z)$ to write $$ f(x) = 2\,\textrm{Re}\; \log (1+qe^{ix}) = 2\,\textrm{Re}\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} e^{inx} \\ = 2\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} \cos nx . $$$$ \begin{align} f(x) = 2\,\textrm{Re}\; \log (1+qe^{ix}) = 2\,\textrm{Re}\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} e^{inx} \\ = 2\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} \cos nx . \end{align} $$
Fixed "math processing error" on the final equation by adding an align environment.