Solution (source code)

= Solution

Let $A_2(t)=\int_0^t\mathbf1\{X(s)=2\}\,ds$ be the <occupation time of a continuous-time Markov chain> in the symptoms state. <Tonelli theorem> permits exchanging the nonnegative integral and <expectation>. Starting from state 1, put $q=\lambda+\mu>0$. Then
$$
\mathbb E_1A_2(t)=\int_0^tp_{12}(s)\,ds=\frac{\lambda}{q}\int_0^t(1-e^{-qs})\,ds,
$$
so
$$
\boxed{\mathbb E_1A_2(t)=\frac{\lambda}{\lambda+\mu}\left(t-\frac{1-e^{-(\lambda+\mu)t}}{\lambda+\mu}\right).}
$$
For small $t$ the answer is $\lambda t^2/2+O(t^3)$, as expected when onset must first occur. It is between zero and $t$. If $\lambda=\mu=0$, no transition can occur and the answer is zero; the displayed quotient is interpreted separately in that degenerate case.