I have used the below code for \phi^4 theories but it does not give correct answer.
\partial{#}::PartialDerivative;
\delta{#}::Accent;
g^{\mu\nu}::Symmetric;
S:= \int{ \sqrt{-g} ( R+R \phi+1/2 g^{\mu\nu}\partial_{\mu}{\phi} \partial_{\nu}{\phi} -1/2 m^2 \phi^2- \lambda \phi^4) }{x};
rl:= \phi -> \delta{\phi}, V -> V' \delta{\phi};
How can i derive it?
\begin{equation}
S:= \int{ \sqrt{-g} ( R+R \phi+1/2 g^{\mu\nu}\partial{\mu}{\phi} \partial{\nu}{\phi}-1/2 m^2 \phi^2- \lambda \phi^4) }{x}
\end{equation}