# Varying an action with respect to a scalar field

• JD_PM
In summary, the conversation discusses the variation of the action with regards to a scalar field in the flat version of the Robertson-Walker metric. The resulting equation is found to be missing a term, which is later derived to be equivalent to the Poisson's equation for the scalar field. The derivation involves using the Friedmann equations and assuming a homogeneous and isotropic universe.

#### JD_PM

Homework Statement
Given the action

\begin{equation*}
S = \int d^4 x \sqrt{-\det g} \left( -\frac 1 2 g^{\mu \nu} \partial_{\mu} \phi \partial_{\nu} \phi - V(\phi)\right)
\end{equation*}

Vary the action with respect to the scalar field ##\phi(x)## and obtain

\begin{equation*}
\ddot \phi + 3\left( \frac{\dot a}{a}\right) \dot \phi = -\frac{\partial V(\phi)}{\partial \phi}
\end{equation*}
Relevant Equations
Let us work with ##(-+++)## signature

Where the metric ##g_{\mu \nu}## is the flat version (i.e. ##K=0##) of the Robertson–Walker metric (I personally liked how Weinberg derived it in his Cosmology book, section 1.1)

\begin{equation*}
(ds)^2 = -(dt)^2 + a^2(t) (d \vec x)^2
\end{equation*}

Hence ##\sqrt{-\det g} = a^3##

My computation is the following

\begin{align*}
\delta S &= \int d^4 x \delta \left[ \sqrt{-\det g} \left( -\frac{1}{2} g^{\mu \nu} \partial_{\mu} \phi \partial_{\nu} \phi - V(\phi) \right)\right]\\
&= \int d^4 x \left[ \sqrt{-\det g} \left( -\frac{1}{2} g^{\mu \nu} \delta \left(\partial_{\mu} \phi \partial_{\nu} \phi\right) - \underbrace{\delta V(\phi)}_{=\frac{\partial V(\phi)}{\partial \phi}\delta \phi} \right)\right]\\
&= \int d^4 x \left[ \sqrt{-\det g} \left( -\underbrace{g^{\mu \nu} \left(\partial_{\mu} \phi \ \delta( \partial_{\nu} \phi) \right)}_{=g^{\mu \nu} \left(\partial_{\mu} \phi \ \partial_{\nu}( \delta \phi) \right)} - \frac{\partial V(\phi)}{\partial \phi}\delta \phi \right)\right]\\
&= \int d^4 x \left[ \sqrt{-\det g} \left( g^{\mu \nu} \partial_{\mu} \partial_{\nu} \phi - \frac{\partial V(\phi)}{\partial \phi} \right)\right]( \delta \phi)\\
&+ \underbrace{\int d^4 x \left[ \sqrt{-\det g} \left( \partial_{\nu} \left( g^{\mu \nu} \partial_{\mu} \phi \delta \phi\right) \right)\right]( \delta \phi)}_{\text{Surface term vanishes}}
\end{align*}

Hence I get

\begin{equation*}
\delta S = 0 \iff \sqrt{-g}\left( \partial^{\mu}\partial_{\mu} \phi - \frac{\partial V(\phi)}{\partial \phi}\right) = 0
\end{equation*}

But the above equation leads to the following timelike component

\begin{equation*}
-\partial^{0}\partial_{0} \phi - \frac{\partial V(\phi)}{\partial \phi} = 0 \Rightarrow \ddot \phi = - \frac{\partial V(\phi)}{\partial \phi}
\end{equation*}

So I am missing the ##3(\dot a / a)\dot \phi## term.

First thought that my mistake was not including the following well-known variation
\begin{equation*}
\delta \sqrt{-g} = \frac{\sqrt{-g}}{2}g^{\mu \nu} \delta g_{\mu \nu} = -\frac{\sqrt{-g}}{2} g_{\mu \nu}\delta g^{\mu \nu}
\end{equation*}

But given that they explicitly state that we should vary wrt the scalar field I interpreted this as taking ##\delta g_{\mu \nu} \to 0##. Is such interpretation wrong? Is the solution to my issue simply including this variation in my computation?

Thank you!

etotheipi
JD_PM said:
\begin{equation*}

\delta S = 0 \iff \sqrt{-g}\left( \partial^{\mu}\partial_{\mu} \phi - \frac{\partial V(\phi)}{\partial \phi}\right) = 0

