Let λ be linear mass density of chain. To pull the chain we have to do work against the weight of hanging part of chain. Let at any instant length of hanging part be x. Therefore, the weight of hanging part of chain is F=λ×g The work done in pulling the chain by small distance dx is dW=−Fdx=−λrgdx
The work done to pull the whole of hanging part of chain is W=∫dW=