Any non-zero solution of some second-order differential equation is not $2\pi$-period 
Suppose $$\frac {{d^2}y}{dx^2}+P(x)y = 0$$ where $P(x)$ is continuous and satisfying $n^2<P(x)<(n+1)^2$ where $n$ is a non-negative integer. Prove that any non-zero solution of the above second-order differential equation is not $2\pi$-periodic.

There are two facts I know that may be useful to the proof:

*

*$y''+Q(x)y=0$ where $Q(x)$ is continuous on $[a,+\infty]$ and satisfying $Q(x)\geq m>0$, then the distance between any two immediate zeros of non-zero solution of it is less than $\frac {\pi}{\sqrt{m}}$.

*$y''+Q(x)y=0$ where $Q(x)$ is continuous on $[a,+\infty]$ and satisfying $Q(x)\leq M \ (M>0)$, then the distance between any two immediate zeros of non-zero solution of it is larger than $\frac {\pi}{\sqrt{M}}$.

From this, I can't get a contradiction since if there is such a solution, with $x_0$ and $x_0+2\pi$ two zeros, then there can be $2n$ zeros between them with each of adjacent distance $d_j$ satisfying $\frac {\pi}{n+1}< d_j < \frac {\pi}{n}$. Does anyone know how to prove the result? Thank you

You are nearly there. If a solution were periodic, it would have, in every period starting (and thus ending) at a root, an even number of segments between roots, an equal number of positive and negative-valued segments.
So if it were $2n$ segments or less, the upper bound gives a total length strictly smaller than $2$. For $2n+2$ segments or more, the lower bound gives a total length strictly larger than $2\pi$. In no way is it possible to get the total length equal to $2\pi$.
