Maximum extension of a vertical spring when given a blow In the question mentioned above , i considered the length of the spring in the equilibrium position to be the natural length and the P.E. to be zero as we are free to consider any length as the natural length. After , giving a blow , we impart K.E. to the block equal to $ 0.5m v^2$. Lets say it moves down through a distance x , then , decrease in gravitational P.E. = $mgx$ and elastic P.E.= $0.5k x^2 $.
Hence , the equation becomes, . But it does not give the correct answer. 
I think that we should neglect gravity but why ?
 My textbook says: 
 A: You should ignore the gravitational contribution since you are assuming that the initial position is the equilibrium position.
Adding the effect of gravity will shift the equilibrium position to a new height.
A: No, you should not neglect the change in gravitational PE.
There are 2 mistakes in your equation.


*

*The last term is incorrect. This should be the increase in elastic PE stored in the spring, between the equilibrium position and the maximum extension. This increase is not $\frac12 kx^2$ but $\frac12 k((x_0+x)^2-x_0^2)$ where $x_0$ is the equilibrium extension so $kx_0=mg$. 

*The term $mgx$ should appear on the LHS. The initial KE imparted by the blow, and the gravitational PE lost when falling to the lowest point, are together converted to extra elastic PE stored in the spring :
$\frac12 mv^2+mgx=\frac12 k((x_0+x)^2-x_0^2)$.
The 1st mistake comes from your assumption :

I considered the length of the spring in the equilibrium position to be the natural length and the P.E. to be zero as we are free to consider any length as the natural length.

This assumption is ok for gravitational PE, which is proportional to $x$, but not for elastic PE, which is proportional to $x^2$. In the latter case $x$ must be measured from the natural length (as the textbook says). Assuming that some other length is the natural length gives the wrong answer. For example, an increase from $0$ to $x$ stores PE of $\frac12 kx^2$ whereas an increase from $x$ to $2x$ stores PE of $\frac12k((2x)^2-x^2)=\frac32x^2$, which is 3 times as much.     
A: It is easiest to work this out in terms of force balances first.  Let $x_0$ be the unextended length of the spring and $x_1$ be the length before the sharp blow.  Then, initially the force balance on the mass is:  $$0=mg-k(x_1-x_0)\tag{1}$$  After the sharp blow, the force balance is given by:$$m\frac{dv}{dt}=mg-k(x-x_0)\tag{2}$$
If we subtract Eqn. 1 from Eqn. 2, we obtain:
$$m\frac{dv}{dt}=-k(x-x_1)\tag{3}$$Note that mg is not present in this equation, and $x-x_1$ represents the downward displacement relative to the equilibrium position prior to the sharp blow.  Thus, by combining these two equations, we find that the potential energy is essentially removed from the problem.
If we multiply both sides of this equation by $v=dx/dt$, we obtain:  $$mv\frac{dv}{dt}=-k(x-x_1)\frac{dx}{dt}$$Integrating this with respect to t gives:$$\frac{1}{2}m(v^2-v_0^2)=-\frac{1}{2}k(x-x_1)^2\tag{4}$$When v = 0, this equation gives:
$$mv_0^2=k(x-x_1)^2\tag{5}$$
We can also obtain this equation by multiplying Eqn. 2 by $v=dx/dt$ and integrating:
$$\frac{1}{2}m(v^2-v_0^2)=mg(x-x_1)-\frac{1}{2}k[(x-x_0)^2-(x-x_1)^2]$$
THIS IS THE WAY THE ORIGINAL ENERGY BALANCE ON THE SYSTEM SHOULD HAVE BEEN WRITTEN.
This equation tells us that the change in kinetic energy plus the change in stored elastic energy in the spring is equal to the change in potential energy.  Rewriting $x-x_0$ in the second term on the right as $$(x-x_0)=(x-x_1)+(x_1-x_0)$$ we obtain:
$$\frac{1}{2}m(v^2-v_0^2)=mg(x-x_1)-\frac{1}{2}k[(x-x_1)^2+2(x-x_1)(x_1-x_0)]\tag{6}$$But, from Eqn. 1, $$mg(x-x_1)=k(x-x_1)(x_1-x_0)$$Substituting this into Eqn. 6 gives Eqn. 5.
A: The diagram below is to help you understand what the author of the textbook is trying to explain.
 
The static equilibrium extension is $x_o$ so $kx_o = mg$
The gravitational potential energy (gpe) is taken to be zero at the equilibrium position and so for an extension $x$ measured from the equilibrium position the gravitational potential energy ranges between $\pm mgx$ as shown in the diagram.  
If one takes the elastic potential energy (epe) to be zero when the spring is unextended then the elastic potential energy ranges between $\frac 12 k (x_o-x)^2$ and $\frac 12 k (x_o+x)^2$ with a value of $\frac 12 k x_o^2$ at the equilibrium position.
Using the relationship $kx_o = mg$ you find that the total (gravitational + elastic) potential energy of the spring-mass system ($\frac 12 k (x_o-x)^2 +mgx$ and $\frac 12 k (x_o+x)^2 -mgx$) ranges between $\frac 12 kx_o^2$ and $\frac 12 kx_o^2 + \frac 12 kx^2$.
So why not make the equilibrium position the zero of elastic potential energy by subtracting $\frac12 k x_o^2$ from each of the elastic potential energies to give a total potential energy of the spring-mass system which ranges from zero at the equilibrium position and $\frac 12 k x^2$ when the "extension" of the spring is $x$ from its equilibrium position.
The since the total energy (potential plus kinetic) at the equilibrium position was $\frac 12 mv^2$ this must equal to total potential energy when the kinetic energy is zero when the extension of the spring from the equilibrium position is $x$ which is $\frac 12 k x^2$.
