Can $\frac{e^{i k \theta}}{a + cos(\theta)}$ be integrated (not numerically) from $0 $ to $2\pi$? In the problem I'm working at now, I have encountered some integrals of the form:
$$\int_0^{2\pi} \frac{e^{i k \theta}}{a + \cos(\theta)}d\theta,k\in\Bbb Z,a>1$$
I have no guarantee that they can be done by hand, so I'm asking this here, as maybe someone has seen such a beast before.
Edit: Sorry, I forgot to write $d\theta$. (I wrote the post late at night) I also thank you all for your answers.
 A: Let $k>0$. You can try the following substitution:
$$ \cos\theta = \frac{z+z^{-1}}{2}$$
$$ e^{i\theta} = z$$
$$ d\theta = \frac{dz}{iz}$$
Your integral is transformed in a contour integral round the unit complex circle counterclockwise:
$$I=\int_0^{2\pi} \frac{e^{i k \theta}}{a + \cos(\theta)}d\theta =\frac{2}{i} \oint_{|z|=1}\frac{z^{k}}{2az+z^2+1}dz $$
The function
$$f(z) = \frac{z^{k}}{2az+z^2+1}$$
Has two singularities:
$$z_{1}=  \sqrt{a^2-1}-a$$
$$z_{2} =  -\sqrt{a^2-1}-a$$
The residue will be zero if there is no singularity inside the circe. Then we need:
$$|z_{1}|= |\sqrt{a^2-1}-a|<1 \Longrightarrow a>  1$$
$$|z_{2}| = |-\sqrt{a^2-1}-a|<1  \Longrightarrow a< -1 $$
Hence, if $a>1$ $z_{2}$ is outside the circle and its residue is zero. Therefore,
$$I= \frac{2}{i} \oint_{|z|=1}\frac{z^{k}}{2az+z^2+1}dz = 4\pi \operatorname{Res}(f,z_{1})$$
Then
$$\operatorname{Res}(f,z_{1}) = \lim_{z \to z_{1}} (z-z_{1})f(z) = \frac{(\sqrt{a^2-1}-a)^k}{2\sqrt{a^2-1}}$$
Therefore
$$\boxed{\int_0^{2\pi} \frac{e^{i k \theta}}{a + \cos(\theta)}d\theta=2\pi \frac{(\sqrt{a^2-1}-a)^k}{\sqrt{a^2-1}}  \quad a>1,k>0}$$
As pointed out by @Sangchul Lee the case $k<0$ follows by taking the complex conjugate.
$$\int_0^{2\pi} \frac{e^{-i k \theta}}{a + \cos(\theta)}d\theta= \overline{\int_0^{2\pi} \frac{e^{i k \theta}}{a + \cos(\theta)}d\theta}=\overline{2\pi \frac{(\sqrt{a^2-1}-a)^k}{\sqrt{a^2-1}} } $$
A: Assuming that you are integrating with respect to $\theta$, this is easily tackled once you know how to expand the integrand into a Fourier series. Indeed, if
$$ \frac{1}{a+\cos\theta} = \sum_{n\in\mathbb{Z}} c_n e^{in\theta} $$
either uniformly on $[0,2\pi]$ or in $L^2[0,2\pi]$, then the answer will be simply $2\pi c_{-k}$.
Now, let $\xi = -a + \sqrt{a^2 - 1}$. Then $\xi$ and $\xi^{-1}$ are the zeros of the equation $X^2 + 2aX + 1 = 0$. Moreover, since $a > 1$, we have $|\alpha| < 1$. Then by using $\cos\theta = (e^{i\theta} + e^{-i\theta})/2$, we get
\begin{align*}
\frac{1}{a+\cos\theta}
&= \frac{2e^{i\theta}}{e^{2i\theta} + 2ae^{i\theta} + 1}
= \frac{2e^{i\theta}}{(e^{i\theta} - \xi)(e^{i\theta} - \xi^{-1})} \\
&= \frac{1}{\sqrt{a^2-1}} \left( \frac{1}{1 - \xi e^{i\theta}} + \frac{\xi e^{-i\theta}}{1 - \xi e^{-i\theta}} \right).
\end{align*}
Here, the last line follows from the partial fraction decomposition. Finally, using the geometric series formula, this expands as
\begin{align*}
\frac{1}{a+\cos\theta}
&= \frac{1}{\sqrt{a^2-1}} \sum_{n\in\mathbb{Z}} \xi^{|n|} e^{in\theta}.
\end{align*}
Therefore it follows that, for $a > 1$,
$$ \int_{0}^{2\pi} \frac{e^{ik\theta}}{a + \cos\theta} \, \mathrm{d}\theta = \frac{2\pi \xi^{|k|}}{\sqrt{a^2 - 1}}. $$
