# Maxwell's equations in curved spacetime

In physics, Maxwell's equations in curved spacetime govern the dynamics of the electromagnetic field in curved spacetime (where the metric may not be the Minkowski metric) or where one uses an arbitrary (not necessarily Cartesian) coordinate system. These equations can be viewed as a generalization of the vacuum Maxwell's equations which are normally formulated in the local coordinates of flat spacetime. But because general relativity dictates that the presence of electromagnetic fields (or energy/matter in general) induce curvature in spacetime, Maxwell's equations in flat spacetime should be viewed as a convenient approximation.
When working in the presence of bulk matter, distinguishing between free and bound electric charges may facilitate analysis. When the distinction is made, they are called the macroscopic Maxwell's equations. Without this distinction, they are sometimes called the "microscopic" Maxwell's equations for contrast.
The electromagnetic field admits a coordinate-independent geometric description, and Maxwell's equations expressed in terms of these geometric objects are the same in any spacetime, curved or not. Also, the same modifications are made to the equations of flat Minkowski space when using local coordinates that are not rectilinear. For example, the equations in this article can be used to write Maxwell's equations in spherical coordinates. For these reasons, it may be useful to think of Maxwell's equations in Minkowski space as a special case of the general formulation.

## Summary

In general relativity, the metric tensor $g_{\alpha \beta }$ is no longer a constant (like $\eta _{\alpha \beta }$ as in Examples of metric tensor) but can vary in space and time, and the equations of electromagnetism in vacuum become
    ${\begin{aligned}F_{\alpha \beta }&=\partial _{\alpha }A_{\beta }-\partial _{\beta }A_{\alpha },\\{\mathcal {D}}^{\mu \nu }&={\frac {1}{\mu _{0}}}\,g^{\mu \alpha }\,F_{\alpha \beta }\,g^{\beta \nu }\,{\frac {\sqrt {-g}}{c}},\\J^{\mu }&=\partial _{\nu }{\mathcal {D}}^{\mu \nu },\\f_{\mu }&=F_{\mu \nu }\,J^{\nu },\end{aligned}}$
where $f_{\mu }$ is the density of the Lorentz force, $g^{\alpha \beta }$ is the inverse of the metric tensor $g_{\alpha \beta }$, and $g$ is the determinant of the metric tensor. Notice that $A_{\alpha }$ and $F_{\alpha \beta }$ are (ordinary) tensors, while ${\mathcal {D}}^{\mu \nu }$, $J^{\nu }$, and $f_{\mu }$ are tensor densities of weight +1. Despite the use of partial derivatives, these equations are invariant under arbitrary curvilinear coordinate transformations. Thus, if one replaced the partial derivatives with covariant derivatives, the extra terms thereby introduced would cancel out (see Manifest covariance § Example).

## Electromagnetic potential

The electromagnetic potential is a covariant vector A$_α$, which is the undefined primitive of electromagnetism. Being a covariant vector, its components transform from one coordinate system to another according to
    ${\bar {A}}_{\beta }({\bar {x}})={\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}A_{\gamma }(x).$

## Electromagnetic field

