Conservation of Energy in Different Frames Supposed we have a spring-mass system on a train moving at a velocity $V$.
The conservation of mass equation in the frame on the moving train is: $$\frac{1}{2}kx_0^2=\frac{1}{2}mv^2+\frac{1}{2}kx^2$$ where $x_0$ is the initial extension of the spring and $v$ is the velocity of the mass in the moving frame. We get $$v = \pm\sqrt{\frac{k}{m}(x_0^2-x^2)}$$
However, if we shift to the lab frame, we get this conservation of energy equation instead: $$\frac{1}{2}kx_0^2+\frac{1}{2}mV^2=\frac{1}{2}m(v+V)^2+\frac{1}{2}kx^2$$
This would get a different equation for $v$: $$v=-V\pm\sqrt{V^2+\frac{k}{m}(x_0^2-x^2)}$$
The two values are close but they are still quite different. Is there a way to rationalise this discrepancy? Could it possibly be because there is some force somewhere doing work that was not doing work in the moving frame?
 A: I find that in even moderately complicated cases it is best to use the Lagrangian approach. It also helps to be very clear about the meaning of the variables. So in this problem $x$ is not the position of the mass, but rather the extension of the spring, and $v$ is not the velocity of the mass but $v=\dot x$ is the rate of change of the extension of the spring. Because of these definitions we expect that $x$ and $v=\dot x$ should be independent of $V$, the velocity of the train. Also we are assuming the initial conditions $x(0)=x_0$ and $\dot x(0)=0$.
Thus the Lagrangian is $$L=\frac{1}{2}m \left( \dot x + V \right)^2 - \frac{1}{2}k x^2 $$
This Lagrangian is independent of time so there is a conserved energy $$E=\frac{1}{2}m \dot x^2 - \frac{1}{2} m V^2+ \frac{1}{2}kx^2 = -\frac{1}{2}mV^2+\frac{1}{2}kx_0^2 $$
Now, note that the only term involving $V$ is the constant term which is on both sides of the energy equation. Therefore, when we solve the energy equation for $\dot x$ we get an expression which is independent of $V$ as follows $$\dot x = \pm \sqrt{\frac{k}{m}(x_0^2-x^2)}$$
Similarly, the Euler Lagrange equations give us $$-kx-m \ddot x = 0$$
So the equation of motion is also independent of $V$

Is there a way to rationalise this discrepancy?

The issue is that the expression you wrote as the conservation law in the lab frame is not correct. If we solve the equations of motion and plug in our initial conditions then we get $$ x(t)=x_0 \cos\left( t \sqrt{\frac{k}{m}} \right)$$ which we can substitute into your expression for the conservation of energy to get $$\frac{1}{2} m (\dot x+V)^2 + \frac{1}{2} k x^2 = \frac{1}{2} m V^2 + \frac{1}{2} k x_0^2 -  V x_0 \sqrt{k m} \ \sin\left( t \sqrt{\frac{k}{m}} \right) $$ which is not constant and therefore cannot represent a conserved energy.
A: Starting from the $2^{nd}$ law: $F = ma$, we have in the case of the spring in the moving frame:
$$-kx = m\frac{dv}{dt} \implies -kxdx = mdv\frac{dx}{dt} \implies d\left(\frac{1}{2}kx^2 + \frac{1}{2}mv^2\right) = 0$$
So, $$\frac{1}{2}kx^2 + \frac{1}{2}mv^2 = cte$$
That is why it is possible to take this quantity as conserved.
But when we use the same procedure for the lab frame:
$$-k(x'-Vt) = m\frac{d(v'-V)}{dt} \implies -k(x'-Vt)dx' = md(v'-V)\frac{dx'}{dt} $$
The expression develops as:
$kx'dx' + mv'dv' = kVtdx'$
$$d\left(\frac{1}{2}kx'^2 + \frac{1}{2}mv'^2\right) \neq  0$$
The similar expression for the lab coordinates is not a conserved quantity. So, it is not possible to use conservation of energy as OP has done to get the second expression for $v$.
