# Infinitesimal generator/intensity matrix

I am trying to understand the following example, but I do not understand how they get $$P(t)$$. What are they doing with the diagonal matrix to get the three matrices with $$e^{-t}$$, $$e^{-3t}$$ and $$e^{-4t}$$ in front?

They are exponentiating. Recall that $$e^x = 1 + \frac x{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + ...$$ You can define the same power series for matrices. Given a square matrix $$M$$, you can define $$e^M := I + \frac 1{1!}M + \frac{1}{2!}M^2 + \frac{1}{3!}M^3 + ...$$ Just as in the real case, this series always converges, and it solves similar multivariate differential equations. In particular, $$\mathbf P_t = e^{t\mathbf A}$$.
Since $$\mathbf A= \mathbf {QDQ}^{-1}$$, $$\mathbf A^n = \mathbf {QDQ}^{-1}\mathbf {QDQ}^{-1}\mathbf {QDQ}^{-1}...\mathbf {QDQ}^{-1} = \mathbf {QD}^n\mathbf Q^{-1}$$ From which it follows that $$e^{t\mathbf A} = \mathbf Q\ e^{t\mathbf D}\mathbf Q^{-1}$$
Now, it isn't hard to workout that if $$\mathbf D = \text{diag}(d_1, ..., d_4)$$ then $$e^{\mathbf D} = \text{diag}(e^{d_1}, ..., e^{d_4})$$.
So $$\mathbf P_t = e^{t\mathbf A} = \mathbf Q\ e^{t\mathbf D}\mathbf Q^{-1}=\mathbf Q\begin{bmatrix}e^0&0&0&0\\0&e^{-t}&0&0\\0&0&e^{-3t}&0\\0&0&0&e^{-4t}\end{bmatrix}\mathbf Q^{-1}$$ which when you expand out using the $$\mathbf Q$$ matrices gives the result $$\frac 1{12}\begin{bmatrix} 3+8e^{-t}+e^{-4t}&3-3e^{-4t}&3-4e^{-t}+e^{-4t}&3-4e^{-t}+e^{-4t}\\ 3-3e^{-4t}&3+9e^{-4t}&3-3e^{-4t}&3-3e^{-4t}\\ 3-4e^{-t}+e^{-4t}&3-3e^{-4t}&3+2e^{-t}+6e^{-3t}+e^{-4t}&3+2e^{-t}-6e^{-3t}+e^{-4t}\\ 3-4e^{-t}+e^{-4t}&3-3e^{-4t}&3+2e^{-t}-6e^{-3t}+e^{-4t}&3+2e^{-t}+6e^{-3t}+e^{-4t} \end{bmatrix}$$ Which they have then broken apart into the matrices of coefficients of the exponential expressions.