Find a function for which integral does not exist but converges as a limit of a sequence

convergence-divergenceexamples-counterexamplesimproper-integralsreal-analysis

Find an example of a function $f:[0,\infty)\rightarrow \mathbb{R}$ integrable on all intervals such that $\lim_{n\rightarrow \infty}\int_0^n f$ converges as a limit of a sequence, but such that $\int_0^\infty f$ does not exist.


I think a kind of function whose integral oscillates between positive and negative region as $n\rightarrow \infty$ may do the job here but I am not sure. Appreciate your help.

Best Answer

Just define $f$ separately on the intervals $(n,n+\frac 1 2)$ and $(n+\frac 1 2,n+1)$, $n=1,2,...,$ so that $\int_n^{n+\frac 1 2} f(x)dx=1$ and $\int_{n+\frac 1 2} ^{n+1} f(x)dx=-1$.

Related Question