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?

Are those integrals even well-defined?  Let $\theta_0$ be such that $\cos(\theta_0)=1/2$.  For instance let $\theta_0=\frac{\pi}{3}$.  Take $n=1$.  Now
$$\int_0^\pi\frac{\cos(n\theta_0)}{\cos\theta-\cos(\theta_0)}\;d\theta=\int_0^\pi\frac{1/2}{\cos\theta-1/2}\;d\theta.$$
This integral is actually an improper one, as $\pi/3$ is a singularity.  And it does not converge.
Similarly,
$$\int_0^\pi\frac{\cos(n\theta)}{\cos(\theta)-\cos(n\theta_0)}\;d\theta=\int_0^\pi\frac{\cos(\theta)}{\cos(\theta)-1/2}\;d\theta$$
fails to converge.
