Proof (condition where Sturm-Liouville operator is self-adjoint)

We use this identity and compute $$ \begin{align*} &\langle Ly_1, y_2\rangle_w - \langle y_1, Ly_2\rangle \\ ={}& \int_{a}^{b} w\left(\overline{y_2} Ly_1 - y_1 L\overline{y_2}\right) \d x \\ ={}& \int_{a}^{b} \dd{x}\big(p W(y_1,\overline{y_2})\big) \d x \\ ={}& \big[p(x) W(y_1, \overline{y_2})(x)\big]_{x=a}^{x=b} \tag{*}. \end{align*} $$

Let $y\in V$. If an endpoint $c\in\set{a,b}$ is singular, then $p(c) = 0$ and so the term on the right hand side of $(*)$ vanishes.

If otherwise $c\in\set{a,b}$ is non-singular, then by hypothesis, we have, for some $\alpha_c, \beta_c\in\R$ and $\alpha_c^2 + \beta_c^2 \neq 0$, $$ \begin{align*} \alpha_c y(c) + \beta_c y'(c) &= 0 \end{align*} $$ and taking complex conjugate gives $$ \begin{align*} \alpha_c \overline{y}(c) + \beta_c \overline{y}'(c) = 0. \end{align*} $$

Therefore for $y_1, y_2\in V$, $$ \begin{align*} \pmat{y_1(c) & y_1'(c) \\ \overline{y_2}(c) & \overline{y_2}'(c)} \pmat{\alpha_c \\ \beta_c} = 0. \end{align*} $$ Since $(\alpha_c,\beta_c)\neq 0$, $$ \begin{align*} W(y_1, \overline{y_2})(c) = \det\pmat{y_1(c) & y_1'(c) \\ \overline{y_2}(c) & \overline{y_2}'(c)} = 0 \end{align*} $$ so the term on the right hand side of $(*)$ vanishes.

Hence $$ \begin{align*} \langle Ly_1, y_2\rangle_w - \langle y_1, Ly_2\rangle_w = 0 \end{align*} $$ and so $L$ is self-adjoint.