$\int_0^\pi e^{\cos x}\cos(x-\sin x) dx$ I’m not quite sure how to approach this problem using complex analysis. Mainly I’m confused int the contour to use after changing the integral by changing 
$\cos(x-\sin x)$
 to become 
$Re(e^{i(x-\sin x})$, so that the integral became
$$Re\int_0^\pi e^{\cos x}e^{i(x-\sin x)} dx$$
$$Re\int_0^\pi e^{(\cos x-i*\sin x)} e^{ix} dx$$
And then I subbed in 
$z=e^{ix}$
So then
$\frac{dz}{iz}=dx$
$$Re\int_C \frac{1}{iz} dz$$
But I’m not sure what contour to use to solve this

\begin{align}\int_0^\pi \text{e}^{\cos x}\cos(x-\sin x) dx&=\int_0^\pi\text{e}^{\cos x}\cos x\cos(\sin x)dx+\int_0^\pi\text{e}^{\cos x}\sin x\sin(\sin x)dx\\
&=\Big[\sin(\sin x)\text{e}^{\cos x}\Big]_0^\pi+2\int_0^\pi\text{e}^{\cos x}\sin x\sin(\sin x)dx\\
&=2\int_0^\pi\text{e}^{\cos x}\sin x\sin(\sin x)dx\\
&=2\int_0^\pi\cosh(\cos x)\sin x\sin(\sin x)dx+2\int_0^\pi\sinh(\cos x)\sin x\sin(\sin x)dx\\
&=2\int_0^\pi\cosh(\cos x)\sin x\sin(\sin x)dx\\
&=4\int_0^{\frac{\pi}{2}}\cosh(\cos x)\sin x\sin(\sin x)dx\\
&=4\int_0^{\frac{\pi}{2}}\left(\left(\sum_{n=0}^\infty\frac{(-1)^n\sin^{2n+2}x}{(2n+1)!}\right)\left(\sum_{m=0}^\infty\frac{\cos^{2m} x}{(2m)!}\right)\right)\,dx\\
&=4\sum_{n=0}^\infty \left(\sum_{j=0}^n\frac{(-1) ^j}{(2j+1)!(2(n-j))!}\int_0^{\frac{\pi}{2}}\sin^{2j+2}x\cos^{2(n-j)}x\,dx\right)
\end{align}
For $p,q$ integers,
\begin{align}\int_0^{\frac{\pi}{2}}\sin^{2p}x\cos^{2q}x\,dx&=\frac{1}{2}\text{B}\left(p+\frac{1}{2},p+\frac{1}{2}\right)\\
&=\frac{1}{2}\frac{\Gamma\left(p+\frac{1}{2}\right)\Gamma\left(q+\frac{1}{2}\right)}{\Gamma\left(p+q+1\right)}\\
&=\frac{\pi}{2}\times \frac{(2p)!(2q)!}{2^{2(p+q)}(p+q)!p!q!}
\end{align}
Therefore, for $n\geq 0$, integer,
\begin{align}C_n&=\sum_{j=0}^n\frac{(-1) ^j}{(2j+1)!(2(n-j))!}\int_0^{\frac{\pi}{2}}\sin^{2j+2}x\cos^{2(n-j)}x\,dx\\
&=\frac{\pi}{2^{2(n+1)}(n+1)!}\sum_{j=0}^n\frac{(-1)^j}{j!(n-j)!}\\
&=\frac{\pi}{2^{2(n+1)}(n+1)!n!}\sum_{j=0}^n\frac{(-1)^jn!}{j!(n-j)!}\\
&=\frac{\pi}{2^{2(n+1)}(n+1)!n!}\sum_{j=0}^n (-1)^j\binom{n}{j}
\end{align}
Observe that,  $C_0=\dfrac{\pi}{4}$ and, for $n>0$, integer,
\begin{align}C_n&=\frac{\pi}{2^{2(n+1)}(n+1)!n!}(-1+1)^n\\
&=0
\end{align}
Therefore,
\begin{align}\int_0^\pi \text{e}^{\cos x}\cos(x-\sin x) dx&=4\times \frac{\pi}{4}\\
&=\boxed{\pi}
\end{align}
NB:
For $n\geq 0$, integer,
\begin{align}\Gamma\left(n+\frac{1}{2}\right)=\frac{(2n)!}{2^{2n}n!}\sqrt{\pi}\end{align}
For $x$ real,
\begin{align}\cos(\pi-x)=-\cos x\\
\sin(\pi-x)=-\sin x\\
\end{align}
$\text{B}$ is the Euler Beta function.
