What is the sign of the integral $\int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx$? Let $I_n = \int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx$ for a natural $n$.
I would like to prove that for $n$ odd this integral vanishes, while for $n = 4k$ for some natural $k$, the integral is always positive and for $n = 4k+2$ it is always negative.
I was able to do a few integrations by parts, and provided I didn't make mistakes, the result was the following rather ugly recurrence relation, valid for $n > 1$: $$I_{n+2} = -\frac1{n-1}\left[(4n^3-2n)I_n+(n+1)I_{n-2}\right].$$ Also we have $I_1 = I_3 = 0$ (the first is obvious from the integral, the second follows by integration by parts). And from here, clearly it is immediate to see that it vanishes for every $n$ odd, just by induction. However I'm not able to see why $I_{4k}$ is always positive or $I_{4k+2}$ is always negative from this relation. What I know is that $|I_n| \le I_0 \approxeq 7.95$.
I also tried to rewrite the integral using $e^x = 1 + x + \ldots$, moving the integral inside the summation, but still I couldn't come up with a solution. What do you suggest?
Note: this integral comes from the calculation of the Fourier coefficients of $e^{\sin(x)}$, and analogous properties hold for the coefficients of the sine terms. Also by a well-known theorem (Riemann-Lebesgue), $I_n$ goes to zero as $n\to\infty$, and hence it's not possible to find a fixed constant lower bound for $|I_n|$, making any estimation in the recurrence relation more difficult.
 A: Using the results listed here we can show that $I_n=2\pi i^n{\cal I}_n(1)$ where ${\cal I}_n$ is the modified Bessel function of the first kind.

Here we will perform the derivation from scratch. Applying the unit circle transformation we have \begin{align}I_n&=\Re\int_0^{2\pi}e^{\sin x}e^{inx}\,dx=\Re\oint_{|z|=1}z^n\exp\left(\frac{z-1/z}{2i}\right)\,\frac{dz}{iz}\end{align} which we can expand as \begin{align}I_n&=\Re\oint_{|z|=1}\sum_{r=0}^\infty\left(\frac i2\right)^r\frac{z^{n-r-1}(1-z^2)^r}{i\cdot r!}\,dz=\Re\left[2\pi\operatorname{Res}(f,0)\right]\end{align} where $$f(z)=\sum_{r=0}^\infty\left(\frac i2\right)^r\frac{z^{n-r-1}(1-z^2)^r}{r!}.$$ To evaluate this residue we seek the term independent of $z$ in $zf(z)$. This occurs when the power of $1-z^2$ is $(r-n)/2$ which means that $r=2s$ is even. Hence \begin{align}\operatorname{Res}(f,0)&=\sum_{s=n/2}^\infty\left(\frac i2\right)^{2m}\frac{(-1)^{(2s-n)/2}}{(2s)!}\binom{2s}{(2s-n)/2}\\&=\sum_{s=n/2}^\infty\frac{(-1)^s}{2^{2s}}\frac{(-1)^{s-n/2}}{(s-n/2)!(s+n/2)!}.\end{align} Substituting back into the integral gives  $$I_n=\sum_{s=n/2}^\infty\frac{(-1)^{n/2}\pi}{2^{2s-1}(s-n/2)!(s+n/2)!}=\sum_{t=0}^\infty\frac{(-1)^{n/2}\pi}{2^{2t+n-1}t!(t+n)!}=2\pi i^n{\cal I}_n(1)$$ and we can immediately conclude that $I_{4k}>0$ and $I_{4k+2}<0$.
A: If you just want to find the sign of the integral, you can do it directly as follows:
the substitution $x \to -x$ shows that
$\int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx=\int_{0}^{2\pi}e^{-\sin(x)}\cos(nx)\,dx$ but now for odd $n$ the substitution $x \to x+\pi$ sends $\int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx$ to $-\int_{0}^{2\pi}e^{-\sin(x)}\cos(nx)\,dx$ hence the integral is zero.
Using the well known (and easy to prove fact) that $\cos^q x=\sum c_{k,q}\cos kx, c_{kq} \ge 0, c_{q,q}>0$ it immediately follows that $\int_{0}^{2\pi}e^{\cos(x)}\cos(nx)\,dx >0$
(edited later - this follows by an easy induction since $2\cos a \cos b=\cos(a+b)+\cos(a-b)$ hence the coefficients stay non-negative if they start so; we have $\cos^2x=(\cos 2x+1)/2$ and then $\cos^3x=\cos x (\cos 2x+1)/2=...$ and all the terms remain non-negative when expanded, while the highest order term in $\cos^q x$ is clearly $\cos qx$ with coefficient $1/2^{q-1}$ since that appears only once in the inductive computation with half the previous highest term coefficient; then using that $e^{\cos x}=\sum \frac{\cos^qx}{q!}$ with uniform convergence in $[0, 2\pi]$ we can integrate term by term and all the coefficients of $\cos nx$ that appear in the expansions are non-negative while at least the one from $\cos^n x$ is positive, so the integral is positive by orthognality of the cosines)
But the substitution $x \to \pi/2-x$ sends $\int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx$ into $(-1)^{n/2}\int_{0}^{2\pi}e^{\cos(x)}\cos(nx)\,dx$ for even $n$ hence the required sign result follows.
