# Does Improper integral of continuous, non zero and periodic function diverge?

Let $f:\mathbb R\to\mathbb R$ be a continuous, non zero and periodic function. Does $\int_0^\infty f(x)dx$ diverge?

I think that the answer is yes. My thought was that if we assume $f$ has, in each period, a point $x_0$ in which $f(x_0)\neq0$, then from continuous we must have a close interval to $x_0$ in which the integral can't be zero. And by summing all those non-zero integral in each period we get the integral diverge.

I have two problem with this thought:

$1.$ what about periodic functions such as $sin(x)$ which satisfying $\int_a^{a+T}f(x)dx=0$ I kind of ignored them.

$2.$ I tried to write a proof and got stuck with satisfying that continuous ensure that integral of the close interval to $x_0$ is non-zero.

• $\int_0^a \sin(x)dx = 1- \cos(a)$ and $\lim_{a \to \infty}1- \cos(a)$ doesn't converge. But $1- \cos(a)$ is bounded (and periodic) precisely because the mean value of $\sin(x)$ is $0$. – reuns Sep 16 '17 at 21:47

As you noticed, we can find $x_0$ with $f(x_0)\ne 0$, wlog. $f(x_0)>0$, and then an interval $[x_0-\epsilon,x_0+\epsilon9$ where $f(x)>\frac 12f(x_0)$. It follows that $$\int_0^{nT+x_0+\epsilon}f(x)\,\mathrm dx - \int_0^{nT+x_0-\epsilon}f(x)\,\mathrm dx \ge 2\epsilon \cdot \frac12 f(x_0)=:c>0$$ whereas convergence of the improper integral would require that $$\left|\int_0^{x_1}f(x)\,\mathrm dx-\int_0^{x_2}f(x)\,\mathrm dx\right|<c$$ for all sufficiently large $x_1$ and $x_2$.