Solution (source code)

= Solution

For $x\ne\pm1$, write the <linear ordinary differential equation> as
$$
y'+\frac{2x}{1-x^2}y=\frac{x(1-x)}{1-x^2}.
$$
An <integrating factor> on each interval avoiding $\pm1$ is $\mu(x)=1/(1-x^2)$; multiplication by a nonzero constant, including a sign, is immaterial. Therefore
$$
\left(\frac{y}{1-x^2}\right)'
=\frac{x(1-x)}{(1-x^2)^2}
=\frac{x}{(1-x)(1+x)^2}.
$$
The <partial fraction decomposition> is
$$
\frac{x}{(1-x)(1+x)^2}
=\frac{1}{4(1-x)}+\frac{1}{4(1+x)}-\frac{1}{2(1+x)^2}.
$$
Integrating gives the <general solution>
$$
\boxed{y(x)=\frac{1-x}{2}+
(1-x^2)\left(C+\frac14\log\left|\frac{1+x}{1-x}\right|\right),
\qquad x\ne\pm1.}
$$
The constant is independent on each connected interval of definition. At the singular points the undivided <differential equation> forces $y(1)=0$ and $y(-1)=1$. The displayed family tends to these values, but its <derivative> has a logarithmic divergence there, so no member extends as a <differentiable function> through either singular point.