Solution (source code)

= Solution

Use <Minkowski metric> $g_{\mu\nu}=\operatorname{diag}(-1,1,1,1)$ and units with the <speed of light> equal to one. Thus $u^\mu u_\mu=-1$, and $h_{\mu\nu}=g_{\mu\nu}+u_\mu u_\nu$ is the <spatial projector of a timelike congruence>. Keep the medium velocity fixed when varying the <electromagnetic four-potential>. Since the <electromagnetic field tensor> is $F_{\mu\nu}=\partial_\mu A_\nu-\partial_\nu A_\mu$, its variation gives
$$
\delta_A S=\int d^4x\,\frac12(M^{\mu\nu}-F^{\mu\nu})(\partial_\mu\delta A_\nu-\partial_\nu\delta A_\mu)
=\int d^4x\,(M^{\mu\nu}-F^{\mu\nu})\partial_\mu\delta A_\nu.
$$
Both <tensors> are antisymmetric. <Integration by parts>, with variations vanishing at the boundary, therefore gives
$$
\delta_A S=\int d^4x\,\partial_\mu(F^{\mu\nu}-M^{\mu\nu})\delta A_\nu.
$$
The <Euler-Lagrange field equation> is $\partial_\mu(F^{\mu\nu}-M^{\mu\nu})=0$. Renaming the free index and using antisymmetry gives
$$
\boxed{\partial_\nu F^{\mu\nu}=\partial_\nu M^{\mu\nu}.}
$$
These are the inhomogeneous <Maxwell equations> with the <bound charge and bound current> encoded by the <polarization-magnetization tensor>.