Given a compact manifold with a Riemannian metric $g$, we define the total scalar curvature by $$E(g)=\int_M RdV$$
Let us consider the first variation of $E$ under an arbitrary change of metric. We write $h=\frac{\partial g}{\partial t}$.
One can derive that $$\frac{d}{dt} \int_M RdV=\int_M \langle\frac{R}{2}g-Ric, h\rangle dV$$
Question: In "Lectures On The Ricci Flow" by Peter Topping, $\nabla E(g)=\frac{R}{2}g-Ric$ is concluded by above derivation, where $\nabla E$ is gradient of $E$.
Can anyone help me to understand how he gets the result?
Thanks.