Solution (source code)

= Solution

Inspection gives $y_1=x$ in the degree-one <Legendre differential equation>. After division by $1-x^2$, $p=-2x/(1-x^2)$ and $e^{-\int p}=1/(1-x^2)$. On either side of zero, <reduction of order> therefore gives
$$
v'=\frac1{x^2(1-x^2)}=\frac1{x^2}+\frac1{1-x^2},\qquad v=-\frac1x+\operatorname{arctanh}x.
$$
A second solution is $y_2=x\operatorname{arctanh}x-1$. Although $v$ is singular at zero, the product $vy_1$ has a smooth continuation throughout $(-1,1)$. This illustrates <reduction of order across a zero of the known solution>. Since $y_1(0)=0$, $y_1'(0)=1$, $y_2(0)=-1$ and $y_2'(0)=0$, the required coefficients are $1,-1$. Hence
$$
\boxed{y(x)=1+x-x\operatorname{arctanh}x=1+x-\frac x2\log\frac{1+x}{1-x},\qquad -1<x<1.}
$$
The <ordinary differential equation> has regular coefficients near zero, so the resulting initial-value solution is unique and the removable singularity in the intermediate representation causes no ambiguity.