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
&lt;a&lt;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 &lt; 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
$\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 &lt; a &lt; b\,,\quad a, b\in {\mathbb R}}$.


  \begin{align}
{\rm I}\pars{a,b}&amp;
=\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]&amp;=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]&amp;\mbox{where}\quad \mu \equiv \root{b - a \over b + a} &gt; 0.
\end{align}


\begin{align}
{\rm I}\pars{a,b}&amp;
={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}&amp;
={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}
$$
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&gt;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.