IVP $xy'=2y$, $y(a)=b$ Is this true for the Initial Value Problem
$xy'=2y$, $y(a)=b$
The function $y=x^2$ for $y\leq 0$ and $y=cx^2$ for $x\geq 0$ is one of the solutions.
The answer is given to be correct.
I find it rather amusing that the first solution is only satisfied by (0,0), which already is in the second solution. 
Drawing the graph in mathematica, the solution seems to be
$y=x^2$ for $x\leq 0$, and $y=cx^2$ for $x\geq 0$
So, according to me the statement is incorrect..
So am i right . Or did I miss something?
 A: I might have already explained this quite recently on the site but here we go: firstly, every solution defined at $0$ is such that $y(0)=0$ and, secondly, the solutions defined on the whole real line are exactly the functions $y$ such that there exists two constants $(\alpha,\beta)$ such that 
$$
y(x)=\left\{\begin{array}{ccc}\alpha x^2&\text{if}&x\gt0\\0&\text{if}&x=0\\\beta x^2&\text{if}&x\lt0\end{array}\right.
$$
Note that, even if $\alpha\ne\beta$, one has $xy'(x)=y(x)$ for every $x$ on the real line hence $y$ is a "true" solution in every sense of the term. Naturally nonuniqueness occurs because Cauchy-Lipschitz conditions are not met.
In particular, yes the function defined by $y=x^2$ for $x\lt0$, $y(0)=0$ and $y=cx^2$ for $x\gt0$ solves the differential equation $xy'=2y$, this is just the choice $(\alpha,\beta)=(1,c)$. But one ought to check the condition $y(a)=b$, which, assuming that $a\gt0$, imposes the value $c=b/a^2$.
For a proof of the initial statement above in a quite related context, see this answer (with a rather strange string of comments).
A: If we rewrite your equation into $$\frac{y'}{y}=\frac{2}{x}$$ and recall that $$\frac{d}{dx}lny=\frac{y'}{y}$$ we can integrate both sides to get $$lny=lnx^2+lnC$$ which becomes $$y=Cx^2$$ as you predicted.  Applying the condition $y(a)=b$ yields $C=\frac{b}{a^2}$ so the final answer is $$y=\frac{b}{a^2}x^2$$ which is easily checked.  If $a$ or $x$ is allowed to be a complex number then this solution satisfies both y>0 and y<0.  I don't know if Mathematica takes that into account.