\end{equation*}But the above equation leads to the following timelike component
\begin{equation*}
-\partial^{0}\partial_{0} \phi - \frac{\partial V(\phi)}{\partial \phi} = 0 \Rightarrow \ddot \phi = - \frac{\partial V(\phi)}{\partial \phi}
\end{equation*} So I am missing the ##3(\dot a / a)\dot \phi## term.
Hey JD, I don't know anything about this metric or topic, although from the original action I derived the same condition that ##\partial^{\mu} \partial_{\mu} \phi = \partial V / \partial \phi## but then instead considered that with the ##(-+++)## sig, and with ##i \in \{1,2,3 \}##\begin{align*} \partial^{\mu} \partial_{\mu} \phi & = \partial^0 \partial_0 \phi + \partial^i \partial_i \phi \\ \\ \partial^{\mu} \partial_{\mu} \phi &= - \partial_0 \partial_0 \phi + \partial_i \partial_i \phi \\ \\ \partial^{\mu} \partial_{\mu} \phi &= - \ddot{\phi} + \nabla^2 \phi \overset{!}{=} \frac{\partial V}{\partial \phi} \implies \ddot{\phi} - \nabla^2 \phi = - \frac{\partial V}{\partial \phi} \end{align*}I don't know how you might turn the ##\nabla^2 \phi## term into something involving scale factors, but wondered if perhaps you didn't take into account the summation?

