Massless particles in the Lagrangian formalism of special relativity In the Lagrangian picture of special relativity we usually define the action $$S = -mc^2 \int d\tau.$$ This is clearly 0 for massless particles, so it says absolutely nothing about their motion. Despite that, from this Lagrangian we obtain momentum and energy (after passing to the Hamiltonian) and eventually conclude $$E^2 = m^2c^4 + {\bf p}^2c^2$$ and then use this identity even for massless particles. Why is this fair?
 A: *

*It seems overkill to use the Lagrangian formalism to prove the relativistic dispersion relation. It follows just from

*

*(i) that the 4-momentum $p^{\mu}$ is a 4-vector and


*(ii) that the invariant/rest mass times $c$ is equal to the length of the momentum 4-vector$^1$.




*Nevertheless, if OP is not satisfied by a continuity argument $m\to 0$, and if OP wants to pursuit the Lagrangian formalism, then one should use a manifestly Lorentz-covariant Lagrangian
$$L~=~-\frac{\dot{x}^2}{2e}-\frac{e (mc)^2}{2} \tag{L}$$
that works for both massless & massive point particles, cf. e.g. this Phys.SE post. One may show that the corresponding Hamiltonian Lagrangian is
$$L_H~=~p_{\mu}\dot{x}^{\mu}-\underbrace{\frac{e}{2}((mc)^2-p^2)}_{\text{Hamiltonian}}, \tag{H}$$
cf. e.g. this Phys.SE post. The EL equation for the auxiliary field $e$ yields precisely the sought-for mass-shell condition
$$p^2~=~(mc)^2,\tag{M}$$
even in the massless case.
--
$^1$ In this answer the Minkowski signature is assumed to be $(+,-,-,-)$.
