How to evaluate the integral $\int_0^{2\pi}\mathrm{d}\theta e^{ia\cos(\theta-\theta_1)}\cos^2(\theta-\theta_2)$ I have an integral:
$$
\int_{0}^{2\pi}
\mathrm{e}^{\mathrm{i}a\cos\left(\theta - \theta_{1}\,\right)}
\,\,\,\cos^{2}\left(\theta - \theta_{2}\right)\,
\mathrm{d}\theta,
$$
where $a, \theta_1$ and $\theta_2$ are reals. Any idea on how to evaluate this integral.
 A: Let $\theta \mapsto \theta + \theta_1$, so that the integral becomes
$$\frac12 \int_0^{2 \pi} d\theta \, e^{i a \cos{\theta}} \, \left [ 1+\cos{(2 (\theta+\theta_1-\theta_2))} \right ]$$
The first term produces
$$\frac12 \int_0^{2 \pi} d\theta \, e^{i a \cos{\theta}} $$
Let $z=e^{i \theta}$; then the integral is
$$-\frac{i}{2} \oint_{|z|=1} \frac{dz}{z} e^{i (a/2) \left ( z+z^{-1} \right )} $$
To deal with the essential singularity in the exponential, we form the Laurent series of the integrand:
$$-\frac{i}{2} \sum_{n=0}^{\infty} \frac{i^n}{n!} \oint_{|z|=1} \frac{dz}{z} \left ( \frac{a}{2} \right )^{n} \left ( z+\frac1z \right )^n $$
The only nonzero terms will be the constant term of the expansion of the binomial terms, and those only appear in the even terms.  Thus, the integral is
$$-\frac{i}{2} i 2 \pi \sum_{n=0}^{\infty} \frac{(-1)^n}{(2 n)!} \binom{2 n}{n} \left ( \frac{a}{2} \right )^{2 n} = \pi \sum_{n=0}^{\infty} \frac{(-1)^n}{(n!)^2} \left ( \frac{a}{2} \right )^{2 n}  = \pi \, J_0(a)$$
The next term may be split up as $\cos{(2 (\theta+\theta_1-\theta_2))} = \cos{2 \theta} \cos{2 (\theta_1-\theta_2)} - \sin{2 \theta} \sin{2 (\theta_1-\theta_2)} $.
$$\begin{align} \frac12 \int_0^{2 \pi} d\theta \, e^{i a \cos{\theta}} \cos{2 \theta} &= -\frac{i}{4} \oint_{|z|=1} \frac{dz}{z} e^{i (a/2) \left ( z+z^{-1} \right )} \left (z^2+\frac1{z^2} \right )\\ &= -\frac{i}{4} \sum_{n=0}^{\infty} \frac{i^n}{n!} \oint_{|z|=1} \frac{dz}{z} \left ( \frac{a}{2} \right )^{n} \left ( z+\frac1z \right )^{n} \left (z^2+\frac1{z^2} \right )  \\ &= -\frac{i}{4} i 2 \pi \sum_{n=0}^{\infty} \frac{(-1)^n}{(2 n)!} \left [ \binom{2 n}{n-1} + \binom{2 n}{ n+1}\right ]\left ( \frac{a}{2} \right )^{2 n} \\ &= \pi \sum_{n=0}^{\infty} \frac{(-1)^n}{(n-1)! (n+1)!} \left ( \frac{a}{2} \right )^{2 n} \\ &= -\pi \left ( \frac{a}{2} \right )^{2} \sum_{n=0}^{\infty} \frac{(-1)^n}{n! (n+2)!} \left ( \frac{a}{2} \right )^{2 n} \\ &= -\pi J_2(a)\end{align}$$
Note that the integral involving $\sin{2 \theta}$ has, upon expansion of the exponential, terms such as $\binom{2 n}{n-1} - \binom{2 n}{ n+1}$, which are all zero.  Thus,

$$\int_0^{2 \pi} d\theta \, e^{i a \cos{(\theta-\theta_1)}} \, \cos^2{(\theta-\theta_2)} = \pi J_0(a) - \pi J_2(a) \cos{2 (\theta_1-\theta_2)} $$

