I'm trying to explicitly evaluate the following integral $$ \int_{-\pi}^{\pi} \frac{\sin\left(e^{ix}\right)}{e^{ix}} dx $$
I checked on WolframAlpha that the value of the integral is $2 \pi$. Using this, I attempted the following.
I analyze the conjugate of the integral and see that $$ \overline{\int_{-\pi}^{\pi} \frac{\sin\left(e^{ix}\right)}{e^{ix}} dx} = \int_{-\pi}^{\pi} \frac{\overline{\sin\left(e^{ix}\right)}}{\overline{e^{ix}}} dx = \int_{-\pi}^{\pi} \frac{\sin\left(e^{-ix}\right)}{e^{-ix}} dx \overset{\color{blue}{u = -x}}{=}\int_{-\pi}^{\pi} \frac{\sin\left(e^{iu}\right)}{e^{iu}} du $$ which confirms to us that the integral is real. From here we can simplify our integral by finding $\Re\left(\frac{\sin\left(e^{ix}\right)}{e^{ix}} \right)$.
To avoid clutter, here I defined $c(t) := \cos(t)$ and $s(t):= \sin(t)$. Keeping this in mind, I get that \begin{align} \Re\left(\sin\left(e^{ix}\right)e^{-ix} \right) &= \Re\left(\sin(c + is) (c -is) \right) = \Re\left(\frac{e^{-s}e^{ic}-e^{s}e^{ic}}{2i} (c -is) \right)\\ &=\Re\left(\frac{1}{2}\left(e^{-s}\left[\underbrace{\color{blue}{c\{c\}}}_{\cos(\cos(t)} + i\underbrace{\color{blue}{s\{c\}}}_{\sin(\cos(t)}\right]- e^{s}\left[c\{c\} -i s\{c\}\right] \right) (-s -ic) \right)\\ &=\frac{1}{2} \left(-e^{-s}c\{c\}s + e^{s}c\{c\}s +e^{-s}s\{c\}c +e^s s\{c\}c \right)\\ &=s \cos(c) \left(\frac{e^s -e^{-s}}{2}\right) + c \sin(c) \left(\frac{e^s +e^{-s}}{2}\right)\\ &=\sin(t) \cos(\cos(t))\sinh(\sin(t)) + \cos(t) \sin(\cos(t))\cosh(\sin(t)) \end{align} And here is where I ran into trouble, because I have no idea how I could integrate that last expression. I tried exploiting symmetry, but the function is even, so I don't think I can do much with it without finding an antiderivative (which sounds very unpleasant).
Does anyone know how I could finish my solution? Or alternatively, does anyone know a simpler way in which I can prove this result? Thank you very much!
Let $z=e^{ix}$. Then the integral becomes
$$\oint_{|z|=1} \frac{\sin(z)}{iz^2}\,dz$$
Can you finish?