How this calculation works
Solve the 2×2 characteristic equation and construct one eigenvector for each distinct root. A repeated-root scalar matrix uses the standard basis. A non-scalar repeated-root matrix has insufficient eigenvectors. Reconstruct A to check the displayed decomposition.
A = P D P⁻¹, where the columns of P are independent eigenvectors in matching eigenvalue orderA worked example
For A=[[4,1],[2,3]], the eigenvalues are five and two. Directions (1,1) and (1,−2) form an eigenbasis. The normalized columns used by the tool give the same decomposition.
Good to know
Real 2×2 input matrices only, with real or complex output arithmetic. Floating-point tolerances classify nearly repeated roots and near-singular P conservatively. Small reconstruction residual does not guarantee a well-conditioned basis. Not an n×n or Jordan-form calculator.
Keep eigenvector columns matched to D
In A=PDP⁻¹, each column of P is an eigenvector and the corresponding diagonal position of D contains that vector’s eigenvalue. Reordering both consistently leaves a valid decomposition. Reordering only one changes the represented transformation.
An eigenvector can also be multiplied by any nonzero scalar. The normalized columns displayed here may therefore differ from a textbook’s columns without either answer being wrong. The direct reconstruction check compares PDP⁻¹ with the entered A.
Distinguish repeated and defective cases
Two distinct eigenvalues of a 2×2 matrix supply independent eigenvectors over the appropriate field. A repeated eigenvalue needs a separate check. A scalar matrix such as 3I has every nonzero vector as an eigenvector, so the standard basis diagonalizes it.
The matrix [[1,1],[0,1]] instead has only one eigendirection. Its repeated eigenvalue does not supply two independent columns for P, making it defective. A Jordan form describes that different situation; inventing a second eigenvector would hide the essential mathematical issue.
Complex roots change the geometric picture
A real matrix can have complex conjugate eigenvalues. For the quarter-turn rotation [[0,−1],[1,0]], the eigenvalues are i and −i. It can be diagonalized over complex numbers, but it has no real eigenvector direction that merely stretches or reverses.
For that reason the complex case is pictured as eigenvalues in the complex plane, rather than false arrows in the real input plane. For real eigenvalues, the graph compares v with Av. The latter stays on the same line, with scale and direction determined by its eigenvalue.
Inspect the numerical residual and conditioning
The maximum reconstruction residual is the largest absolute entrywise discrepancy between A and PDP⁻¹. It provides a useful arithmetic check for ordinary inputs. Its scale should be considered relative to the matrix entries rather than interpreted as an absolute guarantee for every problem.
Nearly repeated roots can make eigenvectors difficult to distinguish numerically. A small determinant of normalized P signals near dependence, while a small reconstruction residual alone does not certify a stable basis. Use exact algebra or higher precision for sensitive cases. The Jacobian determinant and grid transformation calculator explores a related determinant idea for local coordinate changes.
A few questions, answered
Does a repeated eigenvalue always prevent diagonalization?
No. Scalar 2×2 matrices are diagonalizable; non-scalar matrices with an exactly repeated eigenvalue are defective.
Can the output be complex?
Yes. Negative characteristic discriminant produces conjugate roots and complex P and D.
Why do my eigenvectors have different sizes?
Nonzero scalar multiples are equivalent. This tool normalizes each vector.