Why do we integrate the modulating function in FM?
You need to integrate the modulating signal because frequency is the time derivative of phase. Therefore, the typical relationship from introductory calculus holds:

$$
\phi_i(t) = \int_{-\infty}^{t} \frac{d\phi_i(\tau)}{d\tau} d\tau = \int_{-\infty}^{t} 2\pi f_i(\tau) d\tau
$$

For causal signals, the lower limit on the integral changes to zero:

$$
\phi_i(t) = \int_{0}^{t} 2\pi f_i(\tau) d\tau
$$

$$
\phi_i(t) = \int_{0}^{t} 2\pi\left(f_c + k_fm(\tau)\right) d\tau
$$

$$
\phi_i(t) = 2\pi f_ct +\int_{0}^{t} 2\pi k_f m(\tau) d\tau
$$

which is the answer you were trying to get to.