3

Does anybody know a function $f$ that is continuous on $[0, \infty)$, so that $\int_{0}^{\infty} f(x)dx$ converges but $\int_{0}^{\infty} f(x)^2dx$ diverges? Thanks

EDIT: Sorry! I meant that $f$ is also continuous there.

Bernard
  • 175,478
Ron
  • 527

5 Answers5

4

A simple function with this property is $f(x)=\sin(x)/\sqrt{x}$, whose graph looks like so:

enter image description here

A simple appeal to the alternating series test shows that the integral converges, as $$\int_0^{\infty} f(x) dx = \sum_{k=0}^{\infty}\int_{k\pi}^{(k+1)\pi} f(x) dx.$$

To see that the integral of $f(x)^2$ diverges, let's take a look at a graph of $f(x)^2$:

enter image description here

Each dashed rectangle that you see lives over an interval of the form $[k\,\pi+\pi/6,k\,\pi+5\pi/6]$, which has length $4\pi/6$ or $2\pi/3$. The height of each rectangle is $$\frac{\sin^2(k\,\pi+5\pi/6)}{k\,\pi+5\pi/6} = \frac{1/4}{k\,\pi+5\pi/6}.$$

Thus, the sum total of the areas of those rectangles is $$\sum_{k=0}^{\infty} \frac{\pi/6}{k\,\pi+5\pi/6} = \infty.$$

As those rectangles lie wholly under the graph of the squared function, the improper integral must diverge as well.

Mark McClure
  • 30,510
  • Thanks! I just wanted to add a simple method to prove this: use the Dirichlet convergence test for $f(x)$, then the comparison test for non-negatives with $1/x$. – Ron Nov 22 '16 at 21:06
2

Notice that the following integral converges, and to the particular value.

$$\int_0^\infty\sin(x^2+2x+1)dx\approx3.16389$$

On the other hand,

$$\int_0^\infty\sin^2(x^2+2x+1)dx$$

does not converge.

  • What's wrong with this? It satisfies all the given conditions as far as I can tell. – Simply Beautiful Art Nov 20 '16 at 02:55
  • My upvote should make up for it. I guess someone felt that your answer could be more detailed, or maybe it was just some random downvoter. –  Nov 20 '16 at 04:05
  • I upvoted this.. But I can't understand how you got to this answer. – Ron Nov 20 '16 at 07:51
  • @Ron It would appear that this answer was obtained with a numerical integrator. The idea behind this answer, as with mine, is to relate the integral to an alternating series. In this case, the graph looks like this. The area of each portion over an interval the form $[\sqrt{k\pi}-1,\sqrt{(k+1)\pi}-1]$ is smaller than the previous area in absolute value because their width narrows as $k$ increases. The alternating sign of the sine yields convergence. The squared function is not alternating and the widths still decrease to zero harmonically yielding divergence. – Mark McClure Nov 20 '16 at 12:25
  • @Ron Please see the link I provided on this famous integral. – Simply Beautiful Art Nov 20 '16 at 12:53
  • @MarkMcClure WolframAlpha gave me a sort of closed form, though I couldn't imagine it being any good to post here. – Simply Beautiful Art Nov 20 '16 at 12:54
  • 1
    @SimpleArt If you compute the integral over an interval of the form $[\sqrt{k\pi}-1,\sqrt{(k+1)\pi}-1]$, you still get a result in terms of Fresnel's special function, but it's easy to see that the sum is collapsing showing convergence. – Mark McClure Nov 20 '16 at 13:04
1

We can find a continuous function $f$ with values in $[0, \infty)$ that satisfies the condition. Indeed, consider a function that:

on every interval of $[n,n+1]$ takes the value $n$ on an interval of length $1/n^3$ centered at $n+\frac{1}{2}$ and decreases to $0$ outside the central subinterval of length $\frac{2}{n^3}$. Then

$$\int_0^{\infty} f(x) dx \le 2 \sum_{n=1}^{\infty} \frac{n}{n^3} < \infty$$ but $$\int_0^{\infty)} f^2(x) dx \ge \sum_{n=1}^{\infty} \frac{n^2}{n^3} = \infty$$

In a similar way (say with subintervals of length $\frac{1}{n^2 \log^2 n}$, $n\ge 2$, and values $n$) we find $f\ge 0$ continuous on $[0, \infty)$ such that $\int_{0}^\infty f(x) d x < \infty$, but $\int_0^{\infty} f^s(x) dx = \infty$ for all $s> 1$.

orangeskid
  • 53,909
0

Take the function $f$ whose restriction to $[n,n+1[$ is the constant function $(-1)^{n+1}{1\over\sqrt {n+1}}$. It converges, but not $f^2$.

If you want $f$ to be continue, you can find $f_n:[n,n+1]$ such that $f_n(n)=f_{n+1}(n+1)=0$, $f_n\geq 0$ if $n$ is odd, $f_n\leq 0$ if $n$ is even and $\int_n^{n+1}f(x)dx=(-1)^{n+1}{1\over\sqrt {n+1}}$ by using bump functions.

https://en.wikipedia.org/wiki/Bump_function

-1

Can someone tell me what's wrong with the following? From @MarkMcClure's comment, there must be something wrong. It could must be a subtle point of improper Riemann integrals.

If $f$ is continuous on $[0,\infty)$ and $\int_0^\infty f < \infty$, then $f(x) \to 0$ as $x \to \infty$, so there's some sufficiently large $R$ such that $f(x) \leq 1$ for $x > R$. Then $\int_R^\infty f^2 \leq \int_R^\infty f$; in particular, $\int_R^\infty f^2 < \infty$ (it exists). Since $f^2$ is the composition of continuous functions and $[0,R]$ is compact, $\int_0^R f^2$ also exists. Hence $\int_0^\infty f^2$ doesn't diverge.

Jon Warneke
  • 4,937
  • 2
    That the limit as $x \to \infty$ of $f$ is 0 need not be true. You can take triangular hats that get taller and taller but thinner and thinner, spaced out in a way such that they belong in $L^1$ but not in $L^2$ – user217285 Nov 20 '16 at 02:16
  • 1
    Also $\int f < \infty$ doesn't convey anthing, unless $f\ge 0.$ – zhw. Nov 20 '16 at 02:22