Find a solution for $y$ in a nonlinear second order differential equation (missing x). Q. $y''+yy' = 0$. Find a solution satisfying each of the following sets of initial conditions. If your computer says there is no such solution, don't believe it do it by hand.
$(a)\quad y(0) = 5,\ y'(0) = 0\\
(b)\quad y(0) = 2,\ y'(0) = -2\\
(c) \quad y(0) = 1,\ y'(0) = -1\\
(d)\quad y(0) = 0,\ y'(0) = 2$

I can't quite get the correct answer. What I get is as follows:
$$y^{\prime\prime} + yy^\prime = 0 \tag1$$
$$\frac{dy^\prime}{dy} + y = 0 \tag2$$
$$y^\prime + \frac12y^2 = \text{const.} \tag3$$
But then I get confused about what to do with the initial conditions and how it relates with the $\text{const.}$ I get in $(3)$. Is my constant a function of $y$ or $x$? Or is it a function of both? Without minding the initial conditions and ignoring constants during integration, I get
$$y = \frac2x \tag4$$
Which is exactly what Boas tells me not to believe...
 A: So,
$${y'' + yy' = 0}$$
is equivalent to
$${\frac{d}{dx}[y'] + \frac{1}{2}\frac{d}{dx}[(y)^2]=0}$$
Rearranging and integrating:
$${\Rightarrow \frac{d}{dx}[y'] = -\frac{1}{2}\frac{d}{dx}[(y)^2]}$$
$${\Rightarrow y' = -\frac{1}{2}(y)^2 + c_1}$$
As you said. Although you got here by chain rule. You said
$${y'' = \frac{dy'}{dx} = \frac{dy'}{dy}\frac{dy}{dx}}$$
And so the ODE cancels to
$${\frac{dy'}{dy}\frac{dy}{dx} + y\frac{dy}{dx}=0}$$
And obviously cancelling the ${y'}$ (provided ${y'\neq 0}$) gives
$${\frac{dy'}{dy} + y = 0}$$
Then integrating both sides with respect to $y$, you get the same thing. Both are completely valid!
Anyways, this is just a separable ODE. Note
$${\Rightarrow \frac{dy}{dx} = c_1-\frac{1}{2}y^2}$$
$${\Rightarrow \frac{1}{c_1-\frac{1}{2}y^2}dy = dx}$$
EDIT: This is the stage that is incorrect if ${y'(0)=0}$ so ${c_1-\frac{1}{2}y^2(0)=0}$. You are dividing through by $0$ at this stage, so every step after this becomes invalid. When doing divisions like this of general expressions - you should technically always check to make sure you aren't dividing by a potential $0$. In this case - it only happens if ${y'(0)=0}$. Sorry - I should have stated this previously :)
Anyways, provided we haven't just divided by $0$:
$${\Rightarrow\int \frac{1}{c_1-\frac{1}{2}y^2}dy = x + c_2}$$
Now we are left to integrate
$${\int\frac{1}{c_1-\frac{1}{2}y^2}dy}$$
You should obviously firstly take the case ${c_1=0}$ (this will you give you a nice trivial solution, so I will leave this to you). Otherwise, if ${c_1>0}$, after factoring
$${=\int\frac{1}{c_1}\frac{1}{1-\frac{1}{2c_1}y^2}dy=\int\frac{1}{c_1}\frac{1}{1-\left(\frac{1}{\sqrt{2c_1}}y\right)^2}dy}$$
And to integrate this, you should do a substitution of ${u=\frac{1}{\sqrt{2c_1}}y}$ and use partial fractions. You then must take the case ${c_1<0}$. I won't write out the steps again, but in this case you cannot use the trick ${\sqrt{c_1}^2 = c_1}$ since the square root will be imaginary and things get complicated. The answer will be in terms of ${\tan}$ in this case.
The bottom line is - you really cannot ignore the constants, since the answer changes depending on what that constant is. Obviously for the initial conditions, you do not know the sign of ${c_1}$, so what do you do? Well, going back to
$${y' + \frac{1}{2}y^2 = c_1}$$
Plugging in ${x=0}$ will of course give you the value of ${c_1}$, and so you will know which anti-derivative to take based on this :)
Upon request, I could add more steps (for example, I could show how to continue to compute the anti-derivative and show the answer to the first part), but first - can you try taking it from here?
A: You could also see
$$
y'+\frac12y^2=c=y'(0)+\frac12y(0)^2
$$
as Riccati equation and set $y=\frac{2u'}{u}$ to get
$$
u''=\frac12cu, ~~ u(0)=2, ~ u'(0)=y(0)
$$
which has well-known solutions.
