Comment: the following is a somewhat convoluted way of deriving the Euler-Lagrange equation using Clairaut's theorem for the volume functional and some standard, albeit not simpler, variation formulas (all is $C^{\infty}$ in the following). Let $g_{0}$ be a Riemannian metric and let $v$ be a symmetric $2$-tensor. Let $g_{0,s}$ satisfy $\frac{\partial}{\partial s}|_{s=0} g_{0,s}=v$ and $g_{0,0}=g_{0}$. With $g_{0,s}$ as initial data, let $g_{t,s}$, $t\in\lbrack0,\varepsilon)$, solve the Ricci-Hamilton-DeTurck flow $\frac{\partial}{\partial t}g_{t,s}=-2\operatorname{Ric}{}_{g_{t,s} }+\mathcal{L}_{W_{t,s}}g_{t,s}$, where $W_{t,s}=\operatorname{tr}^{1,2} {}_{g_{t,s}}(\nabla_{g_{t,s}}-\nabla_{g_{t,0}})$. Note that $\frac{\partial }{\partial t}g_{t,0}=-2\operatorname{Ric}{}_{g_{t,0}}$. Let $v_{t,s} =\frac{\partial}{\partial s}g_{t,s}$. We have $\frac{\partial^{2}}{\partial s\partial t}|_{s=0}g_{t,s}=\Delta_{L}v_{t,0}$, which equals $\frac {\partial^{2}}{\partial t\partial s}|_{s=0}g_{t,s}=\frac{\partial}{\partial t}v_{t,0}$ (Lichnerowicz Laplacian heat equation). We compute $\frac{\partial }{\partial t}\operatorname{Vol}(g_{t,s})=\frac{1}{2}\int\operatorname{tr} {}_{g_{t,s}}(\frac{\partial}{\partial t}g_{t,s})d\mu_{g_{t,s}}=-\int R_{g_{t,s}}d\mu_{g_{t,s}}$ since $\int\operatorname{tr}{}_{g_{t,s} }(\mathcal{L}_{W_{t,s}}g_{t,s})d\mu_{g_{t,s}}=0$ by the divergence theorem. Now \begin{align*} \frac{\partial}{\partial s}|_{s=0}\int R_{g_{t,s}}d\mu_{g_{t,s}} & =-\frac{\partial^{2}}{\partial s\partial t}|_{s=0}\operatorname{Vol} (g_{t,s})=-\frac{\partial^{2}}{\partial t\partial s}|_{s=0}\operatorname{Vol} (g_{t,s})\\ & =-\frac{1}{2}\frac{\partial}{\partial t}\int\operatorname{tr}{}_{g_{t,0} }(v_{t,0})d\mu_{g_{t,0}}\\ & =\int\langle-\operatorname{Ric}{}_{g_{t,0}}+\frac{g_{t,0}}{2}R_{g_{t,0} },v_{t,0}\rangle_{g_{t,0}}d\mu_{g_{g_{t,0}}} \end{align*} since $\int\operatorname{tr}{}_{g_{t,0}}(\frac{\partial}{\partial t} v_{t,0})d\mu_{g_{t,0}}=\int\operatorname{tr}{}_{g_{t,0}}(\Delta_{L} v_{t,0})d\mu_{g_{t,0}}=\int\Delta_{g_{t,0}}(\operatorname{tr}{}_{g_{t,0} }(v_{t,0}))d\mu_{g_{t,0}}=0$. Finally, take $t=0$.