Solution (source code)

= Solution

The required invariant is obtained by <tensor contraction>, rather than by an ordinary sum of squares of the entries of the <electromagnetic field tensor>. With $\eta_{\mu\nu}=\operatorname{diag}(1,-1,-1,-1)$, raising both indices gives
$$
F^{0i}=-F_{0i},\qquad F^{ij}=F_{ij}\quad(i,j=1,2,3).
$$
The <electromagnetic field tensor> is an <antisymmetric second-rank tensor>, so every independent off-diagonal entry occurs twice in its contraction. The three electric contributions each acquire a minus sign, whereas the magnetic contributions retain their sign. Consequently
$$
F_{\mu\nu}F^{\mu\nu}
=2\left[(B^1)^2+(B^2)^2+(B^3)^2
-\frac{(E^1)^2+(E^2)^2+(E^3)^2}{c^2}\right].
$$
All indices are contracted, so this quantity is a <Lorentz scalar>. Since the <speed of light> is invariant,
$$
\boxed{c^2|\mathbf B|^2-|\mathbf E|^2=\frac{c^2}{2}F_{\mu\nu}F^{\mu\nu}}
$$
is <Lorentz invariant>. Both terms have the units of squared <electric field>, $\mathrm{V^2\,m^{-2}}$ in SI units.