I've been starting to look at the Hilbert action derivation of Einstein's equations, and have an introductory question. When the Lagrangian is excpanded into three integrals (for variation of metric determinant, metric and Ricci Tensor), the Ricci term is always dropped after a discussion of total differentials, Stokes' theorem etc. that I can't quite follow precisely yet! Part of the justification seems to be an assumption of zero boundary conditions at infinity, but as I understand it in a closed universe there is no boundary and no zero field (if I've been following the arguments). As an example, see discussion of equation 4.61 in Carroll So, my question is, can this term really be dropped for a closed universe. I imagine the field equations would be horrendous with the extra terms retained in the action.