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.

 A: The work is dependent on the density distribution. Let's assume two extreme cases. We have one chain of length $L$, and all the mass $M$ is concentrated on one end of the chain (let's call this the heavy side). If you lift the chain from the heavy side until the light side just barely touches the ground, the work done is $MgL$. If you lift from the other side until the heavy side just barely reaches the ground, the work done is $0$.
A: 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$ 
