I have a problem understanding what is going wrong with a simple derivation for strain energy. Problem: Assume a prismatic bar of length L where the elastic region is assumed. If it is hanging vertically its own weight produces some strain. If all the work goes into strain energy the derivation in Gere's book (and everywhere else) for any load on a bar is: U= [tex]\int[/tex]P(x)^2dx/2EA Equation 1 Where U is the Strain energy, P(x) is the load as a function of x (where say x is the vertical axis in which teh bar is hanging), E is teh elastic modulus and A is the area of the bar. Now, for the case of the load being the weight my procedure (that doesn't work) is teh following: P(x)= yA(L-x) Equation 2 where P(x) is teh weight of the bar at a height x. y is the weight density. L is the length of teh bar and L-x is the length of teh bar contributing to the stran in an elementary volume at x. Now if U= Work done by the load. We can write W=[tex]\int[/tex]P(x)ds Equation 3 where s is the displacement or deformation in the x direction. If we introduce Eq 3 into 2 and chnage ds by dx from the following equation: ds= dx/EA P(x) Equation 4 , we get U= y^2AL^2/2E instead of 6E as it should. My question. That has to do with Equation 4 right?