TITLE: $\int _0^\infty f(x) $ exists and $f(x)$ is differentiable then $\lim _{x \to \infty} f '(x)$ exists. Counter example of this statement.
QUESTION [7 upvotes]: Can anyone give me a counter example of the statement 

If $\int_0^\infty f(x) $ exists and $f(x)$ is differentiable then $\lim _{x \to \infty} f'(x)$ exists.

My attempt: I have thought one. First I draw $1/x^2$ in the first quadrant and $-1/x^2$  in the fourth quadrant.  The area under the following curves are finite.
1) $1/x^2$ 
2) $-1/x^2$
3) $x= 1$.
Now I have drawn infinite number of  $y = x+c $ at equal distances in that region. Then I joined those infinite lines by some smooth curve so that the curve remains differentiable.  Now I think this function can be a counter example.
I am uploading one picture of my attempt. Can anyone please check it and if possible suggest me a better function.

REPLY [8 votes]: Yep, this works perfectly! You can rigorize this sort of idea by defining some function like
$$\frac{\sin\left(x^{10}\right)}{x^2}$$
(where the exponent of $10$ is simply to make sure our function oscillates fast enough).