If you give an array as the argument to a mathematical function in a programming language or problem solving environment you are likely to receive the result of applying the function to each component of the array. For example, here MATLAB exponentiates the integers from 0 to 3:

>> A = [0 1; 2 3], X = exp(A) A = 0 1 2 3 X = 1.0000e+00 2.7183e+00 7.3891e+00 2.0086e+01

When the array represents a matrix this componentwise evaluation is not useful, as it does not obey the rules of matrix algebra. To see what properties we might require, consider the matrix square root. This function is notable historically because Cayley considered it in the 1858 paper in which he introduced matrix algebra.

A square root of an matrix is a matrix such that . Any square root satisfies

so commutes with . Also, , so is a square root of (here, the superscript denotes the conjugate transpose).

Furthermore, for any nonsingular matrix we have

If we choose as a matrix that takes to its Jordan canonical form then we have , so that is a square root of , or in other words can be expressed as .

Generalizing from these properties of the matrix square root it is reasonable to ask that a function of a square matrix satisfies

- commutes with ,
- ,
- , where has the Jordan canonical form .

(These are of course not the only requirements; indeed satisfies all three conditions.)

Many definitions of can be given that satisfy these and other natural conditions. We will describe just three definitions (a notable omission is a definition in terms of polynomial interpolation).

## Power Series

For a function that has a power series expansion we can define by substituting for the variable. It can be shown that the matrix series will be convergent for matrices whose eigenvalues lie within the radius of convergence of the scalar power series. For example, where denotes the spectral radius. This definition is natural for functions that have a power series expansion, but it is rather limited in its applicability.

## Jordan Canonical Form Definition

If has the Jordan canonical form

where

then

where

Notice that has the derivatives of along its diagonals in the upper triangle. Write , where is zero apart from a superdiagonal of 1s. The formula for is just the Taylor series expansion

The series is finite because : as is powered up the superdiagonal of 1s moves towards the right-hand corner until it eventually disappears.

An immediate consequence of this formula is that is defined only if the necessary derivatives exist: for each eigenvalue we need the existence of the derivatives at of order up to one less than the size of the largest Jordan block in which appears.

When is a diagonalizable matrix the definition simplifies considerably: if with then .

## Cauchy Integral Formula

For a function analytic on and inside a closed contour that encloses the spectrum of the matrix can be defined by the Cauchy integral formula

This formula is mathematically elegant and can be used to provide short proofs of certain theoretical results.

## Equivalence of Definitions

These and several other definitions turn out to be equivalent under suitable conditions. This was recognized by Rinehart, who wrote in 1955

“There have been proposed in the literature since 1880 eight distinct definitions of a matric function, by Weyr, Sylvester and Buchheim, Giorgi, Cartan, Fantappiè, Cipolla, Schwerdtfeger and Richter … All of the definitions except those of Weyr and Cipolla are essentially equivalent.”

## Computing a Matrix Function in MATLAB

In MATLAB, matrix functions are distinguished from componentwise array evaluation by the postfix “m” on a function name. Thus `expm, logm`

, and `sqrtm`

are matrix function counterparts of `exp, log`

, and `sqrt`

. Compare the example at the start of this article with

>> A = [0 1; 2 3], X = expm(A) A = 0 1 2 3 X = 5.2892e+00 8.4033e+00 1.6807e+01 3.0499e+01

The MATLAB function `funm`

calculates for general matrix functions (subject to some restrictions).

## References

This is a minimal set of references, which contain further useful references within.

- Nicholas J. Higham, Functions of Matrices: Theory and Computation, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2008.
- Roger Horn and Charles Johnson, Topics in Matrix Analysis, Cambridge University Press, 1991.
- R. F. Rinehart, The Equivalence of Definitions of a Matric Function, Amer. Math. Monthly 62(6), 395-414, 1955.

## Related Blog Posts

- Arthur Buchheim (1859–1888) (2013)
- Update of Catalogue of Software for Matrix Functions (2020)
- What Is a Matrix Square Root? (2020)
- What Is the Matrix Exponential? (2020)

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.