Solution of $y''=\frac{K}{y^2}$ with $K$ a constant. Solve 
$$
y''=\frac{K}{y^2}
$$
where $K$ is a non-zero constant.
My attempt :


*

*Lagrange method i.e.  $z=\frac{y'}{y}$ but it's look harder.

*Multiplying both sides by $y'$, then integration but it doesn't look better.

*I tried to let $y=y(0)(cos(z))^s$ but is ineffective


Moreover, the equation is nonlinear, we know nothing about the finiteness or countability of the dimension of the solution space,
Thank you in advance for you help,
 A: *Hint:*$$y''=\frac{dy'}{dx}=\frac{dy'}{dy}.\frac{dy}{dx}=y'.\frac{dy'}{dy}=\frac{K}{y^2}$$ then separation of $y$ and $y'$ i.e. 
$$\int y'.dy'=\int\frac{K}{y^2}dy
\\\frac{(y')^2}{2}=\frac{-K}{y}+c
\\ y'=\pm\sqrt{2c-2\frac{K}{y}}
\\\int\frac{dy}{\pm\sqrt{2c-2\frac{K}{y}}}=\int dx$$
A: It is hard to obtain an explicit solution $y=y(t)$ to your equation (it is better to name the independent variable $t$, not $x$, as I will explain below). But you can write a nice parametrization for the graphs of the solutions in the $(t,y)$ plane. Fot $K<0$, these are famous curves called cycloids. 
Your equation is a special case of a class of 2nd order ODE for a single function $y(t)$, of the form $\ddot y=f(y)$, called "Newton's Second Law" (the dots denote derivatives with respect to $t$; in your case $f(y)=K/y^2$), for which a good trick has been invented, called "Conservation of Energy". 
The trick: Let us find a function $V(y)$ such that $f(y)=-V'(y)$ (a prime denotes derivative with respect to $y$). That is, just integrate $f(y)$ with respect to $y$. $V$ is well-defined up to an additive constant, just pick any (in your case $V=K/y$ will do).  
Theorem ("Conservation of Energy"): Let $y(t)$ be a solution of $\ddot y=-V'(y)$. Then $E=(\dot y)^2/2+V(y)$ is a constant function (of $t$). Conversely, any solution $y(t)$ of $(\dot y)^2/2+V(y)=const.$ is a solution of $\ddot y=-V'(y)$.
The proof is immediate, just show that $dE/dt=0$, using the chain rule. 
Now the equation $E=(\dot y)^2/2+V(y)=c$ (where $c$ is an arbitrary constant) is a first order separable ODE,  which, if you are lucky (very rarely),  can be solved explicitly. Even if you cannot solve it explicitly, you can usually draw the curves $E(y,v)=v^2/2+V(y)=c$ in the $(y,v)$ plane (called the "phase plane" of the DE), and get valuable information on the solutions of the original equation $\ddot y=f(y)$. 
In your case, the phase curves $E(y,v)=c$ are quite easy to draw and the pictures you get, for distinct values of $K$, are quite nice and instructive (please try it). 
As for solving explicitly in your case  the differential equation  $(\dot y)^2/2+K/y=c$,  you are "half lucky". After applying the Conservation of Energy trick, you end up, as was shown by another answer, with 
$$t=\pm\int_{y(0)}^{y(t)}\frac{dy}{\sqrt{2(c-\frac{K}{y})}},$$
which is messy to solve explicitly  for $y(t)$  (impossible with elementary functions). Fortunately,  there is a more elementary way out, with a pleasant surprise, known to few (in my experience; I have not seen it in any standard ODE textbook, but I am sure it is somewhere).  
I will sketch just one case, $K=-1$ (Newton's gravitational attraction law), $y(0)=1/2,$ $\dot y(0)=0$, hence $c=-2$ (you will see in a minute  why I picked $y(0)=1/2$).  Make the substitution $y=[\cos^2(\theta/2)]/2$ in the  integral above. You get, after some fiddling, $y(\theta)=(1+\cos \theta)/4,$ $t=(\theta+\sin\theta))/4$. 
This is a parametric representation  of a curve in the $(t,y)$ plane called a cycloid, the curve you get by placing  a  disc of radius $1/4$ on the $t$ axis, its center at $(0,1/4)$, and tracing the point on the disc initially at $(0,1/2)$ as the disc rolls without slipping along the $t$ axis. For other initial conditions and values of $K<0$ you get a curve that is obtained from this one by some stretching  along the $t$ and $y$ axis (at different rates), and some translation along the $t$ axis. You can check that for $K=-1$,  $\dot y(0)=0$ and $y(0)>0$, only for $y(0)=1/2$  there is such a nice "rolling" description of the graph of $y(t)$.
Another nice feature here is that we see that by appropriate time reparametrization $t=t(\theta)$, we can extend quite naturally solutions to the equation "beyond collision" ($y=0$). This is the basis of a standard trick in celestial mechanics, sometime called "the Levi-Civita regularization" of collision orbits. 
I hope all this is helpful and that you can fill-in the details (especially for  $K>0$).  
