# Rewriting the Kolmogorov forward equation for a time-homogeneous process in an alternative form

Rewriting the Kolmogorov forward equation for a time-homogeneous process as:

$p_{ij}(t) = e^{-\lambda_it}\delta_{ij} + \int_0^t \sum_{k\neq j}p_{ik}(u)\sigma_{kj}e^{-\lambda_j(t-u)}du$.

where $\delta_{ij} = 0$, if $i\neq j$, or $1$ otherwise. i, k and j are states, and $\sigma_{ab}$ is the instantaneous transition rate from state a to b. Also $\lambda_{a} = -\sigma_{aa}$ (Total transition rate out of state a)

Kolmogorov forward equation (hMJP) can be written as:

$\frac{d}{dt}p_{ij}(t) = \sum_{k}p_{ik}(t)\sigma_{kj} = \sum_{k\neq j}p_{ik}(t)\sigma_{kj} + p_{ij}(t)\sigma_{jj}$

Using that $\sigma_{jj} = -\lambda_j$ and rearranging:

$\frac{d}{dt}p_{ij}(t) + p_{ij}(t)\lambda_j = \sum_{k\neq j}p_{ik}(t)\sigma_{kj}$

What I am struggling with is the next step (multiplying by integrating factor $e^{-\lambda_jt}$):

$\Rightarrow \frac{d}{dt}(e^{-\lambda_jt}p_{ij}(t))=\sum_{k\neq j}p_{ik}(t)\sigma_{kj}e^{-\lambda_jt}$

The rest makes sense to me but I am not sure how this integrating factor is arrived at - it is stated as 'trivial' but to me its not clear.

A slightly more in-depth view would be really helpful. Thanks!

Recall the first-order linear ODE $y'(t) + P(t)y = Q(y)$. The integrating factor $\mu(t)$ satisfies $$\mu(t)(y'(t) + P(t)y(t)) = \frac{\mathsf d}{\mathsf dt}\left[ \mu(t)y(t)\right] = \mu'(t)y(t) + \mu(t)y'(t),$$ so $$\mu(t)P(t) = \mu'(t)$$ and hence $$\mu(t) = e^{\int P(t)\ \mathsf dt}.$$ This gives $$\frac{\mathsf d}{\mathsf dt}\left[e^{\int P(t)\ \mathsf dt}y(t)\right] = e^{\int P(t)\ \mathsf dt}Q(t).$$ Here $y(t) = p_{ij}(t)$, $P(t)=\lambda_j$, and $Q(t)=\sum_{k\neq j}p_{ik}(t)\sigma_{kj}$, so $\mu(t) = e^{\int -\lambda_j\ \mathsf dt}=e^{-\lambda_j t}$, hence $$\frac{\mathsf d}{\mathsf dt}\left[e^{-\lambda_j t}p_{ij}(t)\right] =\sum_{k\neq j}p_{ik}(t)\sigma_{kj}e^{-\lambda_j t}.$$