# Convergence of integral and integral of squared function

Does there exist a real continuous function $f(x)$ defined on $\mathbb{R}$ that satisfies:

$$\int_{-\infty}^{\infty} \lvert f(x)\lvert \ dx < \infty \tag 1$$

$$\int_{-\infty}^{\infty} \lvert f(x)\lvert² \ dx = \infty \tag 2$$

EDIT

Without the continuity assumption, this statisfies the conditions:

$f(x)=\frac{1}{\sqrt x}$ in $0<x<1$; $f(x)=0$ otherwise

• It might improve your Question to include more context: What examples did you consider and discard? Why is this an interesting exercise? Not everything needs to be included, but it helps Readers to provide an Answer that will help you learn. – hardmath Feb 12 '17 at 20:42

Yes: define $f(x)=\frac{1}{\sqrt{x}}$ if $0<x<1$, and $f(x)=0$ otherwise.
• Ok, try to construct $f$ so that it has a sequence of rectangular "bumps" of length $\frac{1}{n^3}$ and height $n$ (adjusted so that $f$ is continuous, of course). – carmichael561 Feb 12 '17 at 21:21