The electromagnetic field is a covariant antisymmetric tensor of degree 2, which can be defined in terms of the electromagnetic potential by $F_{\alpha \beta }=\partial _{\alpha }A_{\beta }-\partial _{\beta }A_{\alpha }.$
To see that this equation is invariant, we transform the coordinates as described in the classical treatment of tensors: ${\begin{aligned}{\bar {F}}_{\alpha \beta }&={\frac {\partial {\bar {A}}_{\beta }}{\partial {\bar {x}}^{\alpha }}}-{\frac {\partial {\bar {A}}_{\alpha }}{\partial {\bar {x}}^{\beta }}}\\&={\frac {\partial }{\partial {\bar {x}}^{\alpha }}}\left({\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}A_{\gamma }\right)-{\frac {\partial }{\partial {\bar {x}}^{\beta }}}\left({\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}A_{\delta }\right)\\&={\frac {\partial ^{2}x^{\gamma }}{\partial {\bar {x}}^{\alpha }\partial {\bar {x}}^{\beta }}}A_{\gamma }+{\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}{\frac {\partial A_{\gamma }}{\partial {\bar {x}}^{\alpha }}}-{\frac {\partial ^{2}x^{\delta }}{\partial {\bar {x}}^{\beta }\partial {\bar {x}}^{\alpha }}}A_{\delta }-{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial A_{\delta }}{\partial {\bar {x}}^{\beta }}}\\&={\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial A_{\gamma }}{\partial x^{\delta }}}-{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}{\frac {\partial A_{\delta }}{\partial x^{\gamma }}}\\&={\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}\left({\frac {\partial A_{\gamma }}{\partial x^{\delta }}}-{\frac {\partial A_{\delta }}{\partial x^{\gamma }}}\right)\\&={\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial x^{\gamma }}{\partial {\bar {x}}^{\beta }}}F_{\delta \gamma }.\end{aligned}}$
This definition implies that the electromagnetic field satisfies $\partial _{\lambda }F_{\mu \nu }+\partial _{\mu }F_{\nu \lambda }+\partial _{\nu }F_{\lambda \mu }=0,$ which incorporates Faraday's law of induction and Gauss's law for magnetism. This is seen from $\partial _{\lambda }F_{\mu \nu }+\partial _{\mu }F_{\nu \lambda }+\partial _{\nu }F_{\lambda \mu }=\partial _{\lambda }\partial _{\mu }A_{\nu }-\partial _{\lambda }\partial _{\nu }A_{\mu }+\partial _{\mu }\partial _{\nu }A_{\lambda }-\partial _{\mu }\partial _{\lambda }A_{\nu }+\partial _{\nu }\partial _{\lambda }A_{\mu }-\partial _{\nu }\partial _{\mu }A_{\lambda }=0.$
Thus, the right-hand side of that Maxwell law is zero identically, meaning that the classic EM field theory leaves no room for magnetic monopoles or currents of such to act as sources of the field.
Although there appear to be 64 equations in Faraday–Gauss, it actually reduces to just four independent equations. Using the antisymmetry of the electromagnetic field, one can either reduce to an identity (0 = 0) or render redundant all the equations except for those with {λ, μ, ν} being either {1, 2, 3}, {2, 3, 0}, {3, 0, 1}, or {0, 1, 2}.
The Faraday–Gauss equation is sometimes written $F_{[\mu \nu ;\lambda ]}=F_{[\mu \nu ,\lambda ]}={\frac {1}{6}}(\partial _{\lambda }F_{\mu \nu }+\partial _{\mu }F_{\nu \lambda }+\partial _{\nu }F_{\lambda \mu }-\partial _{\lambda }F_{\nu \mu }-\partial _{\mu }F_{\lambda \nu }-\partial _{\nu }F_{\mu \lambda })={\frac {1}{3}}(\partial _{\lambda }F_{\mu \nu }+\partial _{\mu }F_{\nu \lambda }+\partial _{\nu }F_{\lambda \mu })=0,$ where a semicolon indicates a covariant derivative, a comma indicates a partial derivative, and square brackets indicate anti-symmetrization (see Ricci calculus for the notation). The covariant derivative of the electromagnetic field is $F_{\alpha \beta ;\gamma }=F_{\alpha \beta ,\gamma }-{\Gamma ^{\mu }}_{\alpha \gamma }F_{\mu \beta }-{\Gamma ^{\mu }}_{\beta \gamma }F_{\alpha \mu },$ where Γ$^α$$_{βγ}$ is the Christoffel symbol, which is symmetric in its lower indices.

## Electromagnetic displacement

The electric displacement field D and the auxiliary magnetic field H form an antisymmetric contravariant rank-2 tensor density of weight +1. In vacuum, this is given by
    ${\mathcal {D}}^{\mu \nu }={\frac {1}{\mu _{0}}}\,g^{\mu \alpha }\,F_{\alpha \beta }\,g^{\beta \nu }\,{\frac {\sqrt {-g}}{c}}.$
