The solution of the differential equation $dy/dx = 2xy^2$ for which $y=-1$ when $x=1$ is:
A) $y=-1/x^2$ for $x \neq 0$ B) $y=-1/x^2$ for $x > 0$ C) $\ln y^2 = x^2-1$ for all x D) $y=-1/x$ for $x>0$
With the separation of variables, it is quite easy to see that $y=-1/x^2$. However, I'm not sure how to determine which domain to choose. Clearly $x$ cannot be $0$, but both A and B ave rules it out. I feel that x being negative should have no problem, but the answer is actually B. Could someone explain why?
The domain of the solution of an IVP is always assumed to be an interval. In your case, we just can take the largest interval contained in the domain of the function to which the initial time moment belongs, that is, $(0, \infty)$.
One could ask why not take $(-\infty,0) \cup (0,\infty)$ as the domain. One of the reasons (to me, the main reason) is that we would lose the uniqueness of the solution of an IVP then. Indeed, the function $y(x) = -1/x^2$, with domain $(-\infty,0) \cup (0,\infty)$, satisfies both the equation $$ \tag{$*$} dy/dx = 2xy^2 $$ and the initial condition $$ \tag{$**$} y(1) = -1. $$ But the function $\tilde{y} \colon (-\infty, -\sqrt{2}) \cup (0, \infty) \to \mathbb{R}$ defined as $$ \tilde{y}(x) = \begin{cases} \displaystyle\frac{1}{2-x^2} & \text{ for } x \in (-\infty, -\sqrt{2}) \\[1ex] \displaystyle - \frac{1}{x^2} & \text{ for } x \in (0, \infty) \end{cases} $$ satisfies $(*)$ as well as $(**)$. Therefore, admitting domains that are not connected would make formulating uniqueness theorems quite unpleasant, and we would get nothing in return.