Transform complex exponential integral to real Question: Transform
$J_n (x)=\frac{1}{2 \pi} \int_{\theta=-\pi}^\pi e^{i(n\theta-x\sin\theta)}$
On answer sheet:
$J_n (x)=\frac{1}{\pi} \int_{\theta=0}^\pi \cos(n\theta-x\sin\theta)$
But how? I am not very good at complex analysis, thanks for any help!

$$e^{i(n\theta-x\sin{\theta})} = \cos(n\theta-x\sin{\theta}) +i \sin(n\theta-x\sin{\theta})$$
Let,
$$f(\theta) = \cos(n\theta-x\sin{\theta}) +i \sin(n\theta-x\sin{\theta})$$
Therefore,
$$f(-\theta) = \cos(-n\theta+x\sin{\theta}) +i \sin(-n\theta+x\sin{\theta})$$
$$\implies f(-\theta) = \cos(n\theta-x\sin{\theta}) -i \sin(n\theta-x\sin{\theta})$$
Let,
$$f(\theta) = a(\theta) + ib(\theta)$$
Therefore,
$$f(-\theta) = a(\theta) - ib(\theta)$$
Hence we can say that $a(\theta)$ is an even function as $a(\theta) = a(-\theta)$ and $b(\theta)$ is an odd function since $b(-\theta) = -b(\theta)$
Hence integral of an odd function over a symmetric domain is zero whereas for an even function we can thus write,
$$J_n(\theta) = 2(\frac{1}{2\pi}\int_0^{\pi}\cos(n\theta-x\sin{\theta}) d\theta)$$
$$\therefore J_n(\theta) = \frac{1}{\pi}\int_0^{\pi}\cos(n\theta-x\sin{\theta}) d\theta$$
