# Example of $f:[0,1]\to\mathbf{R}$ with $\lim_{a\to 0^+}\int_a^1f(x)dx=L $ for some real number $L$ but $\int_0^1|f(x)|dx=\infty $

In the Wikipedia article on improper integrals, the function $f(x)=\frac{\sin x}{x}$ gives an example that is improperly integrable:
$$
\lim_{N\to\infty}\int_0^N f(x)dx=\frac{\pi}{2}
$$
but *not* absolutely integrable:
$$
\int_0^\infty|f(x)|dx=\infty
$$

I am looking for such an example for functions defined on a closed interval:

Can we find a function $f:[0,1]\to\mathbf{R}$, such that $\displaystyle \lim_{a\to 0^+}\int_a^1f(x)dx=L $ for some real number $L$, but $\displaystyle \int_0^1|f(x)|dx=\infty $？

**Remark**.

I think such an example of $f$ should oscillate in the interval so that when considering the improper integral, it has lots of cancellations, and when taking the absolute value in the integral, it blows up, maybe having the harmonic series as a lower bound. But I don't have much progress in this direction.

I also consider converting the example on $[0,\infty)$ to one on $[0,1]$. But getting a bijection between $[0,1]$ and $[0,\infty)$ seems not very useful.

## 2 answers

Since you haven't specified that such a function needs to be continuous or well-behaved in any way, it's quite easy to describe one.

The integral $\int_0^1 \frac1x\,dx$ diverges, so there is an infinite amount of area to work with. Measure off the section of curve with area 1 starting at $x = 1$ and working toward $x = 0$. Then measure off the next section of curve with area 1/2 and negate the curve over that interval. Then measure off the next section of curve with area 1/3 and skip over it, measure off the next section of curve with area 1/4 and negate it, etc. The resulting function has the desired property—by construction, its integral from 0 to 1 is $1 - \frac12 + \frac13 - \frac14 +\ldots = \log(2)$ but the integral of its absolute value (which remains $\frac1x$) diverges.

#### 0 comment threads

Such an example is $\dfrac{\sin(1/u)} u$ for $0 < u < 1. $

\begin{align} \text{Let } & u = \frac1x. \\[6pt] \text{Then } & du = -\frac{dx}{x^2}. \end{align}For $1\le a < b,$ as $x$ goes from $a$ to $b,$ $u$ goes from $1/a$ to $1/b$, so $$ \int_{1/b}^{1/a} \frac{\sin(1/u)} u ~du = -\int_b^a \frac{\sin x}x~dx = \int_a^b \frac{\sin x} x~dx. $$

## 1 comment thread