TITLE: What is the sign of the integral $\int_{0}^{2\pi}e^{\sin(x)}\cos(nx)\,dx$?
QUESTION [10 upvotes]: 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.

REPLY [2 votes]: 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.