For the minimally coupled scalar field, keep the metric tensor fixed and vary . A scalar's first covariant derivative equals its ordinary derivative, so
Apply integration by parts for tensor fields. The boundary contribution is proportional to and vanishes under the given boundary condition, leaving
The interior variation is arbitrary. Thus the scalar equation of motion is
Here the d'Alembert operator contains the Levi-Civita connection in the second covariant derivative, even though the first derivative of the scalar field is ordinary.
For the torsion-free Levi-Civita connection, cyclically summing the displayed coordinate expression and using gives the algebraic first Bianchi identity
Apply the Jacobi identity to three covariant-derivative commutators, or differentiate the coordinate formula in normal coordinates. The third-derivative terms and the derivatives of quadratic connection terms cancel cyclically, giving the differential second Bianchi identity
Contracting the first and third curvature indices and then contracting once more yields
or the contracted Bianchi identity
For the metric variation ,
while the two double-divergence terms in the supplied metric variation of scalar curvature become a boundary term after integration by parts for tensor fields. The Einstein-Hilbert action therefore contributes . Varying the Proca action with respect to the metric gives the Proca stress-energy tensor, and the full Einstein-Proca theory equation is
Since , variation with respect to and one integration by parts give the covariant Proca equation
Taking its covariant divergence gives
because the resulting contractions pair the symmetric Ricci tensor with the antisymmetric electromagnetic field tensor. Since , the Lorenz constraint in Proca theory follows:
Moreover, and , so the Electromagnetic Bianchi identity is
Finally, use that identity to differentiate the matter tensor. The result groups naturally as
Both terms vanish by the Proca equation and its Lorenz constraint in Proca theory. Thus , exactly as required by the contracted Bianchi identity applied to the Einstein field equations. The vector equation is therefore consistent with the gravitational equation.