2023 MIT Integration Bee Semifinals #1 Problem 1 $\int e^{\cos x}\cos(2x+\sin x)dx$ How do I solve $$\int e^{\cos x}\cos(2x+\sin x)dx$$? This is a problem from the 2023 MIT Integration Bee semifinals. I thought that this integral would be solved by $u=e^{\cos x}$ but that doesn't work since we have $\cos(2x+\sin x)$ and not $\sin x$ next to $e^{\cos x}$. Other than that I am a bit lost.
Edit: Integral Calculator couldn't find the solution.
 A: $\textbf{Hint}$:
$$2x + \sin x = x + (x+\sin x)$$
Which we can use to rewrite the integrand by trig identity:
$$e^{\cos x} \left(-\sin x \sin (x+ \sin x) + \cos x \cos(x + \sin x)\right)$$
where we would almost have product rule $(fg)'$ with $f =\exp(\cos x)$ and $g= \sin(x +\sin x)$. But the derivative of $g$ is actually
$$(\sin(x + \sin x))' = \cos(x+\sin x)\cdot(1+\cos x)$$
can you see a way to proceed from here and correct for the missing term?
A: Expressing the integral in terms of complex numbers as
$$
\begin{aligned}
I & =\operatorname{Re} \int e^{\cos x} e^{(2 x+\sin x) i} d x \\
& =\operatorname{Re} \int e^{\cos x+i \sin x} \cdot e^{2 x i} d x \\
&=  \operatorname{Re} \int e^{e^{x i}} e^{2 x i} d x\\&  \stackrel{y=xi}{=} \operatorname{Re} \left(
\underbrace{\frac{1}{i}   \int e^{e^y} e^{2 y} d y}_{J} \right)
\end{aligned}
$$
Via integration by parts on $J$, we have
$$
\begin{aligned}
J & =\frac{1}{i} \int e^y d\left(e^{e^y}\right) \\
& =-i\left(e^y e^{e^y}-\int e^y e^{e^y} d y\right) \\
& =-i e^{e^y}\left(e^y-1\right)  \\
& =-i e^{e^{x i}}\left(e^{x i}-1\right)
\end{aligned}
$$
Expressing in terms of sine and cosine yields $$
\begin{aligned}
J & =-i e^{e^{x i}}(\cos x+i \sin x-1) \\
& =-i e^{\cos x+i \sin x}\left(2 i \sin \frac{x}{2} \cos \frac{x}{2}-2 \sin ^2 \frac{x}{2}\right) \\
& =2 \sin \frac{x}{2} e^{\cos x} e^{i \sin x}\left(\cos \frac{x}{2}+i \sin \frac{x}{2}\right) \\
& =2 \sin \frac{x}{2} e^{\cos x} e^{i \sin x} e^{\frac{i x}{2}} \\
& =2 \sin \frac{x}{2} e^{\cos x} e^{i\left(\frac{x}{2}+\sin x\right)}
\end{aligned}
$$
Plugging back gives the real part as the answer below:
$$
\boxed{I=2 \sin \frac{x}{2} e^{\cos x} \cos \left(\frac{x}{2}+\sin x\right)}
$$
which is surprisingly beautiful! Isn’t it?
