<s>[INST] Solve the differential equation $(1-x^2)y' - 2xy^2 = xy$ I solved this equation as a Bernoulli equation:
$y' - \frac{x}{1-x^2}y = \frac{2x}{1-x^2}y^2$
I get expression for $y$:
$y = -C(x)\sqrt{|1-x^2|}$
And then I don’t know how to differentiate the module
 [/INST] $$y' = \frac{x}{1-x^2}y + \frac{2x}{1-x^2}y^2=\frac{x}{1-x^2}(y+2y^2)$$
This is a separable ODE.
$$\frac{2dy}{y+2y^2}=\frac{2x\:dx}{1-x^2}$$
Integrate :
$$2\ln\left|\frac{y}{2y+1}\right|=\ln\left|\frac{1}{1-x^2}\right|+\text{constant}$$
$$\left(\frac{y}{2y+1}\right)^2=C\frac{1}{1-x^2}\quad\begin{cases}
C>0 \quad \text{if}\quad 1-x^2>0\\
C<0 \quad \text{if}\quad 1-x^2<0\end{cases}\quad\text{for real solution}$$
Equivalent to :
$$\left(\frac{y}{2y+1}\right)^2=\frac{1}{c^2|1-x^2|}\qquad c\neq 0$$
Solving for $y$ leads to :
$$\boxed{y=\frac{1}{-2+c\:\sqrt{|1-x^2|}}}$$
The equation remains valid for $c=0$ according to the particular solution $y(x)=-\frac12$ which can be checked directly in the original ODE.
Also the equation remains valid for $|c|=\infty$ according to the particular solution $y(x)=0$ which is an obvious trivial solution of the original ODE.
</s>