Search for probability and statistics terms on Statlect

Matrix function

by , PhD

Consider a scalar-valued function of a single variable, such as, for example, the exponential function or the sine function.

Can we extend the definition of that function in such a way that it takes square matrices as arguments and returns square matrices of the same dimension as outputs?

This lecture deals with the problem of defining such extensions in a useful manner.

Table of Contents

Scalar functions

Let F be a field of scalars, such as the set of real numbers R or the set of complex numbers $U{2102} $.

We will consider functions $f:F
ightarrow F$ and the problem of extending them is such a way that[eq1]is a well-defined $K	imes K$ output matrix, for any $K	imes K$ input matrix A.

Element-wise functions

The simplest way to extend $f$ is to apply it element-wise, by defining[eq2]for $k=1,ldots ,K$ and $l=1,ldots ,K$, where $A_{kl}$ is the $left( k,l
ight) $-th entry of A and [eq3] is the $left( k,l
ight) $-th entry of $fleft( A
ight) $.

This extension, which has numerous applications, is straightforward and we do not need to discuss it further.

Matrix polynomials

The element-wise extension has the problem that it is not compatible with the way in which we have defined matrix polynomials.

Remember that an ordinary polynomial is a function $f:F
ightarrow F$ defined as[eq4]where the coefficients [eq5] also belong to the field of scalars F.

The extension of $f$ to square matrices, which is called a matrix polynomial, is defined as[eq6]where A is a $K	imes K$ matrix and I is the $K	imes K$ identity matrix.

In the definition of a matrix polynomial, the powers [eq7] are matrix powers obtained by repeatedly multiplying A by itself[eq8]

As we know, multiplying two matrices is not the same as taking the element-wise products of their entries.

Therefore, the above definition of an element-wise matrix function is not consistent with the definition of a matrix polynomial.

Properties that should be satisfied by a matrix function

We are now going to discuss some properties that should be satisfied by a sound definition of matrix function.

We have already said about the consistency with the definition of a matrix polynomial.

In the next sections we will discuss some properties that are desirable when:

Finally, we will provide a formal definition that satisfies all these desirable properties.

Note: since the next sections only serve as motivation for the definition of a matrix function, the discussion therein is not completely rigorous (e.g., possible issues about the convergence of infinite series are not analyzed rigorously).

Analytic functions

Many interesting and useful functions $f:F
ightarrow F$ are analytic, that is, they coincide with their (convergent) Taylor series:[eq10]where:

Roughly speaking, a Taylor series is an infinite polynomial. Therefore, to be consistent with the definition of a matrix polynomial, the definition of a matrix function should be such that[eq12]whenever $f$ is analytic.

Diagonalizable matrices

Suppose that $f$ is analytic in a neighborhood of $z_{0}=0$, so that the Taylor expansion above becomes[eq13]

Further assume that A is diagonalizable, that is, [eq14]where $P$ is an invertible matrix and $D$ is a diagonal matrix whose diagonal entries are equal to the eigenvalues of A, denoted by [eq15].

Then, we have[eq16]provided that the eigenvalues of A are included in the neighborhood over which $f$ is analytic.

This derivation shows another property that a definition of matrix function should have: if A has the diagonalization [eq17]then [eq18]where $fleft( D
ight) $ is obtained by applying $f$ to each diagonal entry of $D$.

Jordan blocks

Remember that a $K	imes K$ matrix $J$ is said to be a Jordan block with eigenvalue $lambda $ if and only if all its diagonal entries are equal to $lambda $, all its supradiagonal entries are equal to 1, and all the remaining entries are equal to 0.

As in Higham (2008), we focus on $3	imes 3$ Jordan blocks, which have the form[eq19]

We can also write[eq20]where[eq21]is a nilpotent matrix.

Raising A to integer powers moves the diagonal of 1s towards the upper-right corner:[eq22]and $N^{k}=0$ for $kgeq 3$.

When $f$ is analytic in a neighborhood of $lambda $, its Taylor expansion can be written as:[eq23]


By using the same technique, we can show that, for larger Jordan blocks $J$, $fleft( J
ight) $ has a similar structure.

For example, if $J$ is $5	imes 5$, then[eq25]

This kind of structure for $fleft( J
ight) $ is another property that our definition of a matrix function should satisfy.

