Is mechanical energy conserved in all Inertial frames? (Newtonian Mechanics)

TLDR: In Newtonian mechanics the change in potential energy is frame independent and, in the absence of dissipation, total mechanical energy is conserved in all frames. The confusion you are encountering is not due to any problem with the definition of potential energy or mechanical energy, it is due to not considering the total mechanical energy.

Unfortunately, I must disagree with the other answer. This is a confusing topic, but it is incorrect that:

the work done by gravity (which is now also the change in potential energy)

The change in potential energy remains $mg\Delta h$ (where $h$ is the separation) although the work done by gravity does not. The potential energy must remain the same or you could create a perpetual motion machine by for example compressing a spring at rest and then releasing it while moving.

Let's investigate this more fully. For small changes in separation, $\Delta h$ between the ball and the earth the change in gravitational potential energy is $\Delta U = mg\Delta h$. Note that this potential energy does not belong to the ball itself, but rather to the ball-earth system. In other words, $\Delta h$ is not a property of the ball only, but a property of the ball-earth system, the configuration of the two. That means that if you are considering the gravitational potential energy then you must consider the entire system of both the ball and the earth. The other analyses omitted the earth.

The mechanical energy is the sum of the kinetic energy of the Earth, the kinetic energy of the ball, and the potential energy, $E=T_E+T_B+U$, where $T_E=\frac{1}{2}M V^2$, $T_B=\frac{1}{2} m v^2$, and $U=mgh$. In a frame where the earth and ball are initially moving at $u$ it can be shown that $$T_E(t)=\frac{1}{2}Mu^2+mgut+\frac{1}{2}\frac{m^2}{M}g^2 t^2$$ $$T_B(t)=\frac{1}{2}mu^2-mgut+\frac{1}{2}mg^2 t^2$$ $$U(t)=mgh_0 - \frac{1}{2}\left(\frac{m^2}{M}+m\right)g^2 t^2$$ $$E(t)=\frac{1}{2}(m+M)u^2+mgh_0=const.$$ So the total mechanical energy $E=T_E+T_B+U$ is conserved, but $T_B+U$ is not.

Given this, why is it that we can get away with using only $T_B+U$ in the frame where $u=0$? Note, if $m\ll M$ then the last term of $T_E$ drops out and it simplifies to $$T_E=\frac{1}{2}Mu^2+mgut$$ This is non-zero except in the case where $u=0$ and more importantly it changes over time if $u\ne 0$. So we can get away with the "cheat" because the Earth is much more massive than the ball and so that leads to $T_E=0=const.$ but only in the frame where $u=0$.


Normally we say that the change in potential energy of an object is $mg$ times the change in height, and we equate this change in potential energy with the work done by gravity on that object. This is true in a frame of reference which is stationary (or, at least, has zero vertical velocity) with respect to the earth - which is why it is very convenient to work in such a frame of reference, and we almost always do so.

However, in a frame of reference which has a non-zero vertical velocity with respect to the earth, $mg \Delta h$ is no longer equal to the work done by gravity, and we must go back to first principles.

For example, if an object with mass $m$ has initial velocity $u$ (upwards) with respect to the earth, then we could work in a frame of reference in which the object is initially stationary. We know that in this frame of reference the object's velocity at time $t$ is $-gt$, so its change in kinetic energy is $ \frac 1 2 m g^2 t^2$. Its displacement at time $t$ is $-\frac 1 2 g t^2$, so the work done by gravity on the object is

$(-mg) \times (- \frac 1 2 g t^2) = \frac 1 2 m g^2 t^2$

and so we see that the work done by gravity is equal to the change in kinetic energy, as we expect.

Alternatively, we could work in a frame of reference that is stationary with respect to the earth. In this frame the object has an initial kinetic energy of $\frac 1 2 mu^2$ and a final kinetic energy of $\frac 1 2 m (u-gt)^2$, so the change in kinetic energy is

$\frac 1 2 m \left( (u-gt)^2 - u^2 \right) = \frac 1 2 mg^2 t^2 - mugt$

In this frame the displacement of the object at time $t$ is $ut - \frac 1 2 gt^2$ so the work done by gravity (which is now also the change in potential energy) is

$(-mg) \times (ut - \frac 1 2 gt^2) = \frac 1 2 mg^2t^2 - mugt$

and, once again, we see that the work done by gravity is equal to the change in kinetic energy.

So the principle that the work done by gravity is equal to the change in kinetic energy (in the absence of friction or other dissipative forces) is true in both frames, although the value on each side of the equation is frame dependent.