integration of a complex function i want to solve this integral  $\displaystyle \int_{-2}^{+2}\sin{ (π|x|/2)e^{-i2πkx}}\,dx$  in order to find the fourier transform of a function 
 g(x)  that is $0$  outside $(-2;2)$;
 i have already tried to solve the integral by  splitting  it in 2 and using the complex definition of sin. i also use the fact that sin is  odd :
$$
  - \int_{-2}^{0}\sin{ (πx/2)e^{-i2πkx}}dx\ + \int_{0}^{2}\sin{ (πx/2)e^{-i2πkx}}dx
$$
then i use 
 $  \sin (z ) = \frac{e^{iz}- e^{-iz}}{2i\ } $
but the process is very long. i would like to know if there is a shorter way to handle this integral. thank you
update : $k$ is a real number
 A: Hint. You may observe that, for any real numbers $a$ and $k$, we have 
$$
\begin{align}
\int_0^2 e^{aix}e^{i2\pi kx} \mathrm dx &=\left.\frac{e^{i(a+2\pi k)x} }{i(a+2\pi k)}\right|_{x=0}^{x=2} \quad (a+2\pi k \neq0)\\\\&=\frac{e^{2i(a+2\pi k)}-1 }{i(a+2\pi k)}\\\\
&=e^{i(a+2\pi k)}\frac{2\sin(a+2\pi k) }{a+2\pi k}\\\\
&=\frac i \pi \frac{4}{4k+1}, \quad (a=\pi/2, \, k \in \Bbb N) \tag1
\end{align}
$$
then, your initial integral may be rewritten as
$$
\begin{align}
&\int_{-2}^2 \sin(\pi |x|/2)e^{i2\pi kx} \mathrm dx\\\\
&=2\int_0^2 \sin(\pi x/2)e^{i2\pi kx} \mathrm dx \\\\&=2\int_0^2 \!\!\sin(\pi x/2)\cos (2\pi k x) \mathrm dx + 2\:i\int_0^2 \!\!\sin(\pi x/2)\sin (2\pi k x) \mathrm dx \\\\
&=\int_0^2 \!\!\sin(\pi x/2+2\pi k x) \mathrm dx + \int_0^2 \!\!\sin(\pi x/2-2\pi k x)\mathrm dx +0 \:i\quad (\text{using}\, (1))\\\\
&=\frac 1 \pi \frac{4}{4k+1} +\frac 1 \pi \frac{4}{-4k+1}\quad (\text{using}\, (1))\\\\
\end{align}
$$ giving
$$
\int_{-2}^2 \sin(\pi |x|/2)e^{i2\pi kx} \mathrm dx=\frac 8 \pi \frac{1}{16k^2-1}, \quad k \in \Bbb N.
$$
A: $$\int\frac{e^{iax}-e^{-iax}}{2i}e^{ibx}dx=-\frac{e^{i(a+b)x}}{2(a+b)}+\frac{e^{i(-a+b)x}}{2(-a+b)}.$$
You are integrating $-f$ from $-L$ to $0$ and $f$ from $0$ to $L$, i.e. $F(L
)+F(-L)-2F(0)$, twice the even part of the primitive minus twice the evaluation at $0$, which is real.
$$I=-\frac{\cos\left(L(a+b)\right)-1}{a+b}+\frac{\cos\left(L(-a+b)\right)-1}{-a+b}.$$
If $k$ is constrained to be an integer, there are further simplifications.
