Use symbolic linear algebraLesson 35 of 48 · 8 min

Use a different coordinate basis

Verify diagonalisation before using it to compute a matrix power.

Maths refresher: Changing coordinates

A basis gives a set of independent coordinate directions. A change of basis describes the same transformation using different coordinates.

A=PDP−1⟹An=PDnP−1A=PDP^{-1}\quad\Longrightarrow\quad A^n=PD^nP^{-1}
Worked example

The middle P−1PP^{-1}P factors cancel in repeated multiplication. The formula requires an invertible P and a valid decomposition.

Maths prerequisite map ↗

A diagonalisation writes A=PDP−1A=PDP^{-1}, where D is diagonal and the columns of P form an eigenvector basis. In those coordinates, repeated applications reduce to powers of diagonal entries.

Change coordinates, scale, return
  1. Eigenvector coordinates
    P−1vP^{-1}v
  2. Scale coordinates
    DP−1vDP^{-1}v
  3. Original coordinates
    PDP−1v=AvPDP^{-1}v=Av
Starter reference. Columns of P are an eigenvector basis. This route requires an invertible P; not every matrix has such a basis.

Not every square matrix is diagonalizable. Repeated eigenvalues do not by themselves decide the question; the number of independent eigenvectors matters. Check the reconstruction before using a diagonalisation to infer anything else.

The example reconstructs a small symmetric matrix and compares its fifth power with the diagonal-basis calculation. A second matrix demonstrates that diagonalisation is a property to establish rather than an operation guaranteed for every input. This exact example focuses on meaning, not a claim of numerical speed.

Can you use a diagonal-power formula without first establishing a valid eigenvector basis?

Write a prediction (optional)

Exact symbolic investigation

Select Run Python with the code unchanged.

Tools
About Python

Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗

Ctrl+Enter or ⌘+Enter runs Python.

Compare with the worked example

Executed from the published Python during the site build. Your own run appears above. Build environment ↗

Basis matrix P
[−1111]\left[\begin{matrix}-1 & 1\\1 & 1\end{matrix}\right]
Diagonal matrix D
[1003]\left[\begin{matrix}1 & 0\\0 & 3\end{matrix}\right]
Reconstruction residual
[0000]\left[\begin{matrix}0 & 0\\0 & 0\end{matrix}\right]
Power residual
[0000]\left[\begin{matrix}0 & 0\\0 & 0\end{matrix}\right]
Is J diagonalizable?
False\text{False}
J eigenspace basis
[(1, 2, [[10]])]\left[ \left( 1, \ 2, \ \left[ \left[\begin{matrix}1\\0\end{matrix}\right]\right]\right)\right]
Worked text output
Basis matrix P: Matrix([[-1, 1], [1, 1]])
Diagonal matrix D: Matrix([[1, 0], [0, 3]])
Reconstruction residual: Matrix([[0, 0], [0, 0]])
Power residual: Matrix([[0, 0], [0, 0]])
Is J diagonalizable?: False
J eigenspace basis: [(1, 2, [Matrix([
[1],
[0]])])]

Read the starter result

The two zero residual matrices verify reconstruction and the power calculation. In J eigenspace basis, the one eigenvalue has multiplicity two but only one independent eigenvector.

Edit and compare

Replace power = 5 with power = 10. Select Run Python and read Power residual. Then read J eigenspace basis. Does J provide enough independent eigenvectors for a two-dimensional basis?

Return to the editor

Scope. Exact diagonalisation can be unsuitable or unstable for numerical work; specialised numerical methods may be preferable.

Try a fresh case

A repeated eigenvalue appears. What is needed before claiming diagonalizability?

Choose an answer
Need a hint?
Hint 1

P must be invertible.

Hint 2

Count independent eigenvectors, not just repeated root labels.

Your notesNotes save in this browser when storage is available.