Suppose you have a Sturm-Liouville problem with periodic boundary conditions, that is:
$\begin{align} & \frac{-d}{dx}(p(x) \frac{dy}{dx})+q(x)y =\lambda r(x) y \\ & p(a) =p(b) , \; y(a) =y(b),\; y'(a) =y'(b) \end{align}$
We know that the eigenspaces can have dimension greater than one, as shown by the classical example:
$\begin{align} & y''+\lambda y =0 \\ & p(0) =p(2 \pi) ,\; y(0) =y(2 \pi) ,\; y'(0) =y'(2 \pi) \end{align}$
Most textbooks prove that the eigenfunctions associated to different eigenvalues are orthogonal, which is easy once you know that L is self-adjoint under these conditions. Is this still true for linearly independent eigenfunctions associated to the same eigenvalue? (I'm guessing it'll be true due to some kind of Spectral Theorem for infinite dimension). If it's not, what is some counterexample?
For example, $\sin(nx),\cos(nx)$ are eigenfunctions with the same eigenvalue $\lambda=n^2$ of the periodic problem $$ -y'' = \lambda y,\;\;\;\; y(-\pi)=y(\pi),\; y'(-\pi)=y'(\pi). $$ However, $\sin(nx)+\cos(nx)$ and $\cos(nx)$ are linearly independent eigenfunction solutions with the same eigenvalue $\lambda=n^2$, but these are not mutually orthogonal. When there are degeneracies, you have choose the eigenfunctions with the same eigenvalue so that they are orthogonal; there's no unique way to do that, but it is automatic that--whatever your choice--the pair of them will be orthogonal to the eigenfunctions with different eigenvalues. Though $\cos(nx)$ and $\sin(nx)$ are natural choices of orthogonal eigenfunctions for $n=1,2,3,\cdots$, the following are also orthogonal with the same eigenvalue $$ \sin(nx)-\cos(nx),\;\; \sin(nx)+\cos(nx). $$ For one-dimensional eigenspaces, the eigenfunctions are unique up to a multiplicative constant.