Revealing the Hidden Mathematical Beauties of the Cayley-Hamilton Method

Abstract

The inversion of a non-singular square matrix applying a Computer Algebra System (CAS) is straightforward. The CASs make the numeric computation efficient but mock the mathematical characteristics. The algorithms conducive to the output are sealed and inaccessible. In practice, other than the CPU timing, the applied inversion method is irrelevant. This research-oriented article discusses one such process, the Cayley-Hamilton (C.H.) [1]. Pursuing the process symbolically reveals its unpublished hidden mathematical characteristics even in the original article [1]. This article expands the general vision of the original named method without altering its practical applications. We have used the famous CAS Mathematica [2]. We have briefed the theory behind the method and applied it to different-sized symbolic and numeric matrices. The results are compared to the named CAS’s sealed, packaged library commands. The codes are given, and the algorithms are unsealed.

Share and Cite:

Sarafian, H. (2024) Revealing the Hidden Mathematical Beauties of the Cayley-Hamilton Method. American Journal of Computational Mathematics, 14, 257-263. doi: 10.4236/ajcm.2024.142010.

1. Introduction

In science and engineering, one routinely encounters the eigenvector and eigenvalue equations. For instance, in physics, e.g., in quantum mechanics, the wave function, ψ being an eigenvector of a stationary state, is subject to the Hamiltonian-based approach conducive to the Schrodinger equation [3] [4] [5],

H ^ ψ=Eψ ,(1)

where H ^ is the Hamiltonian operator corresponding to the eigenvalue energy, E.

Alternatively, if one envisions it to be represented by a squared matrix, the Heisenberg approach [3] [4] [5], according to mathematical notations [6] in general (1), is written as,

A ^ y =λ y (2)

Here, y is the eigenvector and the, λ its corresponding eigenvalue. Arranging (2) in the linear algebra format [6], (2) yields,

( A ^ λ ) y =0 (3)

The solution to (3) yields the nonzero eigenvectors—values that require criteria.

det( A ^ λI )=0 .

where det is the determinant, and I is an identity matrix. The solution of this determinant equation leads to the needed, λ and the, y . This is a soft, short idea behind the eigenvector-value concept. In practice, following these steps, one gets the needed information.

Cayley and Hamilton [1] (C-H) have taken another step, directed to a different objective: inversion of the matrix, within the issue’s framework.

Since the determinant equation yields a λ dependent polynomial equation, their approach replaced the λ’s in the latter with the original matrix! i.e. λ by matrix. Consequently, the λ dependent polynomial equation becomes a matrix polynomial equation. Obviously, in doing so, both polynomials sustain their corresponding polynomial coefficients. A bit of manipulation leads to the inverted matrix. In practice, most exercises are numeric [7]-[13] and work successfully. However, this numeric method misses my point, which is the objective of this article.

In many words, because numeric matrices are used, there is no reason to pay attention to the “source-origin” of these coefficients. Rightfully, this is because of the objective and the goal of the search. Hence, one may think, as is the current trend of thought that these coefficients are “structureless-patternless,” but we have shown otherwise.

Our conclusion hinges on a symbolic, not numeric, approach, which we owe to CAS’s symbolic capabilities [2].

The layout of this work has four sections. In addition to Sect. 1, Introduction, Sect. 2, is Formulation. It is composed of three subsections that symbolically detail the main idea. In Sect. 3, Examples, via one numeric example, the formulation of Section 2 is in action. The last Sect., Conclusion are the highlights of the achievements.

2. Formulation

2.1. Example: A 3 × 3 Matrix

We are transitioning from the λ dependent polynomial to its associated matrix polynomial calls for replacing λ matrix. This operation doesn’t alter the coefficients of the former or the latter polynomials. In practice, numeric matrices aim at the product, i.e., calculating the eigenvectors’ values, so one ignores the details! source of these values. However, we reveal a few hidden facts by symbolically pursuing the same idea by manipulating these coefficients. Specifically, we consider manageably sized matrices, e.g., a 3 × 3 and a 4 × 4, adopting a CAS, e.g., Mathematica [2], where we show the details.

Consider a 3 × 3 matrix, B. The needed elements of the determinant equation, the equation on the line below (3) is,

B=Table[bi,j,{i,1,3},{j,1,3}];

λBI=DiagonalMatrix[λ{1,1,1}];

(B-λBI)//MatrixForm;

Det[(B-λBI)];

polyλB=Collect[Det[(B-λBI)],λ]==0

λ 3 b 1,3 b 2,2 b 3,1 + b 1,2 b 2,3 b 3,1 + b 1,3 b 2,1 b 3,2 b 1,1 b 2,3 b 3,2 b 1,2 b 2,1 b 3,3 + b 1,1 b 2,2 b 3,3 + λ 2 ( b 1,1 + b 2,2 + b 3,3 )+λ( b 1,2 b 2,1 b 1,1 b 2,2 + b 1,3 b 3,1 + b 2,3 b 3,2 b 1,1 b 3,3 b 2,2 b 3,3 )=0 (4)

