[Math] Computing an exponential of matrix via cayley-hamilton

linear algebraMATLABmatricesmatrix exponential

I want to compute the exponential $e^{At}$ of
$$A=\left( \begin{matrix} 5&2 \\ 0&5 \end{matrix}\right)$$

via Cayley-Hamilton theorem.

So, the formula is:

$$e^{At}=\alpha_0I+\alpha_1A$$

In order to find $\alpha_0$ and $\alpha_1$, I have to solve the following system of equations:

$$\begin{cases}
e^{5t}=\alpha_0+5\alpha_1\\[1ex]
te^{5t}=\alpha_1
\end{cases}$$

I don't really know if I formulated the system of equations correctly, because when I compute this in MATLAB I got a different result in respect to the one given by the MATLAB function expm:

A=[5 2;0 5];

syms t

expm(A*t) %computing by MATLAB function

% Computing by Cayley-Hamilton:

B=[exp(5*t);t*exp(5*t)];

C=[1 5;0 1];

X=C\B;

exponential=X(1,1)*eye(2)+X(2,1)*A

The results are:

By MATLAB:

[ exp(5*t), 2*t*exp(5*t); 0, exp(5*t)]

By 'what I did'

[ exp(5*t) – 4*t*exp(5*t), 5*t*exp(5*t); 0, exp(5*t) – 4*t*exp(5*t)]

They are different. So what am I doing wrong here?

Best Answer

Instead of relying on a memorized formula, try working directly with what the Cayley-Hamilton theorem tells you.

Since $A$ is upper-triangular, we see immediately that it has a repeated eigenvalue of $5$, so by C-H we know that $(A-5I)^2=0$. In other words, $A$ can be decomposed into the sum of the diagonal matrix $5I$ and the nilpotent matrix $N=A-5I$, with $N^2=0$. As Will Jagy points out in his comment, these two matrices commute, so $$\exp(tA)=\exp(5tI)\exp(tN).$$ Since $N$ is nilpotent, the series for its exponential gets truncated after a couple of terms, giving $\exp(tN)=I+tN$. Multiplying by a scalar multiple of the identity matrix amounts to scalar multiplication, so putting it all together we get $$\exp(tA)=e^{5t}(I+tN)=\pmatrix{e^{5t}&2te^{5t}\\0&e^{5t}},$$ just as MATLAB computed.

Update: To relate this to the method in the paper you cite, note that $\alpha_0I+\alpha_1A=(\alpha_0+5\alpha_1)I + \alpha_1N$, which yields the system $$\begin{align}\alpha_0+5\alpha_1&=e^{5t}\\\alpha_1&=te^{5t},\end{align}$$ as you had, with solution $$\begin{align}\alpha_0&=e^{5t}(1-5t)\\\alpha_1&=te^{5t}.\end{align}$$ It would appear that you’ve made an arithmetic error somewhere, since you’ve got $(1-4t)$ instead. Note that the second equation in this system is what you’d get by differentiating the first, as per the note on repeated eigenvalues at the end of the paper.

P.S.: More generally, for a $2\times2$ matrix $A$ with repeated eigenvalue $\lambda$, we have $$\begin{align}e^{tA}&=e^{\lambda t}(I+tN)\\&=e^{\lambda t}(I+tA-\lambda tI)\\&=(1-\lambda t)e^{\lambda t}I+te^{\lambda t}A,\end{align}$$ so $\alpha_0=(1-\lambda t)e^{\lambda t}$ and $\alpha_1=te^{\lambda t}$.

Related Question