Q:

obtaining a force equation using the time derivative of energy

i saw this trick for obtaining a force equation but i don't understand why it works
lets suppose our system conserves energy then
$$E=U+E_{k}=const$$
$$\frac{dE}{dt}=\dot E_{k}-F=0$$
and then to obtain the motion we will solve
$$F=\dot E_{k}$$
which might be a differential equation or might not but as for why this works I'm stomped
usually we will solve $F=\frac{dp}{dt}$ to get the motion of the bodies in the system and i could be wrong here but
$$\dot E_{k}=\frac{1}{2} \dot m v^2+mva \ne \dot m v+ ma=\frac{dp}{dt}$$

A:

The issue is that your $\dot{E}_k$ is a derivative with respect to time, $t$. 
$\dot{U} \neq -F$!
$F = -\nabla U$, which is a spatial derivative, so by the chain rule:
$$ \dot{U} = \frac{\mathrm{d}U}{\mathrm{d}t} = \frac{\mathrm{d}U}{\mathrm{d}x}\frac{\mathrm{d}x}{\mathrm{d}t} = -Fv \qquad \text{i.e. the instantenous power.}$$
So your equation becomes:
$$ \dot{E} = 0 = -Fv +\dot{E}_k \implies F = \dot{E}_k/v,$$
so $$ F = \frac{1}{v} \left (\frac{1}{2}\dot{m}v^2 + mv\dot{v} \right ).$$
Which, for $\dot{m}  =0$, gives:
$$ F = m\dot{v}.$$
I think you will have to add another term to the energy in order for your mass $m$ to vary.  I can think of an example: a train sliding by intertia at constant velocity; it starts raining and its wagons slowly fills up with water, i.e. $\dot{m}>0$. By conservation of momentum it's trivial to show that its speed decreases, as it needs to accelerate the water at the same speed.  The work done to accelerate an object of mass $m$ to a speed $u$ is $1/2 mu^2$. So I think this is the extra term you'd have to add to the equation in order for it to add to the other half in my last line, and give $\mathrm{d}p/\mathrm{d}t$.  

