Stress-energy tensor of a canonical scalar field (source code)

= Stress-energy tensor of a canonical scalar field
{title2=$T_{\mu\nu}=\partial_\mu\phi\partial_\nu\phi-g_{\mu\nu}[(\nabla\phi)^2/2-V]$}

For signature $(+---)$ and $S_\phi=\int\sqrt{-g}[(\nabla\phi)^2/2-V(\phi)]$, the convention $T_{\mu\nu}=2(\delta S_\phi/\delta g^{\mu\nu})/\sqrt{-g}$ gives the displayed tensor. Varying the inverse metric yields the derivative product, while varying the volume element yields the term proportional to $g_{\mu\nu}$. A homogeneous field has energy density $\dot\phi^2/2+V$ and pressure $\dot\phi^2/2-V$.