Solving differential equation with boundary conditions $y=2$ at $x=0$ I need to find a solution to this differential equation $(1+x^2) $$\tfrac{\mathrm{d}y}{\mathrm{d}x} = x-xy^2$, with boundary condition $y=2$ at $x=0$
I collect all terms on the RHS to get $$\tfrac{\mathrm{d}y}{\mathrm{d}x} = \frac{x}{1+x^2}  (1-y^2)$$
I integrate then move the y terms to the left side and integrate both sides and simplify to get $$\frac{1}{\sqrt{1-y^2}} = k\sqrt{1+x^2}$$
I then isolate y in order to get it in a y= form and sub in the y and x value but I don't get the correct answer; I'm not sure where I'm going wrong

$$\int\frac{dy}{1-y^2}=\int\frac{x\,dx}{1+x^2}$$
now you can do the left a few ways but we can use PFD:
$$\int\frac{dy}{1-y^2}=-\frac12\int\left(\frac{1}{y-1}-\frac{1}{y+1}\right)dy=\frac12\ln\left|\frac{y+1}{y-1}\right|$$
now do RHS:
$$\int\frac{x}{x^2+1}dx=\frac12\ln(x^2+1)+C_1$$
now equate:
$$\ln\left(\frac{y+1}{y-1}\right)=\ln(x^2+1)+C_2$$
exponentiate:
$$\frac{y+1}{y-1}=C_3(x^2+1)\tag{1}$$
now ideally get $y$ on its own, so you can use that:
$$\frac{y+1}{y-1}=\frac{y-1+2}{y-1}=1+\frac{2}{y-1}$$
bring it back into the equation:
$$1+\frac{2}{y-1}=C_3(x^2+1)$$
$$y-1=\frac{2}{C_3(x^2+1)-1}$$
$$y=1+\frac{2}{Cx^2+(C-1)}$$
