Second fundamental form How do I calculate the integral of the trace of the second fundamental form on a surface? 
The formula used in the Gibbons, Hawking, York paper Action integrals and partition functions in quantum gravity, how do I derive it? Is it a universal or does it have any assumptions about the kind of space time we are considering?
The formula is,
$$\int K d\Sigma = \frac{\partial}{\partial n}\int d\Sigma$$
$K$ is the trace of the second fundamental form, $d\Sigma$ is the area element and the derivative is along the outward normal to the surface.
 A: The boundary term of the Einstein-Hilbert action is given by,
$$S= \frac{1}{8\pi G}\int_{\partial M} \! \!\mathrm{d}^3x \, \sqrt{-h} \, K$$
where $h$ is the metric on the boundary of the manifold, i.e. $\partial M$, and $K$ is the trace of the extrinsic curvature. Specifically, we have,
$$K=\nabla_a n^a$$
where $n^a$ is a unit normal to the surface $\partial M$. The derivation follows by applying the Gauss-Codazzi formalism of differential geometry. Recall the variation of the Einstein-Hilbert action is,
$$\delta S_{EH}=-\frac{1}{16\pi G} \int_M \mathrm{d}^4x \, \sqrt{g} \, \delta g^{ab}G_{ab}-\frac{1}{16\pi G}\int_{\partial M} \mathrm{d}^3 x \, \sqrt{g} \left( \nabla_n \delta g -n_a\nabla_b g^{ab} \right)$$
The boundary is a submanifold, and a natural curvature scalar to select, rather than $R$, is the extrinsic curvature; the variation of $K$ is given by,
$$\delta K = \delta (\nabla_a n^a)=\nabla_a \delta n^a + \delta \Gamma^a_{ab}n^b$$
With some manipulation, which is found in virtually any general relativity textbook, it can be shown that the addition directly cancels the variation of the Einstein-Hilbert action, up to total derivatives.

As a practical example, consider the metric,
$$\mathrm{d}s^2 = \left( 1- \frac{2GM}{r}\right)\mathrm{d}\tau^2 + \left( 1-\frac{2GM}{r} \right)^{-1}\mathrm{d}r^2 + r^2 \mathrm{d}\theta^2 + r^2 \sin^2 \theta \mathrm{d}\phi^2$$
which is simply a Wick rotated Schwarzschild black hole, with periodic $\tau$ with period $\beta$. We may choose an inward pointing normal, correctly normalized such that $n_an^a = 1$, given by,
$$n^{a} = - \sqrt{1-\frac{2GM}{r}}\delta^a_r$$
Taking the divergence of the normal, we obtain,
$$K= -\left( 1-\frac{2GM}{r}\right)^{-1/2} \left( \frac{2}{r}-\frac{3GM}{r^2}\right)$$
The action is divergent, unless we introduce a radial cut-off, $R$. Note also we pick up a factor of $r^2$ from the determinant of the metric in the action; we find,
$$-8\pi G \, S= \int \mathrm{d}\tau \, \mathrm{d}\phi \, \mathrm{d}\theta \, \left( 2R -3GMR\right)=4\pi \beta \left( 2R -3GMR\right)$$
To regularize the integral, we must subtract off the contribution from flat space, with the same boundary.