This equation is the only place where the metric (and thus gravity) enters into the theory of electromagnetism. Furthermore, the equation is invariant under a change of scale, that is, multiplying the metric by a constant has no effect on this equation. Consequently, gravity can only affect electromagnetism by changing the speed of light relative to the global coordinate system being used. Light is only deflected by gravity because it is slower near massive bodies. So it is as if gravity increased the index of refraction of space near massive bodies.
More generally, in materials where the magnetization–polarization tensor is non-zero, we have
    ${\mathcal {D}}^{\mu \nu }={\frac {1}{\mu _{0}}}\,g^{\mu \alpha }\,F_{\alpha \beta }\,g^{\beta \nu }\,{\frac {\sqrt {-g}}{c}}-{\mathcal {M}}^{\mu \nu }.$
The transformation law for electromagnetic displacement is
    ${\bar {\mathcal {D}}}^{\mu \nu }={\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}\,{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}\,{\mathcal {D}}^{\alpha \beta }\,\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right],$
where the Jacobian determinant is used. If the magnetization-polarization tensor is used, it has the same transformation law as the electromagnetic displacement.

## Electric current

The electric current is the divergence of the electromagnetic displacement. In vacuum,
    $J^{\mu }=\partial _{\nu }{\mathcal {D}}^{\mu \nu }.$
If magnetization–polarization is used, then this just gives the free portion of the current
    $J_{\text{free}}^{\mu }=\partial _{\nu }{\mathcal {D}}^{\mu \nu }.$
This incorporates Ampere's law and Gauss's law.
In either case, the fact that the electromagnetic displacement is antisymmetric implies that the electric current is automatically conserved:
    $\partial _{\mu }J^{\mu }=\partial _{\mu }\partial _{\nu }{\mathcal {D}}^{\mu \nu }=0,$
because the partial derivatives commute.
The Ampere–Gauss definition of the electric current is not sufficient to determine its value because the electromagnetic potential (from which it was ultimately derived) has not been given a value. Instead, the usual procedure is to equate the electric current to some expression in terms of other fields, mainly the electron and proton, and then solve for the electromagnetic displacement, electromagnetic field, and electromagnetic potential.
The electric current is a contravariant vector density, and as such it transforms as follows:
    ${\bar {J}}^{\mu }={\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}J^{\alpha }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right].$
Verification of this transformation law: ${\begin{aligned}{\bar {J}}^{\mu }&={\frac {\partial }{\partial {\bar {x}}^{\nu }}}\left({\bar {\mathcal {D}}}^{\mu \nu }\right)\\[6pt]&={\frac {\partial }{\partial {\bar {x}}^{\nu }}}\left({\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]\right)\\[6pt]&={\frac {\partial ^{2}{\bar {x}}^{\mu }}{\partial {\bar {x}}^{\nu }\partial x^{\alpha }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}{\frac {\partial {\mathcal {D}}^{\alpha \beta }}{\partial {\bar {x}}^{\nu }}}\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }{\frac {\partial }{\partial {\bar {x}}^{\nu }}}\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]\\[6pt]&={\frac {\partial ^{2}{\bar {x}}^{\mu }}{\partial x^{\beta }\partial x^{\alpha }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial {\mathcal {D}}^{\alpha \beta }}{\partial x^{\beta }}}\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]{\frac {\partial {\bar {x}}^{\rho }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial {\bar {x}}^{\nu }\partial {\bar {x}}^{\rho }}}\\[6pt]&=0+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}J^{\alpha }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]{\frac {\partial {\bar {x}}^{\rho }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\rho }}}\\[6pt]&={\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}J^{\alpha }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]+{\frac {\partial {\bar {x}}^{\mu }}{\partial x^{\alpha }}}{\mathcal {D}}^{\alpha \beta }\det \left[{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\rho }}}\right]\left({\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}+{\frac {\partial {\bar {x}}^{\rho }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\rho }}}\right).\end{aligned}}$
So all that remains is to show that
    ${\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}+{\frac {\partial {\bar {x}}^{\rho }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\rho }}}=0,$