Equation (4) is a complete third-order descending monotonic polynomial with coefficients that appear to be structureless-patternless. A careful analysis has proven otherwise. First, following the C-H approach, the λ’s in (4) is replaced with matrices, i.e., λ by B . Then, by manipulating the coefficients of (4), it yields (5),

B 3 +Tr( B ) B 2 { det( b 11 b 12 b 21 b 22 )+det( b 22 b 23 b 32 b 33 )+det( b 11 b 13 b 31 b 33 ) }B+det( B )=0 , (5)

Noticing five features: 1) the coefficient of the highest ordered B, in this case, order 3 has a (−) sign. As we have shown with other examples, this comes from (−)n; n being the size of the matrix on hand; n = 3. 2) The coefficient of the next lowered order of B, i.e., B2, is the Trace of the matrix accompanied by a positive sign, Tr, which stands for Trace. 3) the coefficient of the next lower order of B with an over sign of (−) is written as a sum of three 2 × 2 determinants, denoted by det. The number of terms in the sum increases for larger matrices. Nonetheless, each term of the sum is a 2 × 2 matrix. 4) the B independent term, i.e., B0, is always a determinant of the matrix on hand. 5) The terms of the monotonic polynomial alternate signs, as shown in (5), the highest ordered term has a minus sign that is (−)n and, for n = 3 is a minus.

As mentioned, had this been analyzed numerically, the five bullet points mentioned would have been missed, as is the status in the literature [7]-[13].

Taking advantage of the B independent term in the polynomial, i.e., B0 term in (5) by multiplying (5) from left by B-1 “unintentionally,” the C-H approach yields the inverted matrix, in our case symbolically. With a bit of manipulation, this gives,

B 1 = 1 det( B ) [ B 2 +Tr( B )B{ det( b 11 b 12 b 21 b 22 )+det( b 22 b 23 b 32 b 33 )+det( b 11 b 13 b 31 b 33 ) } ] (6)

The format of (6) is not reported in the literature [7]-[13]. The only needed criteria applying (6) is a command calculating (matrix)power, a library command in any chosen CAS.

2.2. Example: A 4 × 4 Matrix

Next, we consider a larger matrix, a 4 × 4. Following the same previous routine explained in Sect. 2a we have,

C4=Table[Ci,j,{i,1,4},{j,1,4}];λCI=DiagonalMatrix[λ{1,1,1,1}];(C4-λCI)//MatrixForm;Det[(C4-λ4I)];λ4ordered={λ4,λ3,λ2,λ,0}//MatrixForm;arrows5= Table["",5]//MatrixForm;

It yields after replacing the λ’s in the output polynomial λ->matrix C and rewriting the coefficients in a format compatible with this article’s objective (8). Because the expression is long, the output is shortened.

