TITLE: $\int_0^{2\pi}e^{a \cos{\theta}}\cos({\sin{\theta}})\,d\theta$ using residues
QUESTION [6 upvotes]: How do I find the following integral by converting it into a complex integral and then using residue theorem?

$$\int_0^{2\pi}e^{a \cos{\theta}}\cos({\sin{\theta}})\,d\theta$$

My approach is as follows. Substitute $z=e^{i\theta}$ so that $\cos{\theta}=\frac{z+z^{-1}}{2}$, and similarly for sine. For the cos outside the exponent, use this substitution again. But it is just giving me a string of exponents, which i don't know how to integrate. Should I use integration by parts? Any ideas?

REPLY [8 votes]: The integral is the real part of
$$\int_0^{2 \pi} d\theta\: e^{a (cos{\theta} + i \sin{\theta})}$$
which, when you set $z=e^{i \theta}$, $d\theta = -i dz/z$, you get
$$-i \oint_{|z|=1} dz \, \frac{e^{a z}}{z} $$
which, by the residue theorem is $-i (i 2 \pi) = 2 \pi$.  Therefore, the value of the original integral is $2 \pi$.
ADDENDUM
In the case that the integral is actually
$$\int_0^{2 \pi} d\theta \, e^{a \cos{\theta}} \cos{(\sin{\theta})}$$
which is the real part of
$$\int_0^{2 \pi} d\theta \, e^{a \cos{\theta}} e^{i \sin{\theta}}$$
To write as a complex integral, make the same substitution as above and, after a little manipulation, get
$$-i \oint_{|z|=1} \frac{dz}{z} \exp{\left [\frac12 (a+1) z + \frac12 (a-1) z^{-1} \right ]}$$
There is an essential singularity at $z=0$; the way to find the residue there is to expand the exponential into a Taylor/Laurent series and find the coefficient of $z^0$ (because there is a factor of $z^{-1}$ inside the integral already:
$$-i \oint_{|z|=1} \frac{dz}{z} \sum_{k=0}^{\infty} \frac{1}{2^k \, k!} \left [ (a+1) z + (a-1) z^{-1} \right ]^k $$
Using the binomial theorem, we write the sum as
$$\sum_{k=0}^{\infty} \frac{1}{2^k \, k!} \sum_{m=0}^k \binom{k}{m} (a+1)^m (a-1)^{k-m} z^{2 m-k} $$
We get the coefficient of $z^0$ in the sum, for each $k$, when $m=k/2$.  This only works for even values of $k$.  The result is that the coefficient of $z^0$ is, when $|a|>1$:
$$\sum_{k=0}^{\infty} \frac{\left (a^2-1\right )^k}{2^{2 k} (k!)^2}   = I_0 \left(\sqrt{a^2-1}\right)$$
The integral is the real part of, by the residue theorem, $i 2 \pi$ times the residue of the essential singularity at $z=0$.  Therefore
$$\int_0^{2 \pi} d\theta \, e^{a \cos{\theta}} \cos{(\sin{\theta})} = 2 \pi I_0 \left(\sqrt{a^2-1}\right)$$
where $I_0$ is the modified Bessel function of the first kind of order zero.  Note that when $|a|<1$, the integral is equal to $2 \pi J_0\left(\sqrt{1-a^2}\right)$, where $J_0$ is the Bessel function of the first kind of order zero.