Matrices in Jordan form

Remember that a matrix $J$ is in Jordan form if it is block-diagonal and all its diagonal blocks are Jordan blocks:

[eq26]where [eq27] are Jordan blocks.

Then, if $f$ is analytic in a sufficiently large neighborhood of a point $z_{0}$, we have[eq28]where [eq29] can be computed as in the previous section.

Finally, any matrix A is similar to a matrix $J$ in Jordan form:[eq30]where $P$ is an invertible matrix.

Therefore,[eq31]where $fleft( J
ight) $ has been derived above.


After this long motivating discussion, we are ready to provide the standard definition of a matrix function.

Definition Let A be a $K	imes K$ matrix having $m$ distinct eigenvalues [eq32]. Let[eq33]be a Jordan decomposition of A, where [eq34]is a matrix in Jordan form, with Jordan blocks [eq27]. Denote by $
u _{i}$ the dimension of the largest Jordan block having eigenvalue $lambda _{i}$. Let $f:F
ightarrow F$ be a scalar function. Suppose that[eq36]exists for any $i=1,ldots ,m$ and any [eq37]. Then, the matrix function $fleft( A
ight) $ is defined as[eq38]where, for a Jordan block $J_{d,lambda }$ having dimension $d$ and eigenvalue $lambda $, [eq39] is defined as[eq40]

Since the Jordan decomposition of a matrix is not unique, this definition makes sense only as long as $fleft( A
ight) $ does not depend on which decomposition we pick. A proof of the lack of of this kind of dependence can be found, for example, in Meyer (2000).


Clearly, this definition satisfies the properties that we have outlined in the motivating discussion about Jordan blocks and matrices in Jordan form.

Moreover, if A is diagonalizable and its eigenvalues are [eq41], then $n=K$, $J$ is diagonal, the Jordan blocks have dimension 1, and[eq42]

This is the property previously outlined in the section about diagonalizable matrices.

The last thing to note is that $f$ is not required to be analytic in the definition above. However, it is possible to prove the following property, which completes the list of desirable properties put forward in our motivating discussion.

Proposition Suppose that $f:F
ightarrow F$ is analytic in a neighborhood of a point $z_{0}$, and that the neighborhood includes all the eigenvalues of A. Let $fleft( A
ight) $ be as in the standard definition above. Then,[eq43]


Application to systems of differential equations

The definition of a matrix function we have just provided has several useful applications. One of them is to solve linear systems of differential equations.

Let [eq44]be a $2	imes 1$ vector whose entries are functions of time.

The $j$-th derivative of $y$ with respect to $t$ is denoted by[eq45]

Suppose that $yleft( t
ight) $ satisfies the linear system of differential equations[eq46]with initial condition [eq47], where A is a $2	imes 2$ matrix and $y_{0}$ is a $2	imes 1$ vector.

By repeatedly differentiating both sides of the equation with respect to $t$, we obtain[eq48]

Thus, an analytic solution of the system of differential equations can be worked out as follows:[eq49]

By using the theory developed above, we can re-write the solution as[eq50]where the scalar function $f$ is easily recognized to be the exponential function:[eq51]

If A is diagonalizable as [eq52] and the two eigenvalues on the diagonal of $D$ are $lambda _{1}$ and $lambda _{2}$, then[eq53]and the solution of the system of differential equations is[eq54]

If A is not diagonalizable, it has the Jordan decomposition[eq55]

Then,[eq56]and the solution of the system of differential equations is[eq57]

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Let [eq58]

Compute $A^{5}$ by using the definition of a matrix function.


The matrix A is already in Jordan form. It has two Jordan blocks[eq59]The scalar function [eq60]is extended to the matrix A as follows:[eq61]

Exercise 2

Let [eq62]

Find the solution of the system of differential equations[eq63]with initial condition [eq64]


Since A is already in Jordan form, the solution is[eq65]


Golub, G. H., Van Loan, C. F. (2013) Matrix Computations, Johns Hopkins University Press.

Higham, N. J. (2008) Functions of Matrices: Theory and Computation, SIAM.

Meyer, C. D. (2000) Matrix Analysis and Applied Linear Algebra, SIAM.

How to cite

Please cite as:

Taboga, Marco (2021). "Matrix function", Lectures on matrix algebra.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.