Evaluate integral $\int_{0}^{2\pi} e^{-\sin^{2}{x}} \cos(6x - \frac{\sin{2x}}{2}) dx$ I have such an integral:
$$
\int_{0}^{2\pi} e^{-\sin^{2}{x}} \cos\left(6x - \frac{\sin{2x}}{2}\right) dx
$$
I think, it should be solved somehow by partial fraction and with polar coordinates, but I really don't know first steps.
 A: Rewrite the integral as
$$I= \int_{0}^{2\pi} e^{-\sin^{2}{x}} \cos(6x - \frac12{\sin{2x}}) dx
=e^{-\frac12}J_{3}(\frac12)
$$
where $J_n(a)=\int_0^{2\pi}e^{a\cos t}\cos (a\sin t-n t)dt
$.
It is straightforward to establish $J_n’(a)= J_{n-1}(a)  $, and
$$J_{-1}(a)= \int_{0}^{2\pi}e^{a\cos t}\cos(t+a\sin t)dt=\frac1a e^{a\cos t}\sin(a\sin t)\bigg|_{0}^{2\pi} =0$$
Then, $J_{0}(a) = J_0(0)=2\pi$ and
\begin{align}
&J_{1}(a) =\int_0^a J_{0}(s)ds=2\pi a\\
 &J_{2}(a) =\int_0^a J_{1}(s)ds=\pi a^2\\
 &J_{3}(a) =\int_0^a J_{2}(s)ds=\frac{\pi a^3}3\\
\end{align}
As a result
$$I= e^{-\frac12}J_{3}(\frac12)= \frac{\pi}{24} e^{-\frac12}
$$
A: $\newcommand{\d}{\,\mathrm{d}}$I use complex exponentials and contour integration, which makes it rather simple if you're careful.
The integrand is equal to (note the multiplications/divisions by $i$ in the expansion of cosine and sine): $$\exp\left(\frac{\cos(2x)-1}{2}\right)\frac{1}{2}\left[\exp\left(6ix-\frac{e^{2ix}-e^{-2ix}}{4}\right)+\exp\left(-6ix+\frac{e^{2ix}-e^{-2ix}}{4}\right)\right]\\=\frac{1}{2}\exp\left(\frac{e^{2ix}+e^{-2ix}}{4}-\frac{1}{2}+6ix-\frac{e^{2ix}-e^{-2ix}}{4}\right)\\+\frac{1}{2}\exp\left(\frac{e^{2ix}+e^{-2ix}}{4}-\frac{1}{2}-6ix+\frac{e^{2ix}-e^{-2ix}}{4}\right)\\=\frac{1}{2}\exp\left(\frac{1}{2}e^{-2ix}+6ix-\frac{1}{2}\right)+\frac{1}{2}\exp\left(\frac{1}{2}e^{2ix}-6ix-\frac{1}{2}\right)\\=\frac{e^{-1/2}}{2}\left[(e^{ix})^6\exp\left((e^{-ix})^2/2\right)+(e^{ix})^{-6}\exp((e^{ix})^2/2)\right]$$Let's call the desired integral $I$. If we substitute $z=e^{ix}$ and $z=e^{-ix}$ separately in the integral $I$ - to avoid $e^{z^{-2}/2}$, since $e^{1/z}$ has an unpleasant essential singularity - and call the anticlockwise unit circle contour $\gamma$, we have: $$I=-i\cdot e^{-1/2}\oint_\gamma z^{-7}e^{z^2/2}\d z$$Since the double negatives reinforce and the two summands of the integrand are the same under the right choice of $z=e^{\pm ix}$. Let's call the new integrand $f(z)$. Evidently, $f$ is meromorphic with an order-$7$ pole at $z=0$. By the residue theorem: $$I=2\pi\cdot e^{-1/2}\cdot\mathrm{Res}_{z=0}f(z)$$
On $\Bbb C\setminus\{0\}$ we can expand $f$: $$f(z)=z^{-7}\sum_{n=0}^\infty\frac{1}{2^nn!}z^{2n}=\frac{1}{2^33!}z^{-1}+\text{other terms}$$The residue is then $\frac{1}{48}$, and we conclude: $$\int_0^{2\pi}e^{-\sin^2x}\cos\left(6x-\frac{1}{2}\sin2x\right)\d x=\frac{\pi}{24\sqrt{e}}\approx0.0793947$$Which I have actually numerically verified, if you don't believe my working!
