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?
 A: 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}$).
A: I think I’ve got it. Starting from the very helpful
$${\int_{-1}^{-1/2} -e^{-i \omega t} dt = \int_{1/2}^{1} e^{i \omega z} dz}$$
we get
$$\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} dt + \int_{1/2}^{1} e^{-i \omega t} dt
\\=
\left[\frac{e^{i \omega t}}{i \omega}\right]_{t=1/2}^{1} + \left[\frac{e^{-i \omega t}}{-i \omega}\right]_{t=1/2}^{1}
\\=
\frac{e^{i \omega}}{i \omega} 
-\frac{e^\frac{i \omega}{2}}{i \omega} 
+ \frac{e^{-i \omega}}{-i \omega} 
– \frac{e^\frac{-i \omega}{2}}{-i \omega}
\\(and \ remembering \ sin(\omega) = \frac{e^{i \omega} – e^{-i \omega}}{2i})
\\=\frac{2}{\omega} ( sin(\omega)  – sin (\frac{\omega}{2}))
$$
Now, this still leaves the original question : how can
$$\int_{-1}^{-1/2} -e^{-i \omega t} dt + \int_{1/2}^{1} e^{-i \omega t} dt
\\=\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}
\\=
\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}
\\=\frac{2}{\omega} ( sin(\omega)  – sin (\frac{\omega}{2}))
\\?$$
In fact, because of the negative sign of the first integrand, I think we have to look at it as designating a “negative area” in the surface described by the two integrals. So its sign can be reversed, and we arrive back at
$$-\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}$$
Not very intuitive, and I now understand why the text book evades this by (what seemed to me) taking the detour
$$\int_{-1}^{-1/2} -e^{-i \omega t} dt + \int_{1/2}^{1} e^{-i \omega t} dt
=\int_{1/2}^{1} 2\times \cos(wt)dt$$
Thank you for all your thoughts and help!
