A particle of mass $m$ moves on a straight line with its velocity varying with the distance travelled according to the equation $v=a \sqrt{x}$, where $a$ is a constant. Find the total work done by all the forces during a displacement from $x=0$ to $x=d$.