Consider the following definite integral, $I(n; \theta)$.
$$ I(n; \theta) = \int_{0}^{\pi} \frac{\cos(n\phi)}{\cos\phi-\cos\theta} d\phi \quad \text{where } n \in N $$
When $0 < \theta < \pi $, the integral does not converge, but its Cauchy Principal Value exists.
My question is: Is there a closed-form expression for the PV of this integral, i.e. for the expression
$$ J(n; \theta) \equiv I(n; \theta)|_{0 < \theta < \pi} = PV \int_{0}^{\pi} \frac{\cos(n\phi)}{\cos\phi-\cos\theta} d\phi \quad \text{where } n \in N $$
Mathematica outputs something complicated involving the MeijerG function. However, I know that for specific values of $n$, the integral is quite tractable.
For instance, when $n=1$, $J(1; \theta) = \pi$.
I considered a couple of contour integration procedures but wasn't really able to make any headway.
Thanks.