Solution (source code)

= Solution

Multiply the differential equation by $(1-x^2)^{-1/2}$. Since
$$
\frac d{dx}[\sqrt{1-x^2}\,y']=\sqrt{1-x^2}\,y''-\frac{x}{\sqrt{1-x^2}}y',
$$
the <Sturm-Liouville form> is
$$
\boxed{-\frac d{dx}\left[\sqrt{1-x^2}\,y'\right]=n^2\frac{y}{\sqrt{1-x^2}},\qquad p=\sqrt{1-x^2},\quad q=0,\quad w=\frac1{\sqrt{1-x^2}}.}
$$
The <weighted inner product> is consequently $\langle u,v\rangle_w=\int_{-1}^1u^*v\,dx/\sqrt{1-x^2}$. These endpoints are singular: $p$ vanishes and $w$ diverges, though $w$ is integrable. The required boundedness of $y,y'$ makes the boundary factors $py'$ vanish, which is the fact needed in the integration identities below.