TITLE: Definite integral involving trigonometric functions
QUESTION [7 upvotes]: Is it possible to find a closed form solution to the integral, where $a\in \mathbb R$.
$$I_n = \int_0^\pi \frac{\sin(2 n x) \sin(x)}{\cos(x) + a} \, \mathrm{d}x, \quad n = 1, 2, 3,\ldots,\infty$$
Mathematica version 9 was unable to do it but I am hoping it is possible.
If not, what approximate methods are best suited to this type of integral?

REPLY [4 votes]: Using $z=e^{ix}$, we get
$$
\begin{align}
\int_0^\pi\frac{\sin(nx)\sin(x)}{\cos(x)+a}\,\mathrm{d}x
&=\frac12\int_0^{2\pi}\frac{\sin(nx)\sin(x)}{\cos(x)+a}\,\mathrm{d}x\\
&=-\frac12\mathrm{Im}\left(\oint z^n\frac{z-\frac1z}{z+\frac1z+2a}\frac{\mathrm{d}z}{z}\right)\\
&=-\frac12\mathrm{Im}\left(\oint z^{n-1}\frac{z^2-1}{z^2+2az+1}\,\mathrm{d}z\right)\\
\end{align}
$$
The integral diverges for $|a|\lt1$, so assume that $a\gt1$, while noting that the integral is odd in $a$.
The singularity inside the unit circle of the integrand above is at $z=-a+\sqrt{a^2-1}$.
Using residues, we get the integral to be
$$
-\pi\left(-a+\sqrt{a^2-1}\right)^n=\frac{(-1)^{n+1}\pi}{\left(a+\sqrt{a^2-1}\right)^n}
$$
If we substitute $n\mapsto2n$, we get the same answer as Raymond Manzoni.
As Raymond Manzoni comments, since $\sin(nx)\sin(x)$ vanishes to order $2$ when $\cos(x)+1$ vanishes, it is not hard to show uniform convergence as $a\to1^+$ and this allows us to plug $a=1$ into the formula, giving $(-1)^{n+1}\pi$ for $a=1$.