Here’s something I found surprising: the powers of a 2×2 matrix have a fairly simple closed form. Also, the derivation is only one page [1].
Let A be a 2×2 matrix with eigenvalues α and β. (3Blue1Brown made a nice jingle for finding the eigenvalues of a 2×2 matrix.)
If α = β then the nth power of A is given by
If α ≠ β then the nth power of A is given by
Example
Let’s do an example with
The eigenvalues are 26 and 3. I chose the matrix entries based on today’s date, not to have integer eigenvalues, and was surprised that they turned out so simple [2]. (More along those lines here.)
Here’s a little Python code to show that the formula above gives the same result as directly computing the cube of A.
import numpy as np A = np.matrix([[6, 3], [20, 23]]) m = (6 + 23)/2 p = 6*23 - 3*20 α = m + (m**2 - p)**0.5 β = m - (m**2 - p)**0.5 print(α, β) I = np.eye(2) direct = A*A*A formula = α**3*(A - β*I)/(α - β) + β**3*(A - α*I)/(β - α) print(direct) print(formula)
[1] Kenneth S. Williams. The nth Power of a 2×2 Matrix. Mathematics Magazine, Dec., 1992, Vol. 65, No. 5, p. 336.
[2] I wrote a script to find out how often this happens, and it’s more often than I would have guessed. There are 31 dates this year that would give integer eigenvalues if arranged as in the example.
The post Powers of a 2×2 matrix in closed form first appeared on John D. Cook.