how to integrate $\frac{-1+e^{-i k x}}{x^2}$ How do I integrate the following?$$\int_{-\infty }^{\infty } \frac{-1+e^{-i k x}}{x^2} \, dx$$
I am not very familiar with complex analysis, but I did try to use contour integral to do this but I couldn't get any success with that. 

Another way to do it if you want to use contour integration is to use an indented semi circle in the upper half plane going around the singularity at $z=0$. For this contour, the function $f(z)=(e^{-ikz}-1)/z^2$ will integrate to 0 by Cauchy's theorem since it is holomorphic in the region enclosed by the indented semi circle. Now you simply split $\int_\gamma=\int_{C_R}+\int_{C_\epsilon}+\int_{-R}^{-\epsilon}+\int_{\epsilon}^{R}$ and you're left with justifying the exchange of limit and integrals when you want to let $\epsilon$ (radius of small semi circle) go to $0$ and R go to $\infty$ (radius of larger semi-circle).
Here are some examples : https://web.williams.edu/Mathematics/sjmiller/public_html/302/coursenotes/Trapper_MethodsContourIntegrals.pdf
There are also nice people explaining it in full detail on youtube, have fun !
