On $\int_0^{2\pi}e^{\cos2x}\cos(\sin2x)\ \mathrm{d}x=2\pi$

You cannot substitute $u=\sin^2t$. As $t$ ranges from $0$ to $2\pi$, this is not a one-to-one relationship.

It's like if you subbed $u=x^2$ in $$\int_{-1}^1x^2\,dx$$ You would get an integral from $u=1$ to $u=1$, which would be $0$ even though the integral is clearly nonzero.


To solve the integral, you may consider $$\int_{C} \frac{e^z}{z}dz$$ where $C$ is a unit circle, and see its real part.


If you want a full solution of the integral using complex analysis, going along the lines of what Seewoo Lee recommend, you can solve the integral as follows:

First consider the integral $$\int_{C} \frac{e^z}{z}dz$$

where $C$ is the unit circle oriented counter-clockwise in the complex plane. Using the Cauchy Integral formula (from complex analysis) you can find that $$\int_{C} \frac{e^z}{z}dz = 2\pi i \phantom{------}(1)$$

Now we will directly integrate the above integral by parametrising $C$. Let $z(t)=e^{2it}$ with $0 \le t \le \pi$ be the parametrisation of $C$. Then the integral works out as:

\begin{align} \int_{C} \frac{e^z}{z}dz &= \int_0^{\pi} \frac{e^{e^{2it}}}{e^{2it}} 2ie^{2it} dt \\ &= 2i \int_0^{\pi} {e^{\cos(2t)+i\sin(2t)}}dt \\ &= 2i \int_0^{\pi} {e^{\cos(2t)}e^{i\sin(2t)}}dt \\ &= 2i \int_0^{\pi} {e^{\cos(2t)}(\cos(\sin(2t))+i\sin(\sin(2t))} dt \\ &= 2i \int_0^{\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt - 2 \int_0^{\pi} {e^{\cos(2t)}}(sin(sin(2t)) dt \phantom{-------} (2) \\ \end{align}

Equating imaginary parts of (1) and (2) we see that:

$$\int_0^{\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt = \pi$$

If we parametrise the curve initially with $\pi \le t \le 2\pi$ we would have ended up with:

$$\int_{\pi}^{2\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt = \pi$$

Thus,

\begin{align} \int_{0}^{2\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt &= \int_{0}^{\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt + \int_{\pi}^{2\pi} {e^{\cos(2t)}}(\cos(\sin(2t))dt \\ &= \pi + \pi = 2\pi \end{align}