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

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

$\frac{1}{2\triangle}\left(\begin{array}{cc} 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) \end{array}\right)$

where $\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}}?

  • $\begingroup$ from help works only on square matrices. So as long as the matrix is square, it will work. $\endgroup$
    – Nasser
    Jan 11, 2016 at 6:03
  • $\begingroup$ 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. $\endgroup$
    – phchen
    Jan 11, 2016 at 6:07

1 Answer 1


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}} *)
  • 1
    $\begingroup$ Specifically, it will fail for specialized values that make the Jordan decomposition non-generic. $\endgroup$ Jan 11, 2016 at 15:46
  • $\begingroup$ @DanielLichtblau Sorry, I don't understand your comment, could you please give me a example to digest? $\endgroup$
    – phchen
    Jan 11, 2016 at 16:11
  • 1
    $\begingroup$ 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. $\endgroup$ Jan 11, 2016 at 17:00
  • $\begingroup$ 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" ? $\endgroup$
    – phchen
    Jan 12, 2016 at 5:39
  • 1
    $\begingroup$ 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. $\endgroup$ Jan 12, 2016 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.