Showing that $\int_0^\pi\frac{\cos n\theta}{\cos\theta-\cos\theta_0}d\theta=\pi\frac{\sin n\theta_0}{\sin\theta_0}$ I am reading Debnath & Bhatta "Integral Transforms and Their Applications, 3rd". They cited one example from Zayed "Handbook of Function and Generalized Function Transformations" and stated an integral (Eq.(9.5.45)), for a non-negative integer n,
$$\int_0^\pi \frac{\cos(n \theta)}{\cos(\theta)-\cos(\theta_0)}d\theta=\pi \frac{\sin(n \theta_0)}{\sin(\theta_0)}$$
It turns out many books on Hilbert transform use this relation for Airfoil Design example, e.g., Prederick W.King, Chapter 11.14 "Hilbert Transform-V1".
Interestingly, I remember the following one from Paul J. Nahin, Eq.(2.3.8) of "Inside Interesting Integrals"
$$\int_0^\pi \frac{\cos(n \theta)-\cos(n \theta_0)}{\cos(\theta)-\cos(\theta_0)}d\theta=\pi \frac{\sin(n \theta_0)}{\sin(\theta_0)}.$$
You can find the proof in that book.
So, if both integrals are correct, then we should have 
$$\int_0^\pi \frac{1}{\cos(\theta)-\cos(\theta_0)}d\theta=0,$$ which I cannot see why. Mathmatica gives an pure imaginary result here. How shall I interpret these and how can I prove the first integral?

I might have solved it. See my attached hand writing. Thanks go for Jean for solving singularity through PV integral.
Other comments are also appreciated. Let me know if my trick does not work.

