Solution (source code)

= Solution

Seek an integrating factor $\mu$ such that the differential expression becomes $-(py')'$. Its leading coefficient requires $p=\mu(1-x^2)$, while the first-derivative coefficient requires $-p'=3x\mu$. Thus
$$
(1-x^2)\mu'-2x\mu=-3x\mu,\qquad
\frac{\mu'}\mu=-\frac{x}{1-x^2}.
$$
Choose the positive solution $\mu=\sqrt{1-x^2}$. The <Sturm-Liouville form> is therefore
$$
\boxed{-\left[(1-x^2)^{3/2}y_n'\right]'=(n^2-1)\sqrt{1-x^2}\,y_n,}
$$
with
$$
\boxed{p=(1-x^2)^{3/2},\qquad q=0,\qquad w=\sqrt{1-x^2}.}
$$
The weight is positive on the open interval. The endpoints are singular because $p$ vanishes there, but the prescribed boundedness of $y_n,y_n'$ makes the integration-by-parts boundary terms vanish.