# Domain of a first order separable differential equation

I want to solve this differential equation :

$$xy'+y=y^2$$

So with conditions $$y \neq 0,y\neq1$$ and $$x \neq0$$ I can rewrite it as :

$$\frac{y'}{y(y-1)}=\frac{1}{x}$$

So after observing that also $$y=0$$ and $$y=1$$ are solutions I can use a theorem on separable differential eq. to write :

$$\int\frac{dy}{y(y-1)}=\int\frac{dx}{x} +K$$

My question is about how to treat the condition $$x \neq 0$$ formally :

Should I integrate over the two open intervals $$(-\infty,0)$$ and $$(0,+\infty)$$,and then observing that the solution is :

$$y = \frac{1}{1-Cx}$$

I can say that it can include $$0$$ because $$y(0) = \frac{1}{1-C\cdot0} = 1$$ is a solution of the equation?

• You could also use $$\frac{(xy)'}{(xy)^2}=\frac1{x^2}.$$ Aug 10 '20 at 10:39

It doesn't matter how you got the solution $$y = \frac{1}{1-Cx}$$. You can make all the assumptions you want.
But, if you can show that it satisfies the differential equation for all values of $$y(0)$$, you've got a solution that works for all values of $$y(0)$$ - even those you neglected while deriving $$y(x)$$. And in the end, that's all that matters.
Yes you may say that. Normally in differential equations we are looking for solutions that are functions defined in domains (topos). So your solution will be valid in the interval $$(-\infty,1/C)$$ or $$(1/C,\infty)$$.
When you are insisting $$y\ne 0$$ and $$y\ne 1$$, then $$x=0$$ cannot be in the domain of the solution.