I have the following problem: \begin{cases} y(x) =\left(\dfrac14\right)\left(\dfrac{\mathrm dy}{\mathrm dx}\right)^2 \\ y(0)=0 \end{cases} Which can be written as:
$$ \pm 2\sqrt{y} = \frac{dy}{dx} $$
I then take the positive case and treat it as an autonomous, seperable ODE. I get $f(x)=x^2$ as my solution.
In order to solve this problem, I have to divide each side of the equation by $\frac{1}{\sqrt{y}}$. But since the solution to this IVP is $y(x)=x^2$, zero is in the image of $f(x)$. So at a particular point $1/\sqrt{y}$ is not defined. But the solution is defined at $y =0$.
In fact, $y(x)= 0$ for all x is another solution. But aside from this solution the non-trivial solution is defined at zero also.
So is it wrong to divide across by $1/\sqrt{y}$? And if so how else do I approach this question?
I will use the shorthand $y'$ for $\frac{\mathrm{d}y}{\mathrm{d}x}$. What you need to do is carefully sort out exactly what you have shown.
(note: I am assuming $y'$ is continuous; I'm not sure if a solution with discontinuous $y'$ is possible)
E.g. for the equation $2 \sqrt{y} = y'$, your solution method leads to the conclusion
or going back to the original equation,
Together with the negative square root, and the fact that $y'$ can't change signs without passing through a point where $y=0$, you can ultimately conclude
Since $y$ is continuous and differentiable, we can see that if $y$ is given by such a formula near some point, it can be extended by the same formula until we reach a boundary where $y$ becomes zero, and the results above no longer constrain $y$.
So if we know $y$ is given by $(x+c)^2$ near some point $x=a$, then $y$ is given by the same formula on either the interval $(-c, \infty)$ or $(-\infty, -c)$, depending on whether $a > -c$ or $a < -c$.
So, we can build a solution $y$ out of the following pieces:
We have a final constraint: that $y$ must be continuous and differentiable! In general this puts constraints on how we can assemble partial solutions into a total solution. However, you can check at all of the boundary points you have $y=y'=0$, so it turns out these partial solutions can be assembled in any way we please.
So, the total solution space to the equation $4y = y'^2$ is that $y$ has one of the following forms:
$$ y = \begin{cases} (x-a)^2 & x \leq a \\ 0 & a \leq x \leq b \\ (x-b)^2 & b \leq x \end{cases} $$ $$ y = \begin{cases} 0 & x \leq b \\ (x-b)^2 & b \leq x \end{cases} $$ $$ y = \begin{cases} (x-a)^2 & x \leq a \\ 0 & a \leq x \end{cases} $$ $$ y = 0 $$ where $a,b$ are constants with $a \leq b$. (they can be equal)
All of these forms are consistent with having $y=0$ when $x=0$, assuming you choose $a \leq 0$ and $0 \leq b$.
Here's a sample solution from the first form with $a=-2$ and $b=3$: