Do improper integrals like $\int_{-\infty}^{+\infty} f$ converge if $xf(x)\rightarrow 0$? My teacher assumes without proof in his notes that, given a rational function $R(x)$, the improper integral $\int_{-\infty}^{+\infty} R(x)dx$ converges if $\lim_{|x|\rightarrow\infty} xR(x) = 0$. He then proceeds to explain the Estimation lemma, that is a very similar result.
However it is unclear for me whether this fact is true, and if it is bidirectional (i.e. if $\int_{-\infty}^{+\infty} R(x)dx$ converges then $\lim_{|x|\rightarrow\infty} xR(x) = 0$) and holds true even for non-rational functions
 A: One cannot extend the result to general functions. For example, let $f(x)=\frac{1}{|x|\log(|x|)}$ if $|x|\ge 2$, and let $f(x)=f(2)$ for $-2 \lt x\lt 2$.  
Then $\lim_{x\to\infty} xf(x)=\lim_{x\to -\infty} xf(x)=0$, but the improper integral does not converge.
The result does hold, bidirectionally, for rational functions whose denominator vanishes nowhere. It is essentially obvious, though writing out the proof is typographically unpleasant. For a rational function $R(x)=\frac{P(x)}{Q(x)}$, where $P$ and $Q$ are polynomials with $Q(x)$ nowhere $0$ (and $P$ not identically $0$), there is convergence iff $\deg(Q)\ge 2+\deg(P)$. This is precisely the condition for $\lim_{|x|\to \infty} xR(x)$ to be $0$.  The reason is basically that degrees can only take on integer values.
A: Consider $\displaystyle \int_{-\infty}^{\infty} \frac{P(x)}{Q(x)} dx $ where $P,Q$ are polynomials and $x$ is a real variable. This converges absolutely if $\deg(P) \leq \deg(Q) -2.$ To evaluate this family of integrals, we consider $\displaystyle \int_C \frac{P(z)}{Q(z)} dz$ where $C$ is the standard semi-circular contour in the upper half plane with radius $R.$ The Estimation Lemma yields that the contribution from the arc is $\mathcal{O}(1/R)$ as $R\to\infty.$ 
Hence $$\int^{\infty}_{-\infty} \frac{P(x)}{Q(x)} dx = 2\pi i \sum \text{ Residues of P/Q in the upper half plane }.$$
When $\deg(P)=\deg(Q)-1$ this same calculation holds true, but now the calculated value does not represent $\displaystyle \int^{\infty}_{-\infty} \frac{P(x)}{Q(x)} dx$ ; that integral does not exist because we get different values if the upper and lower limits tend to infinity in different ways. What does exist (and we calculated) is the Cauchy Principle Value: $$\text{ C.P.V } \int^{\infty}_{-\infty} \frac{P(x)}{Q(x)} dx = \lim_{R\to \infty} \int^R_R \frac{P(x)}{Q(x)} dx.$$
If $Q$ has a simple zero at $x_0 \in \mathbb{R}$ our calculation still returns a value we can make sense of, another Cauchy principle value: $$\text{ C.P.V} \int^b_a \frac{P(x)}{Q(x)} dx = \lim_{\epsilon\to 0} \int^{x_0+\epsilon}_a\frac{P(x)}{Q(x)} dx + \int^b_{x_0-\epsilon}\frac{P(x)}{Q(x)} dx.$$
