Matrix Power Calculator
Computes Aⁿ by repeated multiplication and shows the intermediate powers A², A³, …
INPUT
Integers, fractions (1/3) and decimals (0.25) are accepted. Empty cells count as 0. Paste a block of numbers from a spreadsheet or textbook into the first cell to fill the whole matrix.
RESULT
LaTeX is the math code you can paste into Overleaf, Notion equation blocks or Word's equation editor.
Steps
Powers of a matrix
Aⁿ is the square matrix A multiplied by itself n times, with A⁰ defined as the identity I.
For a diagonal matrix, raise each diagonal entry to the n-th power. For a general matrix, diagonalization A = PDP⁻¹ gives Aⁿ = PDⁿP⁻¹ quickly.
Full explanation with examples: Matrix Diagonalization and Powers Aⁿ, Step by Step (2×2 Example)
Exam tipThe entries of [[1, 1], [1, 0]]ⁿ are Fibonacci numbers, a classic recurrence example.
How to do it by hand
- Compute A² = A·A using ordinary matrix multiplication.
- Then A³ = A²·A, A⁴ = A³·A and so on. For large exponents, repeated squaring (A⁴ = (A²)²) cuts the number of multiplications.
- For a diagonal matrix just raise the diagonal entries to the n-th power. If A = PDP⁻¹ is diagonalizable, Aⁿ = PDⁿP⁻¹ gives any power at once.
- A⁰ = I. Negative powers are powers of the inverse.
Cube A = [1 1; 0 1].
A² = [1·1+1·0 1·1+1·1; 0 1] = [1 2; 0 1]
A³ = A²·A = [1·1+2·0 1·1+2·1; 0 1] = [1 3; 0 1]
See the pattern? Aⁿ = [1 n; 0 1]. This matrix is a shear, and Aⁿ is the shear applied n times.
Where is it used?
- Markov chains: the n-th power of the transition matrix gives the probabilities after n steps. Weather models and PageRank work this way.
- Graph theory: entry (i, j) of Aⁿ for an adjacency matrix A counts the walks of length n from i to j.
- Recurrences: the Fibonacci numbers appear as entries of [1 1; 1 0]ⁿ, so a power gives the n-th term directly.
Common mistakes
- Raising each entry to the n-th power. [1 2; 3 4]² is not [1 4; 9 16]; it is [7 10; 15 22].
- Assuming (AB)ⁿ = AⁿBⁿ. That only holds when AB = BA.
- Concluding from A² = 0 that A = 0. [0 1; 0 0] is nonzero but squares to zero (a nilpotent matrix).
How to use
- Set the matrix size with the row and column buttons. Up to 6×6 is supported.
- Type numbers into the cells and the result updates instantly. Enter fractions as
1/3and negatives as-2. - Enter moves to the next cell; the ← → ↑ ↓ arrow keys move between cells.
- Open ‘Steps’ to see the full working. ‘Copy LaTeX’ copies the result as math code you can paste into Overleaf, a Notion equation block or Word's equation editor.
FAQ
- Are negative exponents supported?
- No, only integers from 0 to 12. For A⁻ⁿ, invert the matrix first and raise the inverse to the n-th power.
- Why must the matrix be square?
- A·A is only defined when the number of columns of A equals its number of rows.
Related guides
- Matrix Diagonalization and Powers Aⁿ, Step by StepDiagonalize A = PDP⁻¹ and turn it into a formula for Aⁿ = PDⁿP⁻¹.
- Matrix Multiplication: Rules, Worked Examples and Why AB ≠ BAThe size condition, how to compute each entry, and why AB and BA differ, with worked examples.
- How to Find Eigenvalues and Eigenvectors (2×2 Matrix Example)Follow a worked example: eigenvalues from the characteristic equation, eigenvectors from (A − λI)v = 0.