# Eigenvalue/Eigenfunction problem in an ODE

Find the general solution $Q=Q(\theta)$ to the ODE which is periodic in $\theta$.

$$Q'' + \lambda Q = 0$$

We have to consider three cases for the value of $\lambda$. When $\lambda=-\alpha^2<0$ we have that

$$Q(\theta) = A\cosh(\alpha\theta)+B\sinh(\alpha\theta)$$

Note however this is not periodic in $\theta$ hence $Q(\theta)=0$ (trivial solution). Now suppose $\lambda=0$

$$Q(\theta) = A\theta + B$$

which is also not periodic in $\theta$ unless $Q(\theta)=B$. Finally if $\lambda = \alpha^2>0$ then

$$Q(\theta) = A\cos(\alpha\theta)+B\sin(\alpha\theta)$$

which is periodic and we should note that the $\lambda=0$ and $\lambda>0$ cases can be combined. Hence for $\lambda\ge0$

$$Q(\theta) = A\cos(\alpha\theta)+B\sin(\alpha\theta)$$

$$Q(\theta) = A\cos(n\theta)+B\sin(n\theta)$$
where $n=0,1,2...$. Why do we restrict only to the nonnegative integers? For my solution I have $\alpha\in\mathbb{R}$.
The frequency $\alpha$ is restricted to the integers if and only if the ODE is posed on a bounded domain, with boundary conditions at the end points of that domain. If no boundary conditions are specified, then every $\lambda > 0$ yields a periodic solution.