Solution (source code)

= Solution

Differentiate the <Legendre differential equation> once and put $R_n=P_n'$:
$$
(1-x^2)R_n''-4xR_n'+\bigl(n(n+1)-2\bigr)R_n=0.
$$
Multiplying by $1-x^2$ gives its <Sturm-Liouville form>,
$$
\boxed{-\frac{d}{dx}\left[(1-x^2)^2R_n'\right]
=\lambda_n(1-x^2)R_n,\qquad \lambda_n=(n-1)(n+2).}
$$
Thus the weight is $w(x)=1-x^2$, not one. For $n\ge1$, $R_n$ is a nonzero polynomial; $R_0=0$ is a trivial solution rather than a nonzero <eigenfunction>.

Multiply the equations for $n,m$ by $R_m,R_n$ respectively, subtract and integrate. The resulting boundary term is $[(1-x^2)^2(R_n'R_m-R_m'R_n)]_{-1}^1=0$, since all these derivatives are finite at the endpoints. For distinct nonnegative indices, $\lambda_n-\lambda_m\ne0$, giving the <weighted orthogonality of Legendre polynomial derivatives>:
$$
\boxed{\int_{-1}^1(1-x^2)R_n(x)R_m(x)\,dx=0\quad(n\ne m).}
$$
For $n=0$ the integral is zero simply because $R_0=0$.