Is this correct?
$$\int_{0}^{2\pi}dx\sin x e^{\cos^2 x}$$
Let $u=\cos x$, thus $du=-\sin x dx$. My doubt is now. When $x\rightarrow0$, $u\rightarrow1$ and when $x\rightarrow2\pi$, $u\rightarrow 1$. So, $$\int_{0}^{2\pi}dx\sin x e^{\cos^2 x}=\int_{1}^{1}dx()=0?$$
$$\int\mathrm{e}^{\cos^2{x}}\sin x\,\mathrm dx\tag{1}$$ Substitute $u = \cos x$, $\mathrm du = -\sin x\,\mathrm dx$ in $(1)$. $$\int\mathrm{e}^{\cos^2{x}}\sin x\,\mathrm dx = -\int \mathrm e^{u^2}\,\mathrm du = -\dfrac{\sqrt{\pi}}{2}\int \dfrac 2{\sqrt{\pi}}\mathrm e^{u^2}\,\mathrm du = -\dfrac{\sqrt{\pi}}{2}\operatorname{erf}(u)$$ Reverse substitution. $$\int\mathrm{e}^{\cos^2{x}}\sin x\,\mathrm dx = -\dfrac{\sqrt{\pi}}{2}\operatorname{erf}(\cos x)$$ Plug in the limits. $$-\dfrac{\sqrt{\pi}}{2}\operatorname{erf}(\cos x)\Bigg|_0^{2\pi} = -\dfrac{\sqrt{\pi}}{2}\left(\operatorname{erf(1)} - \operatorname{erf}(1)\right) = 0$$