Trigonometric Functions of Commutative Matrices

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

An exponential or trigonometric function of a matrix is defined in terms of the Taylor series expansion of [2]:





Define the commutator of and as ; if the matrices commute, their commutator is the zero matrix and .

By the Baker–Campbell–Hausdorff formula [3], if both and commute with their commutator,


while .

The same kind of reasoning applies to matrices of trigonometric functions, since they can be expressed in terms of complex exponential functions.

As a further consequence, various trigonometric identities remain valid for a matrix , such as


This Demonstration shows some properties of commutative matrices that stem from the BCH formula. Let and , where is a random square matrix and and are diagonal matrices [1].

Then and commute because diagonal matrices commute: .

The "regenerate" button randomly generates a new matrix .

Also, exponential functions have been taken into account [3].

Use the control to modify the order of the series. To better understand the importance of the order, there are different plots of the matrix traces related to the value of the degree; overlapping means the right level of approximation has been reached. The matrix trace is an indicator of the right level of approximation; it empirically gives the best results. As the number of summands increases, the convergence is reached with lower .


Contributed by: D. Meliga, A. Ratti and S. Z. Lavagnino (August 2019)
Additional contribution by: L. Lavagnino
Open content licensed under CC BY-NC-SA


Snapshot 1: initial matrices used for all the operations

Snapshot 2: trigonometric identity applied to the matrix

Snapshot 3: trigonometric sum to product identity applied to and matrices with an insufficient degree of the Taylor series

Snapshot 4: Baker–Campbell–Hausdorff formula applied to and matrices; as they commute, the formula is simplified

Snapshot 5: trace versus degree plot of the two trigonometric sums to product identity matrices; the two plots overlap when the degree is high enough and the identity is correct


[1] S. Lipschutz and M. L. Lipson, Linear Algebra, 4th ed., New York: McGraw-Hill, 2009.

[2] Wikipedia. "Trigonometric Functions of Matrices." (Jun 24, 2019)

[3] Wikipedia. "Baker–Campbell–Hausdorff formula." (Aug 9, 2019) E2 %80 %93 Campbell % E2 %80 %93 Hausdorff_formula.


Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.