Let \(f=P/Q\) be rational with no real poles. Which condition guarantees that the integral over the semicircle \(C_R\) tends to \(0\) as \(R\to\infty\)?
If \(\deg Q\ge\deg P+2\), then \(|f(z)|\le M/R^2\) on \(C_R\) and the integral is bounded by \(M\pi R/R^2\to0\). With difference \(1\) one only gets \(|f|\sim 1/R\) and the bound does not vanish.
A method to compute \(\int_{-\infty}^{\infty} f(x)\,dx\) with \(f\) rational: close the real axis with a semicircle in the upper half-plane and apply the residue theorem.