Q:

Differential equation for describing a falling chain

I'm trying to solve a problem which involves finding the final velocity of a chain as it falls off a table.
A chain of uniform mass is on a table with negligible friction. Length $b$ hangs off the table and length $a$ is on the table. Find the velocity as the last link leaves the table.
$$F = mg = \frac{dP}{dt}$$
$$\frac{\partial{m}}{\partial{t}} = \dot{m}v$$
$$\frac{\partial{m}}{\partial{t}} = ma$$
Therefore
$$mg = \dot{m}v + ma.$$
I assume that if I can solve this equation then that'll lead to the solution of this problem. However, the equation involves a first and second order derivative. I've never solved one of these before.
What is the right way to go about completing the problem?

A:

You can just use conservation of energy.  The length $b$ has moved downward by $a$ at the time the last link falls.  The length $a$ has moved downward by $\frac a2$ at the time the last link falls.  If we assume the linear density is $1$ (a different value will divide out) we have lost $g(ab+\frac {a^2}2)$ in potential energy.  We have gained $\frac 12v^2(a+b)$ in kinetic energy.  These must be equal, so 
$$g\left(ab+\frac {a^2}2\right)=\frac 12(a+b)v^2\\
v=\sqrt{\frac{2g\left(ab+\frac {a^2}2\right)}{a+b}}$$

