Solution (source code)

= Solution

Let $Y(\theta)=y(\cos\theta)$ for $0\leq\theta\leq\pi$. The <chain rule> gives
$$
y'=-\frac{Y'}{\sin\theta},\qquad y''=\frac{Y''}{\sin^2\theta}-\frac{\cos\theta}{\sin^3\theta}Y'.
$$
Substitution cancels the first-derivative terms and leaves $-Y''=n^2Y$. The endpoint conditions become $Y(0)=Y(\pi)=0$. For $n\ne0$, the first condition selects $Y=A\sin(n\theta)$, and the second requires $\sin(n\pi)=0$. Thus a nonzero solution requires an integer $n$. The case $n=0$ gives $Y=A+B\theta$ and both conditions force it to vanish. Negative integers give the same eigenvalues and eigenfunctions up to sign, so take $n=1,2,\ldots$.

For <vector normalization>, use $w(x)dx=-d\theta$:
$$
1=\int_{-1}^1w(x)|y_n(x)|^2dx=|A|^2\int_0^\pi\sin^2(n\theta)d\theta=|A|^2\frac\pi2.
$$
Choosing a positive real normalization constant gives
$$
\boxed{y_n(x)=\sqrt{\frac2\pi}\sin(n\arccos x)=\sqrt{\frac2\pi}\sqrt{1-x^2}\,U_{n-1}(x),\qquad\lambda_n=n^2.}
$$
Here $U_{n-1}$ is the <Chebyshev polynomial of the second kind>. The factors $\sqrt{1-x^2}$ make both endpoint values zero. The derivatives need not stay finite there; instead $py_n'=-n\sqrt{2/\pi}\cos(n\theta)$ has finite endpoint limits, ensuring that the relevant boundary form vanishes.