Solution (source code)

= Solution

By definition,
$$
N=\log\frac{a(t_f)}{a(t_i)}
=\int_{t_i}^{t_f}H\,dt.
$$
Using $dt=d\phi/\dot\phi$ and the result of part (a),
$$
\begin{aligned}
N
&=\int_{\phi_i}^{\phi_f}\frac{H}{\dot\phi}\,d\phi\\
&\simeq-\frac1{\sqrt2M_{\rm Pl}}
\int_{\phi_i}^{\phi_f}\frac{d\phi}{\sqrt{\epsilon(\phi)}}.
\end{aligned}
$$
Reversing the limits yields the <slow-roll e-fold count>
$$
\boxed{N\simeq\frac1{\sqrt2M_{\rm Pl}}
\int_{\phi_f}^{\phi_i}\frac{d\phi}{\sqrt{\epsilon(\phi)}}}.
$$