which is a version of a known theorem (see Inverse functions and differentiation § Higher derivatives). ${\begin{aligned}&{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }\partial x^{\beta }}}+{\frac {\partial {\bar {x}}^{\rho }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\rho }}}\\[6pt]=&{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\nu }}}{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial x^{\sigma }\partial x^{\beta }}}+{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\sigma }}}{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\nu }}}\\[6pt]=&{\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\nu }}}{\frac {\partial ^{2}{\bar {x}}^{\nu }}{\partial x^{\beta }\partial x^{\sigma }}}+{\frac {\partial ^{2}x^{\sigma }}{\partial x^{\beta }\partial {\bar {x}}^{\nu }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\sigma }}}\\[6pt]=&{\frac {\partial }{\partial x^{\beta }}}\left({\frac {\partial x^{\sigma }}{\partial {\bar {x}}^{\nu }}}{\frac {\partial {\bar {x}}^{\nu }}{\partial x^{\sigma }}}\right)\\[6pt]=&{\frac {\partial }{\partial x^{\beta }}}\left({\frac {\partial {\bar {x}}^{\nu }}{\partial {\bar {x}}^{\nu }}}\right)\\[6pt]=&{\frac {\partial }{\partial x^{\beta }}}\left(\mathbf {4} \right)\\[6pt]=&0.\end{aligned}}$

## Lorentz force density

The density of the Lorentz force is a covariant vector density given by $f_{\mu }=F_{\mu \nu }J^{\nu }.$
The force on a test particle subject only to gravity and electromagnetism is ${\frac {dp_{\alpha }}{dt}}=\Gamma _{\alpha \gamma }^{\beta }p_{\beta }{\frac {dx^{\gamma }}{dt}}+qF_{\alpha \gamma }{\frac {dx^{\gamma }}{dt}},$ where p$_α$ is the linear 4-momentum of the particle, t is any time coordinate parameterizing the world line of the particle, Γ$^β$$_{αγ}$ is the Christoffel symbol (gravitational force field), and q is the electric charge of the particle.
This equation is invariant under a change in the time coordinate; just multiply by $dt/d{\bar {t}}$ and use the chain rule. It is also invariant under a change in the x coordinate system.
Using the transformation law for the Christoffel symbol, ${\bar {\Gamma }}_{\alpha \gamma }^{\beta }={\frac {\partial {\bar {x}}^{\beta }}{\partial x^{\epsilon }}}{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial x^{\zeta }}{\partial {\bar {x}}^{\gamma }}}\Gamma _{\delta \zeta }^{\epsilon }+{\frac {\partial {\bar {x}}^{\beta }}{\partial x^{\eta }}}{\frac {\partial ^{2}x^{\eta }}{\partial {\bar {x}}^{\alpha }\partial {\bar {x}}^{\gamma }}},$ we get ${\begin{aligned}&{\frac {d{\bar {p}}_{\alpha }}{dt}}-{\bar {\Gamma }}_{\alpha \gamma }^{\beta }{\bar {p}}_{\beta }{\frac {d{\bar {x}}^{\gamma }}{dt}}-q{\bar {F}}_{\alpha \gamma }{\frac {d{\bar {x}}^{\gamma }}{dt}}\\[6pt]=&{\frac {d}{dt}}\left({\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}p_{\delta }\right)-\left({\frac {\partial {\bar {x}}^{\beta }}{\partial x^{\theta }}}{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}{\frac {\partial x^{\iota }}{\partial {\bar {x}}^{\gamma }}}\Gamma _{\delta \iota }^{\theta }+{\frac {\partial {\bar {x}}^{\beta }}{\partial x^{\eta }}}{\frac {\partial ^{2}x^{\eta }}{\partial {\bar {x}}^{\alpha }\partial {\bar {x}}^{\gamma }}}\right){\frac {\partial x^{\epsilon }}{\partial {\bar {x}}^{\beta }}}p_{\epsilon }{\frac {\partial {\bar {x}}^{\gamma }}{\partial x^{\zeta }}}{\frac {dx^{\zeta }}{dt}}-q{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}F_{\delta \zeta }{\frac {dx^{\zeta }}{dt}}\\[6pt]=&{\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}\left({\frac {dp_{\delta }}{dt}}-\Gamma _{\delta \zeta }^{\epsilon }p_{\epsilon }{\frac {dx^{\zeta }}{dt}}-qF_{\delta \zeta }{\frac {dx^{\zeta }}{dt}}\right)+{\frac {d}{dt}}\left({\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}\right)p_{\delta }-\left({\frac {\partial {\bar {x}}^{\beta }}{\partial x^{\eta }}}{\frac {\partial ^{2}x^{\eta }}{\partial {\bar {x}}^{\alpha }\partial {\bar {x}}^{\gamma }}}\right){\frac {\partial x^{\epsilon }}{\partial {\bar {x}}^{\beta }}}p_{\epsilon }{\frac {\partial {\bar {x}}^{\gamma }}{\partial x^{\zeta }}}{\frac {dx^{\zeta }}{dt}}\\[6pt]=&0+{\frac {d}{dt}}\left({\frac {\partial x^{\delta }}{\partial {\bar {x}}^{\alpha }}}\right)p_{\delta }-{\frac {\partial ^{2}x^{\epsilon }}{\partial {\bar {x}}^{\alpha }\partial {\bar {x}}^{\gamma }}}p_{\epsilon }{\frac {d{\bar {x}}^{\gamma }}{dt}}\\[6pt]=&0.\end{aligned}}$