{CoefficientList[Collect[Det[C4-λCI],λ],λ]//Reverse//MatrixForm,arrows5, λ4ordered}//Short

{ ( 1 C 1,1 C 2,2 C 3,3 C 4,4 C 1,2 C 2,1 +<<14>>+ C 2,2 C 4,4 + C 3,3 C 4,4 <<1>> <<1>> ),( "" "" "" "" "" ),( λ 4 λ 3 λ 2 λ 0 ) } (7)

+ C 4 Tr( C ) C 3 +{ det( c 11 c 13 c 31 c 33 ) +det( c 22 c 23 c 32 c 33 )+det( c 11 c 12 c 21 c 22 ) +det( c 11 c 14 c 41 c 44 )+det( c 22 c 24 c 42 c 44 )+ det( c 33 c 34 c 43 c 44 ) } C 2 { C 11 C 22 det( c 33 c 34 c 43 c 44 ) c 11 c 23 det( c 32 c 34 c 42 c 44 ) }C+det( c ) C 0 =0 (8)

The rows of the first column matrix in (7) are the coefficients of the ordered λ polynomial displayed in the third column matrix. The (8) follows all five bullets mentioned in section 2a. By little manipulation, this yields (8) the inverted matrix, i.e., C1.

C 1 = 1 det[ C ] { + C 4 Tr( C ) C 3 +{ det( c 11 c 13 c 31 c 33 ) +det( c 22 c 23 c 32 c 33 ) +det( c 11 c 12 c 21 c 22 )+det( c 11 c 14 c 41 c 44 )+det( c 22 c 24 c 42 c 44 )+ det( c 33 c 34 c 43 c 44 ) } C 2 { C 11 C 22 det( c 33 c 34 c 43 c 44 ) C 11 C 23 det( c 32 c 34 c 42 c 44 ) }C (9)

2.3. Example: A 2 × 2 Matrix

As a third example consider the simplest case, a 2 × 2 matrix. Although it is the simplest, it provides an opportunity to check the objective of our approach quickly.

G=Table[gi,j,{i,1,2},{j,1,2}];λGI=λIdentityMatrix[2];(G-λGI)//MatrixForm;Det[(G-λGI)]; polyλG=Collect[Det[(G-λGI)],λ]==0

λ 2 g 1,2 g 2,1 +λ( g 1,1 g 2,2 )+ g 1,1 g 2,2 =0 (10)

As in the previous case (10) is rewritten and manipulated, yielding,

G 2 Tr( G )G+det( G )=0, (11)

G 1 = 1 det( G ) [ GTr( G )I ] (12)

Next, we put the mentioned formulation into action, i.e., a numeric example.

3. Numeric Examples

A 3 × 3 Matrix

Consider a numeric 3 × 3 matrix. The code below generates a matrix. Its matrix elements are produced using the Random command. The numeric range of the elements is {−2, 10}. This range can be set arbitrarily.

n=3;Partition[Table[Placeholder[]/.{Placeholder[]->RandomInteger[{-2,10}]},n2],n]//MatrixForm(*//MatrixForm*)(*Det[%]*)

( 8 3 5 7 8 10 7 0 7 )

M=%;

Det[M] (*check the determinate. If zero, repeat the previous lines*);

The determinant equation in the text is coded. The last output of the code is the inverted matrix. This example is in line with public literature [7]-[13].

expEqλ=Det[M-DiagonalMatrix[Table[λ,n]]](*formthecharactristicpolynomial*);reverseCoffexpEqλ=Reverse[CoefficientList[expEqλ,λ]];(*theorderofthepolynomialisreversed,nextlineaccordingtoeq(??)yieldstheinvertedmatrix*)inverseM=-1/(Det[M])( i=1 n1 (reverseCoffexpEqλiMatrixPower[M, n-i])+reverseCoffexpEqλnDiagonalMatrix[Table[1,n]])//MatrixForm (*tocheckthecorresctnessoftheprocedute,theproductofthematrixbyitsinveredshouldresultidentity*formtheHayley-Hamiltoninversion*)MtimesInvertedM=inverseM.M;(*checktheaccuracyoftheoutputjustifyingtheproductofthematrixbyitsinvertedmatrixisunity*)(*checktheoutputvs.library*)libraryInversedM=Inverse[M];(*libraryInvertedMartix*)difference=inverseM-libraryInversedM//MatrixForm;

( 8 33 1 11 10 231 1 11 1 11 15 77 8 33 1 11 43 231 )

4. Conclusions

In this research-oriented article, we focused on the missed information in literature, even in the well-known respected theory of the Cayley-Hamilton method, which is conducive to the inversion of an n × n non-singular matrix. For practical purposes, most Computer Algebra Systems (CAS) include commands that calculate matrix inversion numerically or symbolically. Philosophically speaking, this generally falls in the same category as commands of, e.g., differentiating functions or solving differential equations.

This article differentiates itself from the rest by adding a piece to the named theory. An exhausting literature search shows there is no reference to our report.

In short, with a brief overview, this article reviews the C-H theory and embeds formulation and examples, filling in the missed feature in the original article.

The interested reader may find [14] [15] resourceful for Mathematica programming.

Acknowledgments

The author acknowledges the John T. and Page S. Smith Professorship funds for completing and publishing this work.

Conflicts of Interest

The author declares no conflicts of interest regarding the publication of this paper.

References

[1] Cayley-Hamilton Theorem.
https://en.wikipedia.org/wiki/Cayley%E2%80%93Hamilton_theorem
[2] Mathematica Version 14.0.
http://Wolfram.com
[3] Davydov, A.S. (1966) Quantum Mechanics. NEO Press Technical Translated Series.
[4] Merzbacher, E. (1997) Quantum Mechanics. John Wiley and Sons.
[5] Powell, J. and Crasemann, B. (2015) Quantum Mechanics. Dover.
[6] Strang, G. (2023) Introduction to Linear Algebra. 6th Edition, Wellesley Cambridge Press.
https://atozmath.com>CONM>GaussEli
[7] Inverse of Matrix Using Cayley Hamilton Method Calculator—Inverse of Matrix Using Cayley Hamilton Method.
https://atozmath.com/
[8] Cayley Hamilton Theorem Calculator Calculator Academy.
https://en.wikipedia.org/wiki/Cayley%E2%80%93Hamilton_theorem
[9] Inverse of Matrix Using Cayley Hamilton Method.
https://atozmath.com>example>CONM>GaussEli
[10] https://calculator.academy>Cayley-Hamilton-theorem-cal
[11] Cayley-Hamilton Matrix Inversion Procedure.
https://testbook.com
[12] Step-by-Step Longhand Mathematica Package vs. 1) Mathematica Builtin Library Function and 2) Microsoft Excel Spreadsheet.
https://mathematica.stackexchange.com/
[13] Theorem—From Wolfram MathWorld.
https://mathworld.wolfram.com>Hamilton-CayleyThe...Hamilton-Cayley
[14] Sarafian, H. (2019) “Mathematica Graphics” Examples. 2nd Edition, Scientific Research Publishing.
[15] Wolfram, S. (2003) The Mathematica Book. 5th Edition, Cambridge University Publications.

Copyright © 2025 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.