Position as function of time given velocity with respect to position. I have been able to solve this problem in a very clumsy way that I don't think is using the right steps.  In particular, I'm not sure where the assignments of the arbitrary constants are rightly applied. 

Question:
Find the position $s$ as a function of $t$ from the given velocity $v = ds/dt$. Evaluate the constant of integration so as to have $s=s_0$ when $t=0$.

$$v = \sqrt{2gs},\ \ \   (g = \text{constant}).$$

My attempt and issues with the problem has involved:

$$v=\frac{ds}{dt}=\sqrt{2gs}$$

$$s^{-1/2} ds = (2g)^{1/2} dt$$

$$d(2*s^{1/2}) = d(t*(\sqrt{2g}) + C$$

Now, I can convert that to:

$$s=(1/2)gt^2 + C$$

And when $s=s_0$ at $t=0$,

$$s=(1/2)gt^2 + s_0$$

Substituting the right side of the original equation $V=\sqrt{2gs}$ doesn't seem to work. On the other hand, I can see that

$$v=\frac{ds}{dt}= \sqrt{2gs} = gt$$

so I am thinking there may be an approach using that equality to determine $C$ as well.

UPDATE:

This is the stated answer, but I’m not sure of the steps for getting the $ t\sqrt{2gs_0}$ term into the equation:
$$s = s_0 + t\sqrt{2gs_0} + \frac12gt^2$$
We have

$$v=\frac{ds}{dt}=\sqrt{2gs} \implies \frac{ds}{\sqrt s}=\sqrt{2g}\, dt \implies 2\sqrt s=\sqrt{2g}\, t+c$$ 



Edit to help the OP step by step:

$$\implies 4s=2gt^2+2c\sqrt{2g}\, t+c^2 \implies  s=\frac12gt^2+\frac12c\sqrt{2g}\, t+\frac14c^2$$

and from $s(0)=s_0$ we obtain $\frac14c^2=s_0 \implies \frac12 c=\sqrt{s_0}$ and therefore

$$s=\frac12gt^2+\sqrt{2gs_0}\, t+s_0$$
We have

$$v=\frac{ds}{dt}=\sqrt{2gs} \implies \frac{ds}{\sqrt s}=\sqrt{2g}\, dt \implies 2\sqrt s=\sqrt{2g}\, t+c$$ 



Edit to help the OP step by step:

$$\implies 4s=2gt^2+2c\sqrt{2g}\, t+c^2 \implies  s=\frac12gt^2+\frac12c\sqrt{2g}\, t+\frac14c^2$$

and from $s(0)=s_0$ we obtain $\frac14c^2=s_0 \implies \frac12 c=\sqrt{s_0}$ and therefore

$$s=\frac12gt^2+\sqrt{2gs_0}\, t+s_0$$