Question:- A uniform chain of length $l$ and mass $m$ is hanging vertically at edge of an inclined plane AB of length $l$ which is making an angle of $30$ degrees with horizontal. Find work done in pulling Chain slowly to AB.
Using concept of centre of mass and gravitational potential energy I was able to find work done as $\frac {3mgl}{4}$
I also tried to find total work done by calculating differential work done and then integrating it over desired limits.
$$W=\int dw=\int Fdx$$
According to me $$F=\frac{mgx}{l}+\frac {mg(l-x)}{2l}$$
But after integrating it over limits $-l$ to $0$. I got wrong answer.
How can I calculate correct value of $F$. Also can somebody tell me what is the significance of pulling chain slowly.