Integral $I(a,b)= P\int_{0}^{\pi}\frac{d\theta}{a-b\cos\theta}$ Hi I am trying to calculate this integral
$$
I(a,b)= P\int_{0}^{\pi}\frac{d\theta}{a-b\cos\theta},\quad 0
<a<b,\quad a,b\in \mathbb{R}.
$$
We can first write
$$
I(a,b)=\frac{1}{2} P\int_{-\pi}^{\pi}\frac{d\theta}{a-b\cos\theta}
$$
since integrand is even.  Now we will use $z=e^{i \theta}$, $dz=ie^{i\theta} d\theta$, $d\theta=dz/(iz)$.  We can write the $\cos$ function as
$$
\cos \theta=\frac{1}{2}(z+z^{-1}).
$$
We can now write the integral as
$$
I(a,b)=\frac{1}{2i}  P \oint_{|z|=1} \frac{dz}{z(a-\frac{b}{2}(z+z^{-1}))}=\frac{1}{i} P\oint_{|z|=1} \frac{dz}{2az-bz^2-b}=-\frac{1}{ib} \oint_{|z|=1} \frac{dz}{z^2-2z\frac{a}{b}+1}.
$$
But I am starting to get stuck here.... We can define $\gamma= a/b < 1$ and now calculate the poles of the integrand.  The poles are given by
$$
z^2-2\gamma z+1=0 , \ z_{\pm}=\gamma +\frac{1}{2} (4\gamma^2-4)^{1/2}=\gamma \pm i(1-\gamma^2)^{1/2}.
$$
If we take the squared magnitude of roots we obtain
$$
|z_{\pm}|^2=\gamma^2 + (1-\gamma^2)=1 
$$
thus we can see that $z_{\pm} \in |z|=1$. 
How can we proceed , it seems we just have simple poles?  Thanks
 A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{{\rm I}\pars{a,b}
     \equiv\pp\int_{0}^{\pi}{\dd\theta \over a - b\cos\pars{\theta}}\,,
     \qquad 0 < a < b\,,\quad a, b\in {\mathbb R}}$.

\begin{align}
{\rm I}\pars{a,b}&
=\Re\ \overbrace{\int_{0}^{\pi}{\dd\theta \over a - b\cos\pars{\theta} + \ic 0^{+}}}
^{\ds{t \equiv \tan\pars{\theta \over 2}}}\
=\ \Re\int_{0}^{\pi}{2\,\dd t/\pars{1 + t^{2}}
\over a - b\pars{1 - t^{2}}/\pars{1 + t^{2}} + \ic 0^{+}}
\\[3mm]&=2\Re\int_{0}^{\infty}
{\dd t \over a\pars{1 + t^{2}} - b\pars{1 - t^{2}} + \ic 0^{+}}
={2 \over a + b}\Re\int_{0}^{\infty}
{\dd t \over t^{2} - \mu^{2} + \ic 0^{+}}
\\[3mm]&\mbox{where}\quad \mu \equiv \root{b - a \over b + a} > 0.
\end{align}

\begin{align}
{\rm I}\pars{a,b}&
={2 \over a + b}\pp\int_{0}^{\infty}{\dd t \over t^{2} - \mu^{2}}
={2 \over a + b}\lim_{\epsilon \to 0^{+}}\pars{%
\int_{0}^{\mu - \epsilon}{\dd t \over t^{2} - \mu^{2}}
+\int_{\mu + \epsilon}^{\infty}{\dd t \over t^{2} - \mu^{2}}}
\end{align}

$$
\int{\dd t \over t^{2} - \mu^{2}}
={1 \over 2\mu}\int\pars{{1  \over t - \mu} - {1 \over t + \mu}}\,\dd t
={1 \over 2\mu}\,\ln\pars{\verts{t - \mu \over t + \mu}}
$$

\begin{align}
{\rm I}\pars{a,b}&
={2 \over a + b}\,{1 \over 2\mu}\lim_{\epsilon \to 0^{+}}\bracks{%
\ln\pars{\epsilon \over \verts{2\mu - \epsilon}}
-\ln\pars{\epsilon \over 2\mu + \epsilon}}
\end{align}

$$\color{#00f}{\large%
{\rm I}\pars{a,b}
     \equiv\pp\int_{0}^{\pi}{\dd\theta \over a - b\cos\pars{\theta}} = 0}
$$

A: For $0 < a < b$, we have two simple poles on the unit circle, so we need to keep the principal value sense of the integral.
To evaluate the integral, close the contour by adding small circular arcs with centre at the poles in place of the omitted arcs of the unit circle around the poles. Picking the added semicircles inside the unit disk, the contour integral is $0$, and we obtain
$$\text{v.p.} \int_{\lvert z\rvert = 1} \frac{dz}{z^2-2\gamma z + 1} = \lim_{\rho\to 0} \left(\int\limits_{\substack{\lvert z-z_+\rvert = \rho\\ \lvert z\rvert < 1}} \frac{dz}{z^2-2\gamma z + 1} + \int\limits_{\substack{\lvert z-z_-\rvert = \rho\\ \lvert z\rvert < 1}} \frac{dz}{z^2-2\gamma z + 1}\right).$$
The integrals over the small semicircles tend to $\pi i$ times the residue in the respective pole, so
$$\begin{align}
\text{v.p.} \int_{\lvert z\rvert = 1} \frac{dz}{z^2-2\gamma z + 1} &= \pi i \left(\operatorname{Res}\left(\frac{1}{z^2-2\gamma z+1}; z_+\right) + \operatorname{Res}\left(\frac{1}{z^2-2\gamma z+1}; z_-\right)\right)\\
&= \pi i\left(\frac{1}{2(z_+-\gamma)} + \frac{1}{2(z_- -\gamma)}\right)\\
&= \frac{\pi i}{2} \left(\frac{1}{i\sqrt{1-\gamma^2}} + \frac{1}{-i\sqrt{1-\gamma^2}}\right)\\
&= 0.
\end{align}$$
A: Note that you made an incorrect assumption. If $a/b\le 1$, then the integral is not defined and so one must assume that $a/b>1$. Then you have two simple poles, one inside the unit disk and the other outside. Now just compute the residue for the one inside the unit disk.
