# Einstein action and the second derivatives

I have naive question about Einstein action for field-free case: $$S = -\frac{1}{16 \pi G}\int \sqrt{-g} d^{4}x g^{\mu \nu}R_{\mu \nu}.$$ It contains the second derivatives of metric. When we want to get the Einstein equation (which doesn't contain the third derivatives), we must use variational principle. The variation of "problematic" factor $R_{\mu \nu}$ (which contains the second derivatives) is equal to $$\delta R_{\mu \nu} = D_{\gamma}(\delta \Gamma^{\gamma}_{\mu \nu}) - D_{\nu}(\delta \Gamma^{\lambda}_{\mu \lambda}).$$ So the corresponding variation of action may be rewritten in a form $$\delta_{R_{\mu \nu}} S = -\frac{1}{16 \pi G}\int d^{4}x \sqrt{-g}\partial_{\lambda}(g^{\mu \nu}\delta \Gamma^{\lambda}_{\mu \nu} - g^{\mu \lambda}\delta \Gamma^{\sigma}_{\mu \sigma}). \qquad (1)$$ Then one likes to say that it is equal to zero. But why it must be equal to zero? It isn't obvious to me. After using the divergence theorem $(1)$ becomes $$\delta_{R_{\mu \nu}} S = -\frac{1}{16 \pi G}\int dS_{\lambda} \sqrt{-g}(g^{\mu \nu}\delta \Gamma^{\lambda}_{\mu \nu} - g^{\mu \lambda}\delta \Gamma^{\sigma}_{\mu \sigma}).$$ Why it must be equal to zero? It is metric, not physical field, even if Christoffel symbols refer to the gravitational field, so I don't understand why it must be equal to zero at infinity.

It seems that OP is pondering the following.

What happens in a field theory [in OP's case: GR] if spacetime $$M$$ has a non-empty boundary $$\partial M\neq \emptyset$$, and we don't impose pertinent (e.g. Dirichlet) boundary conditions (BC) on the fields $$\phi^{\alpha}(x)$$ [in OP's case: the metric tensor $$g_{\mu\nu}(x)$$]?

I) Firstly, it should stressed that when people say that the infinitesimal variation $$\delta S_0$$ of the action $$S_0[\phi]$$ [in OP's case: the Einstein-Hilbert action $$S_{EH}$$] vanishes on-shell, i.e. when the Euler-Lagrange equations [in OP'case: Einstein's field equations] are satisfied, it is implicitly assumed that the infinitesimal variations $$\delta\phi^{\alpha}(x)$$ of the fields $$\phi^{\alpha}(x)$$ only take place in the interior/bulk of spacetime $$M$$ away from the boundary $$\partial M$$. In such cases, the infinitesimal variation $$\delta S_0$$ clearly vanishes on-shell, as part of the stationary action principle, aka. Hamilton's principle.

II) Secondly, if the sole purpose of the infinitesimal variation $$\delta\phi^{\alpha}(x)$$ is just to locally (re)derive the equations of motion (=the Euler-Lagrange equations) in an interior/bulk point $$x_0$$ of spacetime $$M$$, it is enough to choose localized variations $$\delta\phi^{\alpha}(x)$$ with support in sufficiently small compact neighborhoods around this point $$x_0$$. In particular, one may assume that $$\delta\phi^{\alpha}(x)$$ and all its (higher) derivatives vanish at the boundary $$\partial M$$ for such variations, and still derive the equations of motion.

III) Thirdly, if we do not impose adequate BC, then the global notion of a functional derivative

$$\tag{1} \frac{\delta S_0}{\delta\phi^{\alpha}(x)}$$

may not exists, i.e. there may not exists a globally defined function $$^1$$ $$\tag{2} f_{\alpha}(x) ~=~f_{\alpha}(\phi(x), \partial \phi(x), \partial^2 \phi(x),\ldots ;x)$$

such that

$$\tag{3} \delta S_0 ~=~\int_M \! d^{n}x ~f_{\alpha}(x)~\delta\phi^{\alpha}(x)$$

for all allowed infinitesimal variations $$\delta\phi^{\alpha}(x)$$. In plain English, the problem is that we cannot use the usual integration-by-parts argument when deriving the Euler-Lagrange expression since we have not imposed sufficient BC to ensure that boundary terms vanish. Then one must typically amend the bulk action $$S_0$$ with a boundary action $$S_1$$ [in OP's case: The Gibbons-Hawking-York boundary action $$^2$$ $$S_{GHY}$$], which only lives on the boundary $$\partial M$$. The total action then reads $$S_0+S_1$$.

--

$$^1$$ If the function (2) happens to exist, it is unique, and we will call it the functional derivative of $$S_0$$, and denote it by the symbol (1).

$$^2$$ See also these Phys.SE posts for more on the Gibbons-Hawking-York boundary term.