Is $E^2-P^2=m^2$ true only for free particles? I'm studying Friedman and Susskind's Special Relativity and Classical Field Theory and follow them in using $c=1$.
They derive the above relation by first using Lagrangian of a free particle $\mathcal L=-m\sqrt{1-v^2}$ to show that conjugate momenta are given by $P^i = mU^i$ (where $U^\mu$ is the 4-velocity). Then they write out the Hamiltonian for the free particle using this Lagrangian and show that $H=mU^0$. Then writing $E$ for $H$ and since $U^\mu$ is a 4-vector and $m$ a scalar, they conclude that the quadruple $(E, P^1, P^2, P^3)$ forms a 4-vector. Then they use the invariance of the norm of the this 4-vector to show that $E^2 - P^2 = m^2$ (by observing the free particle in its rest frame, which is possible only since the particle was free to start with, otherwise there'd be no inertial frame in which the particle is seen at rest always).
Now the entire argument above was for a free particle. My question is whether the oft-used relation $E^2-P^2=m^2$ (or a modification thereof) also valid for a non-free particle (by which I mean a particle whole Lagrangian differs by that of a free particle).

Edit:
I realized (thanks to probably_someone in a comment below) that the original argument that the authors give is slightly different than mine. They multiply the equation $(U^0)^2-(U^i)^2 = 1$ with $m^2$ to yield $E^2-P^2=m^2$. Nevertheless, I still like my argument better. :)
 A: There used to be an answer here that incorrectly claimed that in the electromagnetic field, this equation is modified as $(p_{\mu} - q A_{\mu})(p^{\mu} - q A^{\mu}) = m^2$. The author of that answer realized it was incorrect after seeing my comments and deleted the answer.
In short, $p_{\mu} p^{\mu} = m^2$ is the fundamental kinematical relation that is valid for any massive object in special relativity. There may be external forces exerted on that object, which doesn't change this relation.
In the electromagnetic field with potential $A_{\mu}$, the definition of the canonical momentum shifts by
$$
p_{\text{canonical}}^{\mu} = p^{\mu} + q A^{\mu}.
$$
Hence, the relation $p_{\mu} p^{\mu} = m^2$ can be rewritten as
$$
(p_{\text{canonical}\;\mu} - q A_{\mu})(p_{\text{canonical}}^{\mu} - q A^{\mu}) = m^2.
$$
However, the canonical momentum, though a good variable for describing the system with Hamiltonian mechanics, is not a meaningful variable physically. For instance, it isn't gauge invariant.
The physical momentum $p_{\mu} = m u_{\mu}$ still obeys the same relation $p_{\mu} p^{\mu} = m^2$. In fact, it follows trivially from its definition together with $u_{\mu} u^{\mu} = 1$, which in turn follows from the definition of 4-velocity $u^{\mu}$:
$$
u^{\mu} = \frac{dx^{\mu}}{ds},
$$ $$
u^{\mu} u_{\mu} = \frac{dx^{\mu} dx_{\mu}}{ds^2} = 1.
$$
A: It does depend on what is meant by P, and E.
If $E^2=P^2-m^2$, even with forces, the particle would have a constant velocity.
I think that the canonical forms are more commonly used, so
$(E-V)^2=({\bf P}-q{\bf A})^2+(m+S)^2$, with $\bf P$ the canonical momentum,
and $(V,{\bf A})$and S vector and scalar potentials.
