Action describing a scalar field in a classical curved background

Been trying to derive equation (6.54) in Quantum Fields in Curved Space by N.D. Birrell & P.C.W. Davies (p. 162): \begin{align} ^{(2)}H_{\mu\nu} &\equiv \frac{1}{(-g)^{1/2}}\frac{\delta}{\delta g^{\mu\nu}}\int (-g)^{1/2}R^{\alpha\beta}R_{\alpha\beta} d^{n}x \\ &=R_{;\mu\nu}-\frac{1}{2}g_{\mu\nu}\Box R-\Box R_{\mu\nu}-\frac{1}{2} g_{\mu\nu}R^{\alpha\beta}R_{\alpha\beta}+2R^{\alpha\beta}R_{\alpha\beta\mu\nu} \\ &=2R_{\mu;\nu\alpha}^{\alpha}-\Box R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}\Box R+2R_{\mu}^{\alpha}R_{\alpha\nu}-\frac{1}{2}g_{\mu\nu}R^{\alpha\beta}R_{\alpha\beta} \end{align}

by using the xAct package in Mathematica. The result (and part of the code used) can be seen in the picture attached below:

I am at a complete loss here; how are these last two terms equivalent? How do I go about transforming the expression I got using Mathematica to the one from the textbook?

• Shouldn't you get the Einstein tensor as the variation? Am I missing something obvious? – JamalS Jun 19 '18 at 19:04
• @JamalS If one is given a regular Hilbert-Einstein action then yes, the Einstein tensor would be the the variation. However, when you're observing a quantum field in a classical curved space you'll get extra terms of higher curvature order: $$R_{\mu\nu} - \frac{1}{2}Rg_{\mu\nu} + \Lambda g_{\mu\nu} + \alpha^{(1)}H_{\mu\nu} +\beta^{(2)}H_{\mu\nu} + \gamma H_{\mu\nu}.$$ What I'm interested in is how to get these higher order members. – Kandrax Jun 19 '18 at 19:15
• This is a quadratic action, so you will NOT get the Einstein tensor as the result. But my question to @Kandrax is where is the scalar field? The title doesn't make sense to me. Without doing the work (again, as have long ago) I'd guess that either (1) the author used identities (such as Biannchi) to replace terms or made use of other equations derived from the action to evaluate the term on a particular solution. I'm leaning towards option (1). – ggcg Jun 19 '18 at 19:19
• @ggcg The expected value of the energy-momentum tensor is on the other side of the equation. – Kandrax Jun 19 '18 at 19:22
• I don't know how that answered my question. You are asking how we get from the second line to the third, right? – ggcg Jun 19 '18 at 19:24