This question concerns the smart substitution which led to the transformation of
$$(1−x^2)y''−2(m+1)xy'+(n(n+1)−m(m+1))y=0$$
to
$$\frac{d}{dx}\left((1−x^2)\frac{dg}{dx}\right)−\frac{m^2}{1−x^2}g+n(n+1)g=0$$
via the smart substitution $y=(1−x^2)^\frac{-m}{2}g$
Was this solely a piece of genius guess work or were there any properties of Legendre's polynomial or its derivatives that eventually motivate us to think of introducing the substitution factor $(1−x^2)^\frac{-m}{2}$?