In special relativity, energy and momentum are not treated as separate unrelated quantities. They are combined into a
single four-vector called the four-momentum. For one particle, the four-momentum is written as
\[
\begin{aligned}
P^\mu &= \left(\frac{E}{c},\, p_x,\, p_y,\, p_z\right)
\end{aligned}
\]
The first component is the energy divided by the speed of light, and the remaining three components are the ordinary
spatial momentum vector. This form is useful because Lorentz transformations mix energy and momentum in the same way
that they mix time and space.
Invariant mass of one particle
The most important relativistic scalar built from four-momentum is the invariant mass. For a single particle, it is
defined by the relation
\[
\begin{aligned}
m_0^2 &= \frac{E^2}{c^4} - \frac{p^2}{c^2}
\end{aligned}
\]
where \(p = |\vec p|\). Rearranging gives the familiar energy-momentum identity
\[
\begin{aligned}
E^2 &= p^2 c^2 + m_0^2 c^4.
\end{aligned}
\]
This equation works for both massive and massless particles. For a massive particle, \(m_0 > 0\). For a photon,
\(m_0 = 0\), so the relation reduces to
\[
\begin{aligned}
E &= pc.
\end{aligned}
\]
Systems of particles
For a system containing several particles, the total four-momentum is the vector sum of the individual four-momenta:
\[
\begin{aligned}
P_{\text{tot}}^\mu &= \sum_i P_i^\mu \\
&= \left(\frac{\sum_i E_i}{c},\, \sum_i p_{x,i},\, \sum_i p_{y,i},\, \sum_i p_{z,i}\right).
\end{aligned}
\]
This is the key step for collisions and particle creation problems. Even if the individual particles are massless, the
system as a whole can have nonzero invariant mass. That happens because invariant mass depends on the
total energy and the total momentum together, not just on the particle-by-particle rest masses.
System invariant mass. Apply the same invariant formula to the total four-momentum.
\[
\begin{aligned}
m_{0,\text{sys}}
&= \sqrt{\frac{E_{\text{tot}}^2}{c^4} - \frac{|\vec p_{\text{tot}}|^2}{c^2}}
\end{aligned}
\]
The quantity \(m_{0,\text{sys}}\) is Lorentz invariant. Every observer, regardless of their inertial frame, will
compute the same value from the system’s total four-momentum.
Head-on photon collision example
A classic example is two photons colliding head-on. Suppose each photon has energy \(E\). Photon 1 travels in the
\(+x\) direction and photon 2 travels in the \(-x\) direction. Since photons satisfy \(p = E/c\), their momenta are
\[
\begin{aligned}
p_{x,1} &= +\frac{E}{c}, \\
p_{x,2} &= -\frac{E}{c}.
\end{aligned}
\]
The total energy is
\[
\begin{aligned}
E_{\text{tot}} &= E + E = 2E,
\end{aligned}
\]
and the total momentum is
\[
\begin{aligned}
p_{x,\text{tot}} &= \frac{E}{c} - \frac{E}{c} = 0.
\end{aligned}
\]
Therefore the invariant mass of the two-photon system is
\[
\begin{aligned}
m_{0,\text{sys}}
&= \sqrt{\frac{(2E)^2}{c^4} - 0} \\
&= \frac{2E}{c^2}.
\end{aligned}
\]
This is an important relativistic result: each photon individually has zero rest mass, but the pair can still have a
nonzero invariant mass if their total momentum is not equal to the total energy divided by \(c\). In collider physics,
this is exactly why the invariant mass of a system is so useful. It tells you the mass scale available for creating new
particles in a collision.
Why invariant mass matters
Invariant mass is widely used because it is independent of the observer’s frame. The total energy alone changes between
inertial frames, and the total momentum also changes, but the combination
\(\frac{E_{\text{tot}}^2}{c^4} - \frac{|\vec p_{\text{tot}}|^2}{c^2}\) stays the same. That is why experimental
particle physicists often reconstruct unknown particles by measuring the four-momenta of the detected decay products and
then computing the system invariant mass.
Core formulas. These are the main relations used by the calculator.
\[
\begin{aligned}
P^\mu &= \left(\frac{E}{c},\, \vec p\right), \\
P_{\text{tot}}^\mu &= \sum_i P_i^\mu, \\
m_0 &= \sqrt{\frac{E^2}{c^4} - \frac{p^2}{c^2}}, \\
m_{0,\text{sys}} &= \sqrt{\frac{E_{\text{tot}}^2}{c^4} - \frac{|\vec p_{\text{tot}}|^2}{c^2}}.
\end{aligned}
\]
At a more advanced university level, the next step is to connect this directly to particle decays, center-of-momentum
frames, and Mandelstam variables used in scattering theory.