Fourier integral of a rational function with simple nonreal poles (source code)

= Fourier integral of a rational function with simple nonreal poles
{title2=$\int_{\mathbb R}\frac{p(x)}{q(x)}e^{ix}\,dx=2\pi i\sum_{\operatorname{Im}\alpha>0}\frac{p(\alpha)e^{i\alpha}}{q'(\alpha)}$}

For monic $q$ with distinct nonreal zeros and $\deg p\leq\deg q-1$, close the contour in the upper half-plane. The rational factor is $O(R^{-1})$ on the large semicircle, whose exponential damping makes the arc integral $O(R^{-1})$. The two one-sided real integrals also converge by <integration by parts>, since the rational factor tends to zero and its derivative is $O(x^{-2})$. Thus the displayed formula is an ordinary improper integral, not merely a principal value.