How do I solve the following integral? $$ I = \int_0^{\pi} e^{-\frac{1}{2}\cos x} \cos \left( 3x + \frac{1}{2} \sin x \right) dx $$
I suppose this can be solved with integrating by parts and building the equation for $I$ but cannot find the right way to do this
I shall give you the result obtained after a lot of simplifications of the result provided by a CAS. $$J = \int e^{-\frac{1}{2}\cos (x)} \cos \left( 3x + \frac{1}{2} \sin (x) \right)\, dx$$ $$J=\color{red}{\frac{i}{96} \left(\text{Ei}\left(-\frac{e^{i x}}{2} \right)-\text{Ei}\left(-\frac{e^{-i x}}{2}\right)\right)}+$$ $$\color{blue}{\frac{1}{24} \left(\sin \left(x+\frac{\sin (x)}{2}\right)-2 \sin \left(2x+\frac{\sin (x)}{2} \right)+8 \sin \left(3x+\frac{\sin (x)}{2} \right)\right) \times }$$ $$\color{blue}{\left(\cosh \left(\frac{\cos (x)}{2}\right)-\sinh \left(\frac{\cos (x)}{2}\right)\right)}$$ Integrated between $0$ and $\pi$, the $\color{blue}{\text{blue term}}$ is obviously zero (because of the sines) and what is left is to evaluate the $\color{red}{\text{red term}}$. So, for the definite integral, we are left with $$I =\color{green}{ \int_0^{\pi} e^{-\frac{1}{2}\cos (x)} \cos \left( 3x + \frac{1}{2} \sin (x) \right) dx=-\frac \pi{48} }$$
This has been check by numerical integration.