Integrals with complex exponents My text book says that the solution to
$$\int_{-1}^{-1/2} -e^{-i \omega t} dt + \int_{1/2}^{1} e^{-i \omega t} dt$$
is
$$\frac{2}{\omega} ( \sin(\omega)  – \sin (\frac{\omega}{2}))$$
but I can not see how to arrive at that.
What I get when solving the integrals is :
$$\left[\frac{e^{-i \omega t}}{i \omega}\right]_{t=-1}^{-1/2} + \left[\frac{e^{-i \omega t}}{-i \omega}\right]_{t=1/2}^{1}$$
which continues into
$$\frac{e^\frac{i \omega}{2}}{i \omega} 
– \frac{e^{i \omega}}{i \omega} 
+ \frac{e^{-i \omega}}{-i \omega} 
– \frac{e^\frac{-i \omega}{2}}{-i \omega}$$
Reversing the sign of the first two components in this last line would give the correct result using Euler’s identity, but I can not find a justification for that?

Key facts:

*

*${\sin(-x) = -\sin(x)}$ i.e. $\sin$ is an odd function

*$\cos(-x) = \cos(x)$ i.e.  $\cos$ is an even function

*${e^{ix}=\cos(x)+i\times\sin(x)}$
Let ${z=-t}$, then ${\frac{1}{2}<z<1}$ and ${\frac{dt}{dz}=-1}$. Hence we have
$${\int_{-1}^{-1/2} -e^{-i \omega t} dt = \int_{1/2}^{1} e^{i \omega z} dz}$$
The integral can then be re-written as:
$${\int_{-1}^{-1/2} -e^{-i \omega t} dt + \int_{1/2}^{1} e^{-i \omega t} dt =\int_{1/2}^{1} e^{i \omega t} + e^{-i \omega t} dt}$$
By key fact 3 this can be:$${=\int_{1/2}^{1} \cos(wt)+i\times \sin(wt) + \cos(-wt) + i \times \sin(-wt) dt}$$
By key facts 1 and 2 this can be:
$${=\int_{1/2}^{1} \cos(wt)+i\times \sin(wt) + \cos(wt) - i\times\sin(wt) dt}$$
$${=\int_{1/2}^{1} \cos(wt) + \cos(wt) dt}$$
$${=\int_{1/2}^{1} 2\times \cos(wt)dt}$$
Can you solve from here? (Hint use another change of variable ${z=\omega t}$ and integrate on ${z}$).
