Solution (source code)

= Solution

Close the contour in the upper half-plane. The degree assumption and <Jordan lemma> make the integral over the large semicircle tend to zero, while the absence of real zeros avoids indentations of the contour. The <residue theorem> therefore gives
$$
\boxed{
\int_{-\infty}^{\infty}R(x)e^{ix}\,dx
=2\pi i\sum_{\substack{Q(z_k)=0\\ \operatorname{Im}z_k>0}}
\operatorname{Res}_{z=z_k}\bigl(R(z)e^{iz}\bigr)}.
$$
Repeated roots are handled by the usual higher-order <residue> formula.