Is the potential energy stored in a spring proportional to the displacement or the square of it?

Suppose a mass of $$M$$ kg is hanging from a spring in earth. The mass will stretch the spring about $$x$$ m. So the change in the gravitational potential energy is $$mgx$$ J (supposing $$x$$ to be very small compared to the radius of earth).

And this amount of energy will be stored in the spring as potential energy. So,

Change of gavitational energy = $$mgx$$ = potential energy stored in the spring

And it seems that the potential energy stored in a spring is proportional to displacement $$x$$. But the potential energy in a spring is $$U=\frac{1}{2}kx^{2}$$ and so it's proportional to $$x^2$$, the square of displacement. So surely I am wrong somewhere. But where am I wrong?

• @maverick If net work isn't zero, will energy be conserved? Apr 30, 2020 at 17:07
• @ Theoretical you ignored Kinetic energy the mass would oscillate Apr 30, 2020 at 17:08
• @ Theoretical I was just about to give answer, so deleted my earlier comment which was vaguely answering your question Apr 30, 2020 at 17:10
• "The mass will stretch the spring about 𝑥 m. So the change in the gravitational potential energy is 𝑚𝑔𝑥 J". This is not the case. Suppose you attach the mass to the unstretched spring, and put your hand underneath it while it comes to its equilibrium position, so that it doesn't overshoot. Work will be done by the mass on your hand as well as on the spring. It's easy to show that the spring gets $\tfrac12 mgx$. Without your hand, the mass would gain kinetic energy, which would be dissipated eventually by air resistance, leaving the spring when the mass comes to rest with $\tfrac12 mgx$. Apr 30, 2020 at 17:12
• @Theoretical (1) At equilibrium, spring energy = $\tfrac12 kx^2$. But at equilibrium, there is no resultant force so $mg=kx$. Therefore spring energy =$\tfrac12 mgx$. It gets this energy as the falling mass does work on it. (2) In the absence of air resistance (or a restraining hand) the mass will continue to oscillate about its equilibrium position, with $\tfrac12 mgx$ of KE as it passes each time through the equilibrium position. At the top and bottom of the oscillation the combined $extra$ PE (elastic + gravitational) is $\tfrac12 mgx$. It is a good exercise to examine the PEs individually. Apr 30, 2020 at 18:20

Imagine that when you attach the mass to the unstretched spring you are holding the mass in you hand. You then gently lower the mass until the uplift $$kx_{\rm max}$$ of stretched spring just balances the dowward weight $$mg$$ of the mass. Gravity has done work to stretch the spring, but the net downward force at stretch $$x$$ $$F(x)=mg - kx$$ has also done work $$\int_0^{x_{\rm max}} (mg-kx)dx = mgx_{\rm max}-\frac 12 kx_{\max}^2$$ on your hand. Thus the difference in your two formulae $$mgx_{\rm max} - \frac 12 kx^2_{\rm max}$$ is accounted for by the work done on you.

If you just attatch and let go, the mass would bounce up and down and ther would also be kinetic energy to keep track of.

• Thanks for pointing out the crucial clue. I hadn't accounted for the work done on my hand. Apr 30, 2020 at 17:17

If there is just the (ideal) spring and a mass, i.e., if there is no dissipation, the total energy $$E$$ of the system is constant and is the sum of three terms:

$$E = mgh + \frac{1}{2}kz^2 + \frac{1}{2}m\dot{z}^2 = U_g + U_s + T$$

where $$h$$ is the height of the mass from the ground (zero reference of gravitational potential energy), and $$z$$ is the displacement of the mass from the zero spring potential energy position.

If the initial position $$z_0$$ is the zero of the spring potential energy $$U_s(z_0) = 0$$, and if the initial kinetic energy $$T$$ is zero, then as the mass falls downward under the influence of gravity, the gravitational potential energy $$U_g$$ decreases while $$U_s$$ and $$T$$ increase just so that $$E$$ remains constant.

If, on the other hand, the system is damped (add a dashpot), then eventually the mass will stop at the equilibrium position, and the magnitude of the difference in the change of the potential energies will equal the energy dissipated by the damping mechanism.

Note: The potential energy stored in a spring is proportional to the square of the displacement from equilibrium.

When you attach a mass to an unstretched spring, there will be a new equilibrium position for that mass on that now-stretched spring. About this new equilibrium position, you will have simple harmonic motion.

You are correct that $$\text{change of gravitational energy} = mgx \ \ \ \ (= \text{potential energy stored in the spring}).$$ No mistake there. That only gets you halfway there though. It is ALSO true that $$\text{potential energy stored in the spring} = \frac{1}{2}kx^2 \ \ \ \ (= \text{change of potential energy}).$$ For both to be true, we must have $$mgx = \frac{1}{2}kx^2.$$ Solving for $$x$$, $$x = 2\frac{mg}{k}$$

Voilá.

I put the text on the right of those first two equations in parentheses, to emphasize that, while they are technically true, just to stop there is to argue in circles. You need both constraints to arrive at a unique solution.

Also, to be strict, the change in the gravitational energy (of the mass) is actually $$-mgx$$, not $$+mgx$$, and this is countered by the change in the potential energy of the spring. So really, $$\text{change of gravitational energy} = - (\text{potential energy stored in spring})$$ but the end result remains the same (the two minus signs cancel).

The elementary work $$dW$$ done on the spring in a elementary displacement $$dx$$ is:
$$dW = Fdx$$.

At this point the spring has already been stretched by $$x$$, so $$F = kx$$.
$$dW = kxdx$$.

Integrating from $$x=0$$ (the unstretched position) until the final $$x$$:
$$W = \frac{kx^2}{2}$$

$$\frac{kx^2}{2} = mgx$$, the loss of potential gravitational energy equals the stored elastic energy.