Get the work required to lift a chain A 3-m chain with linear mass density p(x)=?kg/m lies on the ground. Calculate the work required to lift the chain until it's fully extended.
My question is that, is the work that lift the chain from bottom equal to the work that lift the chain from top?
My understanding is that if the density is a constant, then the works are equal.
For example, if the p(x)=3.
The work is below

If the density is a variable, for example, $p(x)=2x(4-x)$, then the works are not equal.


One way to calculate the work is to look at all the small bits of chain $dm$.  Each bit is raised to a certain height $h$, so the bit of work is $gh\ dm$.  Now integrate along the chain using the known density per unit length, so $dm=\rho(x)dx$ and you get the total work to be $\int_0^3\rho(x)gx\ dx$.  This applies whether the chain is uniform or not.  
If you know the center of mass, you can just compute the work of lifting the mass of the chain to the height of the center of mass.  This is because the total mass is $M=\int_0^3\rho(x)\;dx$ and the position of the center of mass is just $\overline x=\frac 1M\int_0^3x\rho(x)\; dx$ 
