Solution (source code)

= Solution

Substitute $y=vP_n$ into the <Legendre differential equation> and expand using the <product rule>. The terms proportional to $v$ cancel because $P_n$ is itself a solution. What remains is
$$
\boxed{(1-x^2)P_nv''+\left[2(1-x^2)P_n'-2xP_n\right]v'=0.}
$$
Multiplying by $P_n$ identifies an exact <derivative>:
$$
\boxed{\frac{d}{dx}\left[(1-x^2)P_n^2v'\right]=0.}
$$
The latter form is convenient for <reduction of order> on intervals where $P_n\ne0$ and $x\ne\pm1$.