# Improper integral convergence example with absolute value

$$\int_{a}^{+\infty}|f(x)|dx < +\infty \Longrightarrow \int_{a}^{+\infty}f(x)dx \in \mathbb{R}$$

Show that the opposite ( $$\Longleftarrow$$ ) is not true.

Is there a "simple" function as counter-example? I discovered $$f(x) = \frac{\sin(x)}{x}$$ is a good example from 1 to $$+\infty$$, but how can I show it? I'm in a calculus course, and I don't know convergence/divergence theorems for integrals.

I also thought about a piecewise function that should have a certain positive "area" and a certain negative "area", so that when you integrate it you have a convergent integral (positive "areas" cancel negative "areas") but you have a divergent integral using $$|f(x)|$$

Note that for any integer $N>1$
\begin{align} \int_1^{N\pi}\left|\frac{\sin(x)}{x}\right|\,dx&\ge \int_\pi^{N\pi}\left|\frac{\sin(x)}{x}\right|\,dx\\\\ &=\sum_{k=1}^{N-1} \int_{k\pi}^{(k+1)\pi}\left|\frac{\sin(x)}{x}\right|\,dx\\\\ &\ge \sum_{k=1}^{N-1} \frac{1}{(k+1)\pi}\int_{k\pi}^{(k+1)\pi}|\sin(x)|\,dx\\\\ &=\frac2\pi\sum_{k=2}^{N}\frac1k \end{align}
• I can't understand this passage: $\int_{k\pi}^{(k+1)\pi}\left|\frac{\sin(x)}{x}\right|\,dx \geq \sum_{k=1}^{N-1} \frac{1}{(k+1)\pi}\int_{k\pi}^{(k+1)\pi}|\sin(x)|\,dx$ Commented Jan 12, 2017 at 17:51
• For $x\in [k\pi,(k+1)\pi]$, we have $x\le (k+1)\pi$ and hence $1/x\ge 1/((k+1)\pi)$ Commented Jan 12, 2017 at 18:00