Solution (source code)

= Solution

In <conformal time>, $\sqrt{-g}=a^4$ and $g^{\mu\nu}=a^{-2}\operatorname{diag}(-1,1,1,1)$. The <inflaton action in an expanding universe> becomes
$$
S=\int d\tau\,d^3x\left\{\frac{a^2}{2}(\phi')^2-\frac{a^2}{2}(\nabla\phi)^2-a^4V(\phi)\right\}.
$$
Vary $\phi$ with compact support, integrate the derivative terms by parts, and discard the boundary term. The <Euler-Lagrange field equation> is
$$
(a^2\phi')'-a^2\nabla^2\phi+a^4V_{,\phi}=0.
$$
Dividing by $a^2$ proves
$$
\boxed{\phi''+2\frac{a'}a\phi'-\nabla^2\phi+a^2V_{,\phi}=0.}
$$
The factor two is the conformal-time form of <Hubble friction>. Using $d\tau=dt/a$ converts it to the usual <inflaton equation of motion> $\ddot\phi+3H\dot\phi-a^{-2}\nabla^2\phi+V_{,\phi}=0$, providing a sign and normalization check.