# Sturm-Liouville operator, basis functions.

When dealing with a Sturm-Liouville operator: $$\hat A=\frac{1}{w(x)}\{\frac{d}{dx}(p(x)\frac{d}{dx})+q(x)\}$$ It is Hermitian if its functions satisfy the boundary conditions: $$[f^*p \frac{dg}{dx}]^b_a$$ But the eigenvalues of this operator are meant to form a basis of $L^2_w(a,b)$. Does this hold even in the case where $p(a)\ne0$ and/or $p(b)\ne0$ and why?

If you're working on a finite interval $[a,b]$ and you want to obtain a discrete sequence of eigenvalues, then the simplest assumption is that $p$, $w$ are non-zero on $[a,b]$, with $w$ continuous and $p$ continuously differentiable. For the regular case, it is common to assume that $q$ bounded or in $L^1_w[a,b]$. And real conditions at $x=a$ and $x=b$ are assumed for the functions in the domain $$\cos\alpha f(a) + \sin\alpha f'(a) = 0,\\ \cos\beta f(b)+\sin\beta f'(b) = 0.$$ You can impose various periodic conditions as well, but separated conditions as shown above are most common.
When you assume such conditions, then the same conditions that hold for $f$ also hold for $\overline{f}$. Then the problem is symmetric on $L^2_w[a,b]$ with inner product $(f,g)_w = \int_{a}^{b}f(t)\overline{g(t)}w(t)dt$; that is, \begin{align} (\hat{A}f,g)_w - (f,\hat{A}g)_w & = -p(x)\{f(x)\overline{g'(x)}-f'(x)\overline{g(x)}\}|_{a}^{b} \\ & = \left.-p(x)\left|\begin{array}{cc}f(x) & \overline{g(x)} \\ f'(x) & \overline{g'(x)}\end{array}\right|\right|_{a}^{b} = 0. \end{align} The above determinant vanishes at $x=a$ and $x=b$ because of the non-trivial null solutions coming from the endpoint conditions: $$\left[\begin{array}{c}f(a) & f'(a) \\ \overline{g(a)} & \overline{g'(a)} \end{array}\right]\left[\begin{array}{c}\cos\alpha \\ \sin\alpha\end{array}\right] = \left[\begin{array}{c} 0 \\ 0 \end{array}\right] \\ \left[\begin{array}{c}f(b) & f'(b) \\ \overline{g(b)} & \overline{g'(b)} \end{array}\right]\left[\begin{array}{c}\cos\beta\\ \sin\beta\end{array}\right] = \left[\begin{array}{c} 0 \\ 0 \end{array}\right].$$ This gives you a symmetric operator $\hat{A}$ that is essentially selfadjoint on $L^2_{w}[a,b]$. You'll end up with a discrete set of eigenvalues, and one-dimensional eigenspaces. The set of normalized eigenfunctions is a complete orthonormal basis of $L^2_w[a,b]$.