Number of zeros of a periodic function

Let's consider a periodic real function of a real variable $f(x)$. If the function is analytical and it is not the zero function, can one infer that the number of zeros in one period $[x,x+P)$ is finite and even? Is the hypothesis of analyticity strong enough in this case?

If this property does not hold for analytic functions, does it hold at least for a function which has a finite Fourier expansion (finite number of non-zero Fourier coefficients)? Of course if the Fourier expansion is infinite this property does not hold in general, just think about, e.g., a square wave which oscillates between 0 and 1.

Intuitively, I would reason like this: If the function is positive or negative in the whole domain, there are no zeros and the thesis is proven. If the function oscillates between positive and negative values, let us take a point $x$ such that $f(x)=f(x+P)>0$ and a second point $x<x'<x+P$ such that $f(x')<0$. Now, since the function is analytical and therefore smooth, it cannot "jump" from positive to negative values. For this reason, there will be points where the function is zero and the sign changes. Since the sign has to come back to positive from $x$ to $x+P$, the number of points where the function vanishes and changes its sign has to be even. I think that the cases where the function has a infinite number of zeros are not possible if the function is analytic. For example, the case where the function vanishes in a finite interval, and has therefore an infinite number of zeros, or the case where the function oscillates an infinite number of times between positive and negative values. Well this is maybe the tricky point.

Edit:

I think that the analyticity hypothesis is not strong enough to have a finite number of zeros, because if one consider an analytic function which has all derivatives vanishing in one point, then there is a neighbourhood of this point where the function is identically zero (so there is a continuum set of points which are zeros of the function). Does the hypothesis that the periodic function has a finite Fourier expansion (finite number of non-zero Fourier coefficients) enough to have a finite and even number of zeros in the interval $[x,x+P)$?

• Do you mean real-analytic or complex-analytic? It makes a big difference. – Erick Wong Mar 28 '15 at 16:20
• Real analytic, real function of a real variable. – sintetico Mar 28 '15 at 16:26
• Oh, sorry, I was thinking of smooth rather than analytic. Yes, real-analytic functions cannot have infinitely many zeros in a compact interval. – Erick Wong Mar 28 '15 at 16:57
• So, you say that real-analytic functions cannot have infinitely many zeros in a compact interval. Does it mean also that analytical functions cannot be identically zero on a finite interval? Is there a theorem or reference for this property of the analytic functions? Or perhaps the reason is straightforward (and I just don't see it)? – sintetico Mar 28 '15 at 17:23
• Counter-example: $\sin x$ has $3$ roots in $[0,2\pi]$. If you were to reduce the interval to $[x,x+P)$, then your argument is true. – LutzL Mar 28 '15 at 19:01

A function $f:\>{\mathbb R}\to{\mathbb C}$ which is $P$-periodic and real analytic has a holomorphic extension $\tilde f:\>S\to{\mathbb C}$ to some strip $S:\>|{\rm Im}(z)|<h$. It follows that $f$ has only finitely many zeros in each period interval; but when talking about the number of zeros per period we have to take their multiplicities into account: The function $f(t):=1+\cos t$ has just one (double) zero per period. When $f$ has a zero of order $r$ at $x_0$ then $f$ changes sign at $x_0$ if $r$ is odd and does not change sign otherwise. Summing this up we can say the following: A real analytic $P$-periodic function has only finitely many zeros $x_k$ $\>(1\leq k\leq m)$ of order $r_k\geq1$ per period, and $\sum_{k=1}^m r_k$ is even.