## Lagrangian

In vacuum, the Lagrangian density for classical electrodynamics (in joules per cubic meter) is a scalar density ${\mathcal {L}}=-{\frac {1}{4\mu _{0}}}\,F_{\alpha \beta }\,F^{\alpha \beta }\,{\frac {\sqrt {-g}}{c}}+A_{\alpha }\,J^{\alpha },$ where $F^{\alpha \beta }=g^{\alpha \gamma }F_{\gamma \delta }g^{\delta \beta }.$
The 4-current should be understood as an abbreviation of many terms expressing the electric currents of other charged fields in terms of their variables.
If we separate free currents from bound currents, the Lagrangian becomes ${\mathcal {L}}=-{\frac {1}{4\mu _{0}}}\,F_{\alpha \beta }\,F^{\alpha \beta }\,{\frac {\sqrt {-g}}{c}}+A_{\alpha }\,J_{\text{free}}^{\alpha }+{\frac {1}{2}}\,F_{\alpha \beta }\,{\mathcal {M}}^{\alpha \beta }.$

## Electromagnetic stress–energy tensor

As part of the source term in the Einstein field equations, the electromagnetic stress–energy tensor is a covariant symmetric tensor $T_{\mu \nu }=-{\frac {1}{\mu _{0}}}\left(F_{\mu \alpha }g^{\alpha \beta }F_{\beta \nu }-{\frac {1}{4}}g_{\mu \nu }F_{\sigma \alpha }g^{\alpha \beta }F_{\beta \rho }g^{\rho \sigma }\right),$ using a metric of signature (−, +, +, +). If using the metric with signature (+, −, −, −), the expression for $T_{\mu \nu }$ will have opposite sign. The stress–energy tensor is trace-free: $T_{\mu \nu }g^{\mu \nu }=0$ because electromagnetism propagates at the local invariant speed, and is conformal-invariant.
In the expression for the conservation of energy and linear momentum, the electromagnetic stress–energy tensor is best represented as a mixed tensor density ${\mathfrak {T}}_{\mu }^{\nu }=T_{\mu \gamma }g^{\gamma \nu }{\frac {\sqrt {-g}}{c}}.$
From the equations above, one can show that ${{\mathfrak {T}}_{\mu }^{\nu }}_{;\nu }+f_{\mu }=0,$ where the semicolon indicates a covariant derivative.
This can be rewritten as $-{{\mathfrak {T}}_{\mu }^{\nu }}_{,\nu }=-\Gamma _{\mu \nu }^{\sigma }{\mathfrak {T}}_{\sigma }^{\nu }+f_{\mu },$ which says that the decrease in the electromagnetic energy is the same as the work done by the electromagnetic field on the gravitational field plus the work done on matter (via the Lorentz force), and similarly the rate of decrease in the electromagnetic linear momentum is the electromagnetic force exerted on the gravitational field plus the Lorentz force exerted on matter.
Derivation of conservation law: ${\begin{aligned}{{\mathfrak {T}}_{\mu }^{\nu }}_{;\nu }+f_{\mu }&=-{\frac {1}{\mu _{0}}}\left(F_{\mu \alpha ;\nu }g^{\alpha \beta }F_{\beta \gamma }g^{\gamma \nu }+F_{\mu \alpha }g^{\alpha \beta }F_{\beta \gamma ;\nu }g^{\gamma \nu }-{\frac {1}{2}}\delta _{\mu }^{\nu }F_{\sigma \alpha ;\nu }g^{\alpha \beta }F_{\beta \rho }g^{\rho \sigma }\right){\frac {\sqrt {-g}}{c}}+{\frac {1}{\mu _{0}}}F_{\mu \alpha }g^{\alpha \beta }F_{\beta \gamma ;\nu }g^{\gamma \nu }{\frac {\sqrt {-g}}{c}}\\&=-{\frac {1}{\mu _{0}}}\left(F_{\mu \alpha ;\nu }F^{\alpha \nu }-{\frac {1}{2}}F_{\sigma \alpha ;\mu }F^{\alpha \sigma }\right){\frac {\sqrt {-g}}{c}}\\&=-{\frac {1}{\mu _{0}}}\left(\left(-F_{\nu \mu ;\alpha }-F_{\alpha \nu ;\mu }\right)F^{\alpha \nu }-{\frac {1}{2}}F_{\sigma \alpha ;\mu }F^{\alpha \sigma }\right){\frac {\sqrt {-g}}{c}}\\&=-{\frac {1}{\mu _{0}}}\left(F_{\mu \nu ;\alpha }F^{\alpha \nu }-F_{\alpha \nu ;\mu }F^{\alpha \nu }+{\frac {1}{2}}F_{\sigma \alpha ;\mu }F^{\sigma \alpha }\right){\frac {\sqrt {-g}}{c}}\\&=-{\frac {1}{\mu _{0}}}\left(F_{\mu \alpha ;\nu }F^{\nu \alpha }-{\frac {1}{2}}F_{\alpha \nu ;\mu }F^{\alpha \nu }\right){\frac {\sqrt {-g}}{c}}\\&=-{\frac {1}{\mu _{0}}}\left(-F_{\mu \alpha ;\nu }F^{\alpha \nu }+{\frac {1}{2}}F_{\sigma \alpha ;\mu }F^{\alpha \sigma }\right){\frac {\sqrt {-g}}{c}},\end{aligned}}$
which is zero because it is the negative of itself (see four lines above).

