Solution (source code)

= Solution

Use the ordinary real <inner product> $\langle u,v\rangle=\int_a^buv\,dx$ on the domain of functions obeying the two separated boundary conditions. <Integration by parts> gives the <Lagrange identity for a Sturm-Liouville operator>
$$
\langle u,Lv\rangle-\langle Lu,v\rangle=\big[p(vu'-uv')\big]_a^b.
$$
At $a$, the two boundary-value vectors $(u(a),u'(a))$ and $(v(a),v'(a))$ satisfy the same homogeneous linear relation. If $A_2=0$, both function values vanish; if $A_2\ne0$, their derivatives are the same constant multiple $-A_1/A_2$ of their values. Either way $vu'-uv'=0$. The same argument applies at $b$. Hence
$$
\boxed{\langle u,Lv\rangle=\langle Lu,v\rangle.}
$$
This proves symmetry, and the regular separated <Sturm-Liouville problem> has the same adjoint domain, so $L$ is <self-adjoint>. To see the domain point, require the boundary form to vanish against every admissible $u$: the independently variable endpoint data force an adjoint-domain function to obey those same endpoint relations.

As usual, each endpoint pair $(A_1,A_2)$ and $(B_1,B_2)$ must be nonzero, and the coefficients must have the regularity needed for these operations. An identically zero pair would impose no condition at that endpoint and would not give the claimed <self-adjoint operator>. The related operator $\omega^{-1}L$ is self-adjoint in the <weighted inner product> $\int_a^b\omega uv\,dx$.