[And also, the second time derivative ##\partial^2 / \partial t^2 = \partial_0 \partial_0## with indices down, right? ]

JD_PM
etotheipi said:
[...] perhaps you didn't take into account the summation?

[And also, the second time derivative ##\partial^2 / \partial t^2 = \partial_0 \partial_0## with indices down, right? ]

Absolutely right, thanks James I indeed missed the spatial term! We have

$$\ddot{\phi} - \nabla^2 \phi = - \frac{\partial V}{\partial \phi}$$

All what's left is to show that

\nabla^2 \phi = -3 \left( \frac{\dot a}{a}\right) \phi \tag{1}

I am quite confident ##(1)## can be derived out of the fact that the real scalar field ##\phi## satisfies Poisson's equation ##\nabla^2 \phi = 4 \pi G_N \rho## (for instance, for some reference, check Tong's beautiful lecture notes EQ. (0.1)) AND the flat first Friedmann equation (let us not include the cosmological constant)

\left( \frac{\dot a}{a} \right)^2 = \frac{8 \pi G_N}{3} \rho \tag{F1}

Remark: we can use Friedmann equations given that we are assuming an homogeneous and isotropic universe (which is implied in the metric we are using in this particular exercise). If you are interested in Cosmology, I strongly recommend probably the most complete, enlightening GR lecture notes I've ever come across: Matthias Blau's GR lecture notes. Friedmann equations are in EQ. (35.108).

Hence, using ##\nabla^2 \phi = 4 \pi G_N \rho## and ##(F1)## we find

\begin{equation*}
\nabla^2 \phi = -3 \left( \frac{\dot a}{a}\right) \phi \iff \phi := -\frac 1 2 \left( \frac{\dot a}{a}\right)
\end{equation*}

Argh... honestly I am not satisfied with my answer. I have been "forcing" the pieces to fit...

I will have a walk to refresh my mind!

JD_PM said:
\begin{align*}
& \int d^4 x \left[ \sqrt{-\det g} \left( -\underbrace{g^{\mu \nu} \left(\partial_{\mu} \phi \ \delta( \partial_{\nu} \phi) \right)}_{=g^{\mu \nu} \left(\partial_{\mu} \phi \ \partial_{\nu}( \delta \phi) \right)} - \frac{\partial V(\phi)}{\partial \phi}\delta \phi \right)\right]\\
&= \int d^4 x \left[ \sqrt{-\det g} \left( g^{\mu \nu} \partial_{\mu} \partial_{\nu} \phi - \frac{\partial V(\phi)}{\partial \phi} \right)\right]( \delta \phi)\\
&+ \underbrace{\int d^4 x \left[ \sqrt{-\det g} \left( \partial_{\nu} \left( g^{\mu \nu} \partial_{\mu} \phi \delta \phi\right) \right)\right]( \delta \phi)}_{\text{Surface term vanishes}}
\end{align*}
The factor ##\sqrt{-\det g} = a^3## is part of the Lagrangian density. So, after doing the integration by parts in order to "shift" the derivative ##\partial_{\nu}##,you get
\begin{align*}
& \int d^4 x \left[ a^3 \left( -\underbrace{g^{\mu \nu} \left(\partial_{\mu} \phi \ \delta( \partial_{\nu} \phi) \right)}_{=g^{\mu \nu} \left(\partial_{\mu} \phi \ \partial_{\nu}( \delta \phi) \right)} - \frac{\partial V(\phi)}{\partial \phi}\delta \phi \right)\right]\\
&= \int d^4 x \left[ \left( g^{\mu \nu} \partial_{\nu} \left( a^3 \partial_{\mu} \phi \right) - a^3 \frac{ \partial V(\phi)}{\partial \phi} \right)\right]( \delta \phi)+ {\text{Surface term}}
\end{align*}

If you want to take a shortcut, you can use the Euler-Lagrange equations as given by equation (10) here.
Be sure to include ##\sqrt{-\det g}## as part of ##\mathcal L##.

JD_PM and etotheipi
[Ahh clever, @TSny! I'd forgotten that with this metric the Christoffel symbols (obviously!) don't vanish, so ##\nabla_{\mu} \neq \partial_{\mu}## and for this particular term from the IBP, the second and third terms are not equal:$$\int d^4 x \partial_{\mu} (\sqrt{-g} g^{\mu \nu} \partial_{\nu} \phi ) \delta \phi = \int d^4 x (\sqrt{-g} g^{\mu \nu} \nabla_{\mu} \nabla_{\nu} \phi) \delta \phi \, \, \neq \, \, \int d^4 x (\sqrt{-g} g^{\mu \nu} \partial_{\mu} \partial_{\nu} \phi) \delta \phi$$... ]

...Anyway, I will be quiet now

Last edited by a moderator:
JD_PM
TSny said:
The factor ##\sqrt{-\det g} = a^3## is part of the Lagrangian density. So, after doing the integration by parts in order to "shift" the derivative ##\partial_{\nu}##,you get
\begin{align*}
& \int d^4 x \left[ a^3 \left( -\underbrace{g^{\mu \nu} \left(\partial_{\mu} \phi \ \delta( \partial_{\nu} \phi) \right)}_{=g^{\mu \nu} \left(\partial_{\mu} \phi \ \partial_{\nu}( \delta \phi) \right)} - \frac{\partial V(\phi)}{\partial \phi}\delta \phi \right)\right]\\
&= \int d^4 x \left[ \left( g^{\mu \nu} \partial_{\nu} \left( a^3 \partial_{\mu} \phi \right) - a^3 \frac{ \partial V(\phi)}{\partial \phi} \right)\right]( \delta \phi)+ {\text{Surface term}}
\end{align*}

If you want to take a shortcut, you can use the Euler-Lagrange equations as given by equation (10) here.
Be sure to include ##\sqrt{-\det g}## as part of ##\mathcal L##.

Ohhh I understand what my mistake was now! . We have

\delta S = 0 \iff \partial^{\mu}\left(a^3 \partial_{\mu} \phi\right) - a^3 \frac{ \partial V(\phi)}{\partial \phi} = 0 \tag{2}

Oops I forgot to mention that we are dealing with a homogeneous scalar field (i.e. ##\partial_i \phi = 0##) . Hence ##(2)## becomes

\begin{align}
&-\partial_{0}\left(a^3 \dot \phi \right) - a^3 \frac{ \partial V(\phi)}{\partial \phi} = 0 \Rightarrow \nonumber \\
&\Rightarrow 3a^2 \dot a \dot \phi + a^3 \ddot \phi + a^3 \frac{ \partial V(\phi)}{\partial \phi} = 0 \Rightarrow \tag{3} \\
&\Rightarrow
\ddot \phi + 3\left( \frac{\dot a}{a}\right) \dot \phi = -\frac{\partial V(\phi)}{\partial \phi} \nonumber
\end{align}

Where to get to the last line I simply multiplied both sides of ##(3)## by ##1/a^3##

Once again @TSny, hats off to you!

etotheipi