$\mu$ test for convergence of improper integral of first kind While going through an Indian text on Analysis I found a test for convergence of improper integral. It was stated without proof. I tried to prove it...then some doubts pop up...
Statement is this:

Let $f(x)$ be bounded and integrable in every closed subinterval of $ (a,\infty)$, where $a >0$. Let $\mu$ be a positive number  such that $\lim_{x \rightarrow \infty} x^{\mu}f(x)$ exists. If $\mu > 1 $, then  $\int_{a}^{\infty} f(x)dx$ converges. If $ \mu \leq 1 $, then $\int_{a}^{\infty} f(x)dx$ diverges.

My proof:
$\lim_{x \rightarrow \infty} x^{\mu}f(x) =L $ then for suitable $\epsilon >0$ we will get $x_{0} $ such that  $(-L+\epsilon)< |x|^{\mu}|f(x)| < (L- \epsilon)$  for  $x>x_{0}$.
This will lead to to $|f(x)| < (L- \epsilon)|x|^{-\mu}$ then using comparison test we will get as $\mu$>1 $\int_{a}^{\infty} f(x)dx$ converges absolutely.
But this proof cannot be used for discussing divergence. Even though we use left inequality  $|x|^{-\mu}(-L+\epsilon)< |f(x)|$ .
There are two problems I felt. One is comparison test is applicable for positive functions.  $|x|^{-\mu}(-L+\epsilon)$ need not be positive. Can we solve this problem  by taking out  $(-L+\epsilon)$ ?
Second problem is this: Even though we got for $\mu \leq 1$ this integral diverge  by comparison test we get $\int_{a}^{\infty} |f(x)|dx$ diverges. It does not lead to the divergence of improper integral as stated by theorem.
 A: When $L \neq 0$, this limit comparison can be use to prove both absolute convergence when $\mu > 1$ and absolute divergence when $\mu \leqslant 1$.
Suppose $\lim_{x \to \infty} x^\mu f(x) = L$. Then for $\epsilon = |L|/2$ there exists $x_0 > 0$ such that when $x \geqslant x_0> 0$ we have
$$| |x^\mu f(x)| - |L|| \leqslant |x^\mu f(x) - L| \leqslant |L|/2.$$
Whence,
$$-|L|/2 \leqslant |x^\mu f(x)| - |L| \leqslant |L|/2\\ \implies |L|/2 \leqslant |x^\mu f(x)| \leqslant 3|L|/2 \\ \implies (|L|/2)x^{-\mu} \leqslant | f(x)| \leqslant (3|L|/2)x^{-\mu} $$
and the integrals of $|f(x)|$ and $x^{-\mu}$ must converge or diverge together.
The limit comparison test is often presented only for the case where $f(x) \geqslant 0$ for all $x > a$.  In that case, if $\lim_{x \to \infty}x^\mu f(x) = L > 0$, then there exists $x_0$ such that when $x \geqslant x_0$ we have
$$0 < \frac{L}{2}x^{-\mu} < f(x) < \frac{3L}{2}x^{-\mu},$$
and $\displaystyle \int_a^\infty f(x) \, dx$ diverges if $\mu \leqslant 1$ (using the left inequality) and converges if if $\mu > 1$ (using the right inequality).
An example of the former case is $f(x) = \sin(1/x)$ - where $f$ is eventually positive.  Since $\lim_{x \to \infty}x \sin(1/x) = 1$, then $\displaystyle \int_1^\infty \sin(1/x) \, dx$ diverges.  
If $L = 0$, then for any $\epsilon > 0$ there exists $x_0$ such that when $x \geqslant x_0$ we have
$$-\epsilon x^{-\mu} < f(x) < \epsilon x^{-\mu},$$
and we can only conclude that $\displaystyle \int_a^\infty f(x) \, dx$ converges if $\mu > 1$ (using the right inequality).  An example is the gamma function
$$\displaystyle \Gamma(s)  = \int_0^\infty x^{s-1}e^{-x} \, dx,$$ 
where proof of convergence is facilitated using the test function $x^{-2}$.  
If $L = 0$, then we cannot conclude divergence if $\mu \leqslant 1$ since the left lower bound is negative and the integral could converge to a positive value.
A: At the end of RRL's answer is the remark

If $L=0$ then we cannot conclude divergence if $\mu\le 1$
   since the left lower bound is negative and the integral could converge to a positive value.

Here are counterexamples that indicate divergence and convergence are both possible for $0<\mu\le 1$, $L=0$.


*

*Divergence - $x^\mu \cdot \frac1{x \log x} \to 0  $ for every $0<\mu\le 1$, and yet
$$ \int_{10}^\infty \frac1{x \log x}\, dx =  \infty. $$

*Convergence - $x^\mu \cdot \frac1{x (\log x)^2} \to 0  $ for every $0<\mu\le 1$, and yet
$$ \int_{10}^\infty \frac1{x (\log x)^2}\, dx  = \frac1{\log 10}< \infty. $$
(Of course, a simpler example is $\int_0^\infty 0\, dx $, but the above example is also divergent if $\mu > 1$, so the convergence is not implied by the positive result.)
While I'm at it I'll also point out that strictly speaking, only the convergence of the Gamma function's defining integral "at infinity" is treated in RRL's answer, but it isn't too hard to deal with the singularity at 0 (if $0<s<1$.)
