TITLE: How to calculate the matrix exponential explicitly for a matrix which isn't diagonalizable?
QUESTION [17 upvotes]: How can I compute an expression for $(\exp(Qt))_{i,j}$ for some fixed $i, j$ and matrix $Q$?
When $Q$ is diagonalizable, we can diagonalize, but what can be done otherwise?
Thanks.

REPLY [6 votes]: You can find the exponential of a matrix by Putzer's algorithm, which avoids both computing either the Jordan canonical form or any eigenvectors. Putzer's algorithm uses the Cayley-Hamilton theorem, which states that a matrix satisfies its characteristic equation, in an essential way.
Here is a summary of the method for a $3 \times 3$ matrix $a$. The general case should be similar. The basic idea is that all powers of $a$ starting with $a^3, a^4, \ldots$ can be expressed as a linear combination of $i, a, a^2.$ We will use different combinations of $i, a, a^2$ instead, as explained in the next paragraph.
Let the characteristic polynomial of $a$ be written as 
$\det(\lambda I - A) = (\lambda - \lambda_1)(\lambda - \lambda_1)(\lambda - \lambda_3)$. It does not matter how the roots are labeled or even whether they are all real. Now define $p_0 = i, p_1 = (a - \lambda_1 i)p_0, p_2 = (a - \lambda_2 i)p_1.$ We will need the following consequences $ a p_0 = \lambda_1 p_0 + p_1, a p_1 = \lambda_2 p_1 + p_2, a p_2 = \lambda_3 p_2.$  
Now look for $e^{at} = i + at + \frac{t^2a^2}{2!} + \ldots$. Since all powers starting with $a^3$ is a linear combination of $i, p_0, p_1$, thanks to c-h, $e^{at} = r_0 p_0 + r_1 p_1 + r_2 p_2.$ Using $\frac{d}{dt}e^{at} = ae^{at}$ it is easy to see that $r_0,r_1, r_2$ satisfy $$\frac{dr_0}{dt} = \lambda_1 r_0, \frac{dr_1}{dt} = \lambda_2 r_1 + r_0, \frac{dr_2}{dt} = \lambda_3 r_2 + r_1$$ together with the initial conditions $r_0(0) = 1, r_1(0) = 0, r_2(0) = 0.$
Once we have $r_0, r_1, r_2$ the fundamental matrix $e^{at} = r_0 p_0 + r_1 p_1  + r_2 p_2$ and we are done.