I have a continuous-time Markov chain $X_t=X(t)$ which is governed by the generator matrix $Q=(Q_{ij})$, where $\sum_{j} Q_{ij}=0$ and $Q_{jj}=-\sum_{i \neq j}Q_{ij}$.
I want to find the probability $p$ that $X$ is not in state $k$ at time $t_1$ AND that $X$ has only left state $k$ once, given that $X$ was in state $k$ at time $t_0$. More concisely,
$$\mathbb{P}(X_{t_1}\neq k \cap \text{ $X$ has not returned to $k$} \ | \ X_{t_0}=k).$$
I think this can be restated as
$$\int_{u=(t_0,t_1)} \mathbb{P}(X_{(t_0,u)} = k \ \cap \ X_{[u,t_1)} \neq k \ | \ X_{t_0}=k) \ du$$
for $t_0<u<t_1$, where $X_{(t_0,u)} = k$ is just a way to state that $X$ is in $k$ in the interval $(t_o, u)$.
I'm hoping a closed-form solution is possible. Can anyone help?
I'm ignoring the complement of the problem (either being in state $k$ at time $t_1$ OR not being in state $k$ at time $t_1$ but having re-entered it at least once since time $t_0$) because this also seems hard.
NOTE: A previous version of this question was incorrectly stated. It also included a partial solution which was incorrect. I've removed these.
This is not a closed-form solution, but I think with some more work you can get it there. Anyways, change the generator matrix $Q$ such that it has all zeros in row $k$, call this matrix $\tilde{Q}$. This changes state $k$ to an absorbing state. Then the answer is
$$1 - \int_0^{t_1} \left[e^{\tilde{Q}^T(t_1-\tau)}P_{k,\cdot}^T\right]_k \lambda_k e^{-\lambda_k \tau}\,d\tau$$
where $P_{k,\cdot}$ is the $k$th row of the transition probability matrix, and $\lambda_k = -Q_{kk}$. Also $[\cdot]_k$ refers to the $k$th element of the vector. I tested this out with some simulations and it works. Essentially we are integrating over all the possible times of the first jump, and then the stuff inside the square brackets is the probability of ending up in state $k$ at any point between the first jump and $t_1$. Thus the integral gives the probability of ending up in state $k$ at any point after the first jump, so we need to compute 1 minus that integral.