Find value of $I=\int_{0}^{2\pi} e^{\cos x} \cos (\sin x)\:dx$
I have done it as follows:
we know that $$\int_{0}^{2a}f(x) dx=2 \int_{0}^{a} f(x)dx$$ if $f(2a-x)=f(x)$
Now if $f(x)=e^{\cos x} \cos (\sin x)$, we have
$$f(2\pi-x)=f(x)$$
hence $$I=2\int_{0}^{\pi} e^{\cos x} \cos (\sin x)\:dx=2 \times Re\left\{\int_{0}^{\pi} e^{e^{ix}}dx\right\}$$
Now let
$$J=\int_{0}^{\pi} e^{e^{ix}}dx$$
Put $e^{ix}=t$, Then limits will switch over to $-1$ and $1$ Also $$e^{ix} i dx=dt$$
so
$$dx=\frac{dt}{it}$$
So
$$J=i \times \int_{-1}^{1}\frac{e^t \:dt}{t}$$
So $J$ is Purely imaginary and hence $I=0$
Can i know what went wrong in my solution?
Let $t(x)=e^{ix}$ for $x \in I:=[0, \pi]$.
You have assumed that $t(I)=[-1,1]$, but this is wrong.
We have $t(I)=\{z \in \mathbb C: |z|=1, Im(z) \ge 0\}$ (a "half circle").