Proof (real and imaginary parts of eigenfunctions of Sturm-Liouville operator)

Let $L$ be defined by $p, q, w$. Since $L$ is self-adjoint, $\lambda$ is real. The result follows from $p,q,w,\lambda$ all being real.