## Electromagnetic wave equation

The nonhomogeneous electromagnetic wave equation in terms of the field tensor is modified from the special-relativity form to
    $\Box F_{ab}\ {\stackrel {\text{def}}{=}}\ F_{ab;}^{d}_{d}=-2R_{acbd}F^{cd}+R_{ae}F^{e}_{b}-R_{be}F^{e}_{a}+J_{a;b}-J_{b;a},$
where R$_{acbd}$ is the covariant form of the Riemann tensor, and $\Box$ is a generalization of the d'Alembertian operator for covariant derivatives. Using
    $\Box A^{a}={{A^{a;}}^{b}}_{b}.$
Maxwell's source equations can be written in terms of the 4-potential [ref. 2, p. 569] as
    $\Box A^{a}-{A^{b;a}}_{b}=-\mu _{0}J^{a}$
or, assuming the generalization of the Lorenz gauge in curved spacetime,
    ${\begin{aligned}{A^{a}}_{;a}&=0,\\\Box A^{a}&=-\mu _{0}J^{a}+{R^{a}}_{b}A^{b},\end{aligned}}$
where $R_{ab}\ {\stackrel {\text{def}}{=}}\ {R^{s}}_{asb}$ is the Ricci curvature tensor.
This is the same form of the wave equation as in flat spacetime, except that the derivatives are replaced by covariant derivatives and there is an additional term proportional to the curvature. The wave equation in this form also bears some resemblance to the Lorentz force in curved spacetime, where A$^a$ plays the role of the 4-position.
For the case of a metric signature in the form (+, −, −, −), the derivation of the wave equation in curved spacetime is carried out in the article.

