What’s is the restrictions for the function MatrixExp?

When I use the MatrixExp on a general 2×22\times2 matrix, Mathematica
gives me this result:

MatrixExp[{{a,b},{c,d}}] // TraditionalForm

e^{\frac{\triangle+a+d}{2}}\left(\triangle+a-d\right)-e^{\frac{-\triangle+a+d}{2}}\left(-\triangle+a-d\right) & 2be^{\frac{\triangle+a+d}{2}}-2be^{\frac{-\triangle+a+d}{2}}\\
2ce^{\frac{\triangle+a+d}{2}}-2ce^{\frac{-\triangle+a+d}{2}} & e^{\frac{\triangle+a+d}{2}}\left(\triangle-a+d\right)-e^{\frac{-\triangle+a+d}{2}}\left(-\triangle-a+d\right)

where △=√a2−2ad+4bc+d2\triangle=\sqrt{a^{2}-2ad+4bc+d^{2}}

Is this true for any matrix {{a,b},{c,d}} (including complex matrix)?
If it is not, what is the restrictions on the matrix {{a,b},{c,d}}?




from help works only on square matrices. So as long as the matrix is square, it will work.
– Nasser
Jan 11 at 6:03



I found this requirement from help also, it’s a weak even strange requirement. I guess there exist more restrictions on the matrix if we are interested in complex matrix.
– phchen
Jan 11 at 6:07


1 Answer


By default, all variables in Mathematica are assumed complex, and generic results are calculated if you don’t specify any restrictions, e.g., with Assumptions.

So the above result is generically true for complex matrices. But it’s not true for non-generic matrices, where some elements have special values. For example, take


which gives errors. You would have to calculate such specific cases separately:

MatrixExp[{{a, b}, {0, a}}]

(* ==> {{E^a, b E^a}, {0, E^a}} *)



Specifically, it will fail for specialized values that make the Jordan decomposition non-generic.
– Daniel Lichtblau
Jan 11 at 15:46



@DanielLichtblau Sorry, I don’t understand your comment, could you please give me a example to digest?
– phchen
Jan 11 at 16:11



Jens provided a very explicit example. The Jordan matrix for {{a,b},{c,d}} has two distinct eigenvalues and no ones over the main diagonal. For the special form {{a,b},{0,a}}` it has a repeated eigenvalue (a), and a nontrivial Jordan block, that is, a 1 over the diagonal.
– Daniel Lichtblau
Jan 11 at 17:00



May I conclude as following: “The formula posted here is true only when the matrix is diagonalizable and has 2 different eigenvalues. And the function MatrixExp always gives the correct result” ?
– phchen
Jan 12 at 5:39



I don’t think the eigenvalues even need to be distinct. I think it just needs to be diagonalizable. So the “only” in the statement above is not quite right.
– Daniel Lichtblau
Jan 12 at 15:54