To use least action principle, we should know variation rule for \(\sqrt{-g}\) and \(R\).
1. Variation of \(g\)