I want to do following integrals \begin{align} \int_{-\pi}^{\pi}\frac{1}{ai+b\cos(x)}dx \end{align} where $a,b$ are real
Frist my trial was using the ideas of complex analysis, but here I don't know whether the poles are inside $|z|<1$ or not. (Since i didn't fix the magnitude of a and b)
any ideas? To this integral be finite, do i have to restrict the magnitude of $|a|$ and $|b|$ (i.e. |a|<|b|)
For the simple case, via mathematica i can obtain some results, for example setting a=1 or b=1 case. I want to know how to calculate such integrals.
For $a+b\cos(\theta)$ case, introducting complex variables or parametrizing cos(x) into functions of $tan^2(x/2)$ i can do the integral without any problem, but i want to do it in more general
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Note that $\ds{\bbx{\left.\mc{I}\pars{a,0}\,\right\vert_{\ a\ \not=\ 0} = -\,{2 \over a}\,\pi\ic}}$. Then $\ds{\pars{~\mbox{with}\ a \not= 0\,,\ b \not= 0\ \mbox{and}\ \mu \equiv {a \over b} \in \mathbb{R}~}}$, \begin{align} \left.\rule{0pt}{5mm}\mc{I}\pars{a,b}\,\right\vert_{\ b\ \not=\ 0} & \equiv {2 \over b}\int_{0}^{\pi}{\dd x \over \mu\ic + \cos\pars{x}} = {2 \over b}\int_{-\pi/2}^{\pi/2}{\dd x \over \mu\ic - \sin\pars{x}} \\[5mm] & = {2 \over b}\int_{0}^{\pi/2}\bracks{{1 \over \mu\ic - \sin\pars{x}} + {1 \over \mu\ic + \sin\pars{x}}}\dd x = {4\mu \over b}\,\ic\int_{0}^{\pi/2}{\dd x \over -\mu^{2} - \sin^{2}\pars{x}} \\[5mm] & = -\,{4\mu \over b}\,\ic\int_{0}^{\pi/2}{\sec^{2}\pars{x} \over \mu^{2}\sec^{2}\pars{x} + \tan^{2}\pars{x}}\dd x = -\,{4\mu \over b}\,\ic\int_{0}^{\pi/2}{\sec^{2}\pars{x} \over \pars{\mu^{2} + 1} \tan^{2}\pars{x} + \mu^{2}}\dd x \\[5mm] & = -\,{4\over b\mu}\,\ic\,{\verts{\mu} \over \root{\mu^{2} + 1}}\int_{0}^{\pi/2}{\root{\mu^{2} + 1}\sec^{2}\pars{x}/\verts{\mu} \over \bracks{\root{\mu^{2} + 1}\tan\pars{x}/\verts{\mu}}^{2} + 1}\dd x\quad \pars{\begin{array}{l} \mbox{Note that this} \\ \mbox{step requires} \\ \ds{\mu \not= 0} \\ \ds{\implies a \not= 0} \end{array}} \\[5mm] & = -\,{4\,\mrm{sgn}\pars{\mu}\over b\root{\mu^{2} + 1}}\,\ic \int_{0}^{\infty}{\dd t \over t^{2} + 1}\dd x = -\,{2\,\mrm{sgn}\pars{\mu}\over b\root{\mu^{2} + 1}}\,\pi\ic = -\,{2\,\mrm{sgn}\pars{a/b} \over b\root{a^{2}/b^{2} + 1}}\,\pi\ic \\[5mm] & = -\,{2\,\mrm{sgn}\pars{a} \over \root{a^{2} + b^{2}}}\,\pi\ic\qquad a \not= 0. \end{align}
$$ \bbx{\int_{-\pi}^{\pi}{\dd x \over a\ic + b\cos\pars{x}} = \left\{\begin{array}{lcl} \ds{-\,{2 \over a}\,\pi\ic} & \ds{\mbox{if}} & \ds{a \not = 0\,,\quad b = 0} \\[2mm] \ds{-\,{2\,\mrm{sgn}\pars{a} \over \root{a^{2} + b^{2}}}\,\pi\ic} & \mbox{if} & \ds{a \not = 0\,,\quad b \not= 0} \\[2mm] \mbox{diverges} && \mbox{otherwise} \end{array}\right.} $$