Help in understanding the derivation of Einstein equations I am working through the derivation of the Einstein field equations by varying the Einstein-Hilbert action. I need some help in understanding certain steps.
The first question that I have concerns the variation of the Reimann tensor. I am trying to show that
$$\delta R^{\rho}_{\phantom{\rho}\sigma\mu\nu}=\nabla_{\mu}\left(\delta\Gamma^{\rho}_{\phantom{\rho}\nu\sigma}\right)-\nabla_{\nu}\left(\delta\Gamma^{\rho}_{\phantom{\rho}\mu\sigma}\right)$$
In order to show the above, it is necessary that
$$\Gamma^{\lambda}_{\phantom{\lambda}\nu\mu}\delta\Gamma^{\rho}_{\phantom{\rho}\lambda\sigma}-\Gamma^{\lambda}_{\phantom{\lambda}\mu\nu}\delta\Gamma^{\rho}_{\phantom{\rho}\lambda\sigma}=0$$
Why is this true?
The second question that I have concerns the term
$$\int\nabla_{\rho}A^{\rho}\sqrt{-g}\,\mathrm{d}^4x=0$$
where
$$A^{\rho}=g^{\sigma\nu}\delta\Gamma^{\rho}_{\phantom{\rho}\nu\sigma}-g^{\sigma\rho}\delta\Gamma^{\mu}_{\phantom{\mu}\mu\sigma}$$
Why is the integral zero?
 A: The expression $$\Gamma^{\lambda}_{\phantom{\lambda}\nu\mu}\delta\Gamma^{\rho}_{\phantom{\rho}\lambda\sigma}-\Gamma^{\lambda}_{\phantom{\lambda}\mu\nu}\delta\Gamma^{\rho}_{\phantom{\rho}\lambda\sigma}=(\Gamma^{\lambda}_{\phantom{\lambda}\nu\mu}-\Gamma^{\lambda}_{\phantom{\lambda}\mu\nu})\delta\Gamma^{\rho}_{\phantom{\rho}\lambda\sigma}=0$$ follows from the assumption that the connection $\nabla$ is a Levi-Cevita connection, i.e. there is zero torsion. This means the connection coefficients $\Gamma^\kappa_{\mu\nu}$ reduce to the Christoffel symbols and so are symmetric under exchange of the bottom indices. There's nothing that forces us to take torsion to be zero really, it just makes things simple and seems to be correct insofar as observations seem to be perfectly consistent with it.
As for the integral $$\int\nabla_{\rho}A^{\rho}\sqrt{-g}\,\mathrm{d}^4x=0.$$ This vanishes because the integrand is a total divergence and as such only depends on the values of $A^\rho$ at the boundaries of the integration, which we take to be zero on physical grounds. To see how this works, we need the following result: $$\Gamma^\mu_{\mu\nu}=\frac{1}{\sqrt{-g}}\partial_\nu\sqrt{-g}$$ (you can look up the derivation for this if you want, it's not very illuminating imo). Using this, we can re-express the integrand as
\begin{align*}
\sqrt{-g}\,\nabla_{\rho}A^{\rho}&=\sqrt{-g}(\partial_\rho A^\rho+\Gamma^\rho_{\rho\nu}A^\nu)\\&=\sqrt{-g}(\partial_\rho A^\rho+\frac{1}{\sqrt{-g}}\partial_\nu\sqrt{-g}A^\nu)\\&=\sqrt{-g}\partial_\rho A^\rho+A^\nu\partial_\nu\sqrt{-g}\\&=\partial_\rho(A^\rho\sqrt{-g})
\end{align*}
So now we have a genuine four-divergence. Applying the familiar divergence theorem, we arrive at $$\int_M\nabla_{\rho}A^{\rho}\sqrt{-g}\,\mathrm{d}^4x=\int_M\partial_\rho(A^\rho\sqrt{-g})\,\mathrm{d}^4x=\int_{\partial M}n_\rho A^{\rho}\sqrt{-h}\,\mathrm{d}^3x,$$ where $h_{\mu\nu}=g_{\mu\nu}+n_\mu n_\nu$ is the induced metric on the hypersurface $\partial M$ with unit normal vector $n_{\mu}$.
Enforcing that $A^\rho$ is zero on $\partial M$ (actually $A^\rho$ needs to vanish sufficiently quickly as one approaches the boundary) then gives the desired result. This is essentially equivalent to the statement that stuff happening in one spot doesn't have an effect on things at sufficiently large distances away, which is reasonable since physical effects are bounded by the speed of light and any physically realistic configuration will have only existed for a finite time (if you're specifically studying the asympotic behaviour of a system this may become a problem however).
This trick is used in a lot of places (particularly in deriving equations of motion such as you are doing) because it lets you move the derivative around in the integrand. If we let $A(x)$ and $B(x)$ be two functions such that $A(x)\rightarrow 0$ as $x\rightarrow\pm\infty$, then $$\int B(x)\partial A(x)\,dx=\left[A(x)B(x)\right]_{-\infty}^{\infty}-\int A(x)\partial B(x)\,dx=-\int A(x)\partial B(x)\,dx.$$
EDIT: As requested in the comments, I've expanded a bit on how the integrand is considered a four-divergence.
