# How does the math of storing energy in a spring work in a moving frame?

Consider a spring with spring constant $k$ attached at one end to a wall. When an external force stretches it by distance $l$ in the positive direction the force does work $\frac{1}{2}kl^2$ and that energy is stored in the spring as elastic potential energy.

Let the stretching take place uniformly over a time $t$ for definiteness.

If this operation is viewed by an observer moving at velocity $v$ with respect to the lab, the starting and ending position of the stretching operation will appear to be different, say $0$ and $l - vt$, but the average force exerted on the spring would remain $\frac{1}{2}kl$, which seems to make the work done (and energy stored in the spring) $$W = \left(\frac{1}{2}kl\right) \cdot (l - vt) \;.$$

How is this (potentially vast) difference reconciled?

• I know this is a fairly elementary exercise, but it seems to be causing some confusing in the comments of another question. – dmckee --- ex-moderator kitten Nov 6 '16 at 18:12
• @sammygerbil Hmmm ... first the answer where the comments were and then the question itself was deleted. for the record the link (10k rep only) is physics.stackexchange.com/q/290723. – dmckee --- ex-moderator kitten Nov 7 '16 at 18:14

In the moving frame the "fixed" end of the spring moves over a distance $$-vt$$, always exerting the same magnitude force as that applied, but in the negative direction so the work \begin{align*} W_\text{fixed} &= \left(-\frac{1}{2} kl\right) \cdot (-vt) \\ &= +\frac{1}{2} klvt \;. \end{align*}
That makes the net work done to the spring $$W_\text{net} = \left(\frac{1}{2}kl(l - vt)\right) + \left(\frac{1}{2} klvt\right) = \frac{1}{2} kl^2 \;,$$ just as before.
• Thanks for editing. I have a doubt. Can we just directly take the final length of spring and initial length of spring to find the net elongation seen by the moving observer ? After that just use $W= \frac{1}{2}kx^2$... where $x$ is the elongation. In any constant velocity frame the extension in the spring will be same... – user131786 Nov 6 '16 at 19:09