1. Solving a cosine integral

I have to following problem:

Given that:

The problem is that i do not see the step between:

and:

I tried rewriting to cosine functions but that only got me deeper in to trouble leaving me with cot functions and i don't think that is what i want to get here.

I hope some one could me help me out, thanks in advance

2. Split the integral into two:

\begin{aligned} \displaystyle \int_{0}^{\pi}\frac{A_{1}\cos{\theta}+A_{3}\cos{3\ theta}}{\cos{\theta}-\cos{\theta_{0}}}\;{d{\theta}}& = \int_{0}^{\pi}\frac{A_{1}\cos{\theta}}{\cos{\theta }-\cos{\theta_{0}}}\;{d\theta}+\int_{0}^{\pi}\frac{3 A_{3}\cos{3\theta}}{\cos{\theta}-\cos{\theta_{0}}}\;{d\theta} \\& = A_{1}\int_{0}^{\pi}\frac{\cos{\theta}}{\cos{\theta }-\cos{\theta_{0}}}\;{d\theta}+3A_{3}\int_{0}^{\pi}\ frac{\cos{3\theta}}{\cos{\theta}-\cos{\theta_{0}}}\;{d\theta}. \end{aligned}

3. Separate them...