Consider, the weight of hanging part (L/3) of chain = Mg/3
This weight acts at the centre of gravity of the hanging part, which is at a distance of (L/6) from the table.
Work done = force × distance
W = (Mg/3)(L/6)
W = MgL/18
Check out the video given below to know more about types of motion