## Nonlinearity of Maxwell's equations in a dynamic spacetime

When Maxwell's equations are treated in a background-independent manner, that is, when the spacetime metric is taken to be a dynamical variable dependent on the electromagnetic field, then the electromagnetic wave equation and Maxwell's equations are nonlinear. This can be seen by noting that the curvature tensor depends on the stress–energy tensor through the Einstein field equation
    $G_{ab}={\frac {8\pi G}{c^{4}}}T_{ab},$
where
    $G_{ab}\ {\stackrel {\text{def}}{=}}\ R_{ab}-{\frac {1}{2}}Rg_{ab}$
is the Einstein tensor, G is the Newtonian constant of gravitation, g$_{ab}$ is the metric tensor, and R (scalar curvature) is the trace of the Ricci curvature tensor. The stress–energy tensor is composed of the stress–energy from particles, but also stress–energy from the electromagnetic field. This generates the nonlinearity.

## Geometric formulation

In the differential geometric formulation of the electromagnetic field, the antisymmetric Faraday tensor can be considered as the Faraday 2-form $\mathbf {F}$. In this view, one of Maxwell's two equations is
    $\mathrm {d} \mathbf {F} =0,$
where $\mathrm {d}$ is the exterior derivative operator. This equation is completely coordinate- and metric-independent and says that the electromagnetic flux through a closed two-dimensional surface in space–time is topological, more precisely, depends only on its homology class (a generalization of the integral form of Gauss law and Maxwell–Faraday equation, as the homology class in Minkowski space is automatically 0). By the Poincaré lemma, this equation implies (at least locally) that there exists a 1-form $\mathbf {A}$ satisfying
    $\mathbf {F} =\mathrm {d} \mathbf {A} .$
The other equation is
    $\mathrm {d} {\star }\mathbf {F} =\mathbf {J} .$
In this context, $\mathbf {J}$ is the current 3-form (or even more precise, twisted 3-form), and the star $\star$ denotes the Hodge star operator. The dependence of Maxwell's equation on the metric of spacetime lies in the Hodge star operator $\star$ on 2-forms, which is conformally invariant. Written this way, Maxwell's equation is the same in any space–time, manifestly coordinate-invariant, and convenient to use (even in Minkowski space or Euclidean space and time, especially with curvilinear coordinates).
An alternative geometric interpretation is that the Faraday 2-form $\mathbf {F}$ is (up to a factor $i$) the curvature 2-form $F(\nabla )$ of a U(1)-connection $\nabla$ on a principal U(1)-bundle whose sections represent charged fields. The connection is much like the vector potential, since every connection can be written as $\nabla =\nabla _{0}+iA$ for a "base" connection $\nabla _{0}$, and
    $\mathbf {F} =\mathbf {F} _{0}+\mathrm {d} \mathbf {A} .$
In this view, the Maxwell "equation" $\mathrm {d} \mathbf {F} =0$ is a mathematical identity known as the Bianchi identity. The equation $\mathrm {d} {\star }\mathbf {F} =\mathbf {J}$ is the only equation with any physical content in this formulation. This point of view is particularly natural when considering charged fields or quantum mechanics. It can be interpreted as saying that, much like gravity can be understood as being the result of the necessity of a connection to parallel transport vectors at different points, electromagnetic phenomena, or more subtle quantum effects like the Aharonov–Bohm effect, can be understood as a result from the necessity of a connection to parallel transport charged fields or wave sections at different points. In fact, just as the Riemann tensor is the holonomy of the Levi-Civita connection along an infinitesimal closed curve, the curvature of the connection is the holonomy of the U(1)-connection.