# solving separable differential equation

I am to solve the following differential equation using separation of variables $$f'(x)+2x[f^2(x)-f(x)]=0$$ So far my approach was: $$\frac{df(x)}{dx}+2x[f^2(x)-f(x)]=0$$ $$\frac{df(x)}{dx}+f^2(x)-f(x)=\frac{1}{2x}$$ $$df(x)+f^2(x)-f(x)=\frac{1}{2x}dx$$

However I am unsure of how to continue/integrate over the left hand side. Any tips would be greatly appreciated!

I apologise in advance for any trivial mistakes I might have made, as I am not very familiar with differential equations yet. Thanks for your help!

Your mistake was asumming $$f' + 2x(f^2-f) =0 \implies f' +f^2-f = \frac{1}{2x}$$ this is wrong. Your equation is actually $$\frac{1}{f^2-f}\frac{df}{dx} = -2x$$ I assume you can take it from here.
i would write $$\frac{df(x)}{dx}=-2x(f^2(x)-f(x))$$ and from here we get $$\frac{df}{f^2-f}=-2xdx$$