Solution (source code)

= Solution

Two integrations give the general <reduction of order> formula
$$
\boxed{v(x)=C_1+C_2\int^x\frac{dt}{(1-t^2)P_n(t)^2},\qquad y(x)=P_n(x)\left[C_1+C_2\int^x\frac{dt}{(1-t^2)P_n(t)^2}\right].}
$$
The integral is local on intervals avoiding zeros of $P_n$. A pole of the integral at an interior polynomial zero need not be a singularity of $y$: the product extends by <reduction of order across a zero of the known solution>. After a standard normalization the independent second solution is the <Legendre function of the second kind> $Q_n$.