Matrix Diagonalization Calculator
Find the eigenvalues and eigenvectors of a real symmetric matrix. Calculate the matrices P, D, and P inverse, and verify the decomposition A = PDP inverse.
Enter your matrix
Enter one row per line. Separate entries with spaces or commas. This calculator supports symmetric square matrices from 2 x 2 to 8 x 8.
What is matrix diagonalization?
Matrix diagonalization expresses a square matrix as A = PDP-1. D is a diagonal matrix containing eigenvalues, and the columns of P are the corresponding linearly independent eigenvectors.
How it works
- The calculator validates the matrix dimensions and symmetry.
- The Jacobi algorithm repeatedly reduces off-diagonal entries.
- The diagonal entries provide the eigenvalues.
- The eigenvectors form the columns of P.
- The calculator verifies the decomposition by reconstructing A.
Why use diagonalization?
Diagonalization can simplify matrix powers, linear transformations, recurrence relations, and certain systems of differential equations. For a diagonalizable matrix, A to the power n can be computed as P D to the power n P inverse.
Worked example
Try the following symmetric matrix:
1 4 0
0 0 2
Its eigenvalues are 2, 3, and 5. The calculator returns the corresponding eigenvectors and a diagonal matrix with these eigenvalues on its diagonal. Eigenvector signs may differ between valid results.
Frequently asked questions
Can every matrix be diagonalized?
No. A matrix must have enough linearly independent eigenvectors. This calculator focuses on real symmetric matrices, which have an orthonormal eigenbasis.
Why must my matrix be symmetric?
This version uses the Jacobi eigenvalue algorithm for real symmetric matrices. It does not handle general nonsymmetric matrices or complex eigenvalues.
Is P unique?
No. Eigenvectors can be multiplied by negative one without changing their eigenvalues. Repeated eigenvalues can also have different valid orthonormal eigenvector bases.
What does reconstruction error mean?
It is the maximum absolute difference between the input matrix and the reconstructed matrix PDP inverse. A small error indicates that the decomposition is numerically consistent.
Related matrix calculators
Check that these related URLs match the actual pages on your website.