Divergence of improper integral if $f$ has limit $l>0$ Lets suppose that $f:[a,\infty) \to \mathbb{R}$ is a Riemann integrable function and lets suppose that
$$\lim_{x \to \infty} f(x) = l > 0$$
I am trying to prove that then
$$\int_a^\infty f(x) \text{d}x=\infty$$
By hypothesis $f$ has limit $l > 0$ as $x \to \infty$, so we know that for all $\varepsilon>0$ exists $K_{\varepsilon} > 0$ such that for all $x \geq K_{\varepsilon}$ it is $f(x)>l-\varepsilon$.
Since by hypothesis $l > 0$ and for the arbitrarity of $\varepsilon>0$ we can choose $\varepsilon=l/2$; so we have the estime $f(x)>l/2$.
So it is
$$\int_a^\infty f(x) \text{d}x =\int_a^{K_\varepsilon} f(x) \text{d}x+\int_{K_\varepsilon}^\infty f(x) \text{d}x > \int_a^\infty \frac{l}{2} \text{d}x =\infty$$
Since the first integral on the right hand side is finite it does not influence the convergence, so we concentrate on the second integral; by the limit estimation we have that
$$\int_{K_\varepsilon}^\infty f(x) \text{d}x > \int_{K_\varepsilon}^\infty \frac{l}{2} \text{d}x =\infty$$
So the integral is divergent.
Some questions:
1) is the context correct? I've assumed that "$f:[a,\infty)$ Riemann integrable" means that the only point we have to study is when $x \to \infty$ because of the unboundedness;
2) when I split the integral in two integrals I suppose that $a<K_\varepsilon$, can I do this? If yes, why?
3) is the proof correct in general? If not, where are the mistakes? If yes, how can I improve it?
Thanks.
 A: Let $ a\in\mathbb{R} \cdot $
By the definition there exists some $ A >\max\left(a,0\right) $ such that $ \left(\forall x\geq A\right),\ \left|f\left(x\right)-\ell\right|<\frac{\ell}{2} \cdot $
And from that we get that $ \left(\forall x\geq A\right),\ f\left(x\right)\geq\frac{\ell}{2} \cdot $
Let $ x\geq A $, then : \begin{aligned}\int_{a}^{x}{f\left(t\right)\mathrm{d}t}&=\int_{a}^{A}{f\left(t\right)\mathrm{d}t}+\int_{A}^{x}{f\left(t\right)\mathrm{d}t}\\ &\geq\int_{a}^{A}{f\left(t\right)\mathrm{d}t}+\frac{\ell}{2}\int_{A}^{x}{\mathrm{d}t}\\ &\geq\int_{a}^{A}{f\left(t\right)\mathrm{d}t}+\frac{\ell}{2}\left(x-A\right)\underset{n\to +\infty}{\longrightarrow}+\infty\end{aligned}
Hence, $$ \int_{a}^{+\infty}{f\left(x\right)\mathrm{d}x}=+\infty $$
A: 1.: Yes. The Improper Riemann integral is a limit of Riemann integrals, so $f$ must be Riemann integrable on $[a,b]$ for all $b>a$.
2.: Yes, you can suppose that $K_\varepsilon > a$ because you don't need to pick the smallest $K_\varepsilon$. And if $K_\varepsilon$ is good, then so is $42a+42K_\varepsilon$.
3.: The idea is good, but you can improve it. I would not integrate it from $a$ to $+\infty$, just from $a$ to some $b$, and examine the behaviour as $b \to +\infty$. Technically, you did the same, but I think it's more formal.
Also, the following line is not correct:
$$\int_a^\infty f(x) \text{d}x =\int_a^{K_\varepsilon} f(x) \text{d}x+\int_{K_\varepsilon}^\infty f(x) \text{d}x > \int_a^\infty \frac{l}{2} \text{d}x =\infty$$
I think you wanted to write
$$\int_a^\infty f(x) \text{d}x =\int_a^{K_\varepsilon} f(x) \text{d}x+\int_{K_\varepsilon}^\infty f(x) \text{d}x > \int_{\color{red}{K_\varepsilon}}^\infty \frac{l}{2} \text{d}x =\infty$$
But it is still not correct, because 
$$\int_a^{K_\varepsilon} f(x) \text{d}x$$
can be negative.
