Solution (source code)

= Solution

Direct <differentiation> of $v=(x^2-1)^l$ gives $(x^2-1)v'=2lxv$; the identity also holds for $l=0$. Differentiate it $l+1$ times using the <Leibniz rule>. The quadratic factor has only its first two derivatives nonzero, so
$$
(x^2-1)v^{(l+2)}+2(l+1)xv^{(l+1)}+l(l+1)v^{(l)}
=2l[xv^{(l+1)}+(l+1)v^{(l)}].
$$
Writing $y=v^{(l)}$ and collecting terms gives $(x^2-1)y''+2xy'-l(l+1)y=0$. Multiplication by $-1$ gives the <Legendre differential equation>:
$$
\boxed{(1-x^2)y''-2xy'+l(l+1)y=0.}
$$