Similar Matrices

Suppose a linear operator on a plane stretches space along one direction. It compresses space along another direction. In the standard basis, its matrix might look like a dense array of four numbers. This array shows no obvious pattern. But suppose we describe the same operator using a different basis. If that basis aligns with the stretching and compressing directions, the matrix suddenly becomes diagonal. This reveals exactly how the operator behaves. This is the central phenomenon this article addresses. The same linear operator can be represented by wildly different-looking matrices. The specific appearance depends on which basis we use to write down coordinates. The precise relationship between two matrices that represent the same operator in different bases is called similarity. Understanding similarity answers a question. The question is easy to state but consequential to resolve. Which properties of a matrix are genuine properties of the underlying linear operator? Which properties are merely artifacts of a particular choice of coordinates? Determinant, trace, rank, eigenvalues, characteristic polynomial, invertibility — all of these turn out to be shared by similar matrices. This happens precisely because they depend only on the operator. They do not depend on the coordinate system used to describe it. The big picture is this: a matrix is not an intrinsic object attached to a linear map. Instead, it is a representation of that map relative to a chosen basis. Changing the basis changes the matrix. It does not change the operator. Similarity is the equivalence relation on square matrices. It captures the idea of "represents the same operator, possibly in a different basis." This article builds on Change of Basis and the Change-of-Basis Matrix and Matrix Multiplication as Composition. Using these foundations, it derives the similarity relation B=P−1APB = P^{-1}AP rigorously. It also proves this relation is an equivalence relation. Finally, it establishes the invariants this relation preserves. What follows is a complete development. First comes the formal definition of similarity. Next comes an intuitive picture of change of basis. This picture treats change of basis as "translating" the description of a fixed geometric action. Then follows a fully proved central theorem. This theorem identifies similarity with same-operator-different-basis. The article also includes worked numerical examples with asymmetric matrices. It offers a counterexample showing why invertibility of PP is essential. Finally, it surveys where similarity appears across mathematics and its applications. This sets the stage for the deeper study of Invertible Matrices. It also prepares the ground for eventually understanding diagonalization.

Key takeaways
  • Two n×nn\times n matrices A,BA, B are similar if B=P−1APB = P^{-1}AP for some invertible PP.
  • Similar matrices represent the same linear operator T:V→VT: V \to V, just relative to different bases of VV.
  • Similarity is an equivalence relation: reflexive, symmetric, and transitive.
  • Similar matrices share determinant, trace, rank, invertibility, characteristic polynomial, and eigenvalues — but generally not individual entries.
  • The matrix PP is precisely the change-of-basis matrix converting coordinates from the new basis to the old one.
  • Key idea: similarity strips away coordinate-dependent noise, isolating what is truly intrinsic to a linear operator.

Where this lives today

Similarity is the algebraic engine behind diagonalization: an operator is diagonalizable exactly when its matrix is similar to a diagonal matrix, and eigenvalue algorithms in numerical linear algebra (QR algorithm, Jacobi eigenvalue method) work by iteratively applying similarity transformations to drive a matrix toward a simpler (triangular or diagonal) similar form while provably preserving eigenvalues at every step. In differential equations and dynamical systems, similarity transformations diagonalize or block-diagonalize the coefficient matrix of a linear system x˙=Ax\dot{x} = Ax, decoupling the system into independent scalar equations solvable in closed form — the qualitative long-term behavior (stability, oscillation) is read off from eigenvalues, which similarity guarantees are basis-independent. In quantum mechanics and physics, changing between position and momentum representations, or diagonalizing a Hamiltonian to find energy eigenstates, are similarity (or unitary conjugation, a refinement of similarity) changes of basis; energy levels are physical quantities and must be basis-independent, which is exactly why they correspond to eigenvalues, invariant under similarity. In computer graphics and robotics, coordinate frames attached to moving bodies are related by change-of-basis matrices, and the same rigid transformation expressed in different frames is a similarity transformation of the transformation matrix. In statistics, principal component analysis diagonalizes a covariance matrix via an orthogonal similarity transformation, exploiting the fact that a symmetric matrix's diagonalizing basis reveals uncorrelated directions of variance while total variance (the trace) remains invariant under the change of coordinates. In cryptography and coding theory, invariant polynomial and rank computations that must remain robust to a change of internal representation (e.g. of a linear feedback shift register's state matrix) rely on similarity invariance of characteristic polynomials to guarantee cycle-length and period properties are representation-independent.

Ask the tutor: How does the Jordan canonical form complete the classification of matrices up to similarity when the characteristic polynomial alone is not enough?

DefinitionSimilar Matrices

Let AA and BB be n×nn \times n matrices over a field F\mathbb{F}. We say BB is similar to AA, and write A∼BA \sim B, if there exists an invertible n×nn \times n matrix PP over F\mathbb{F} such that

B=P−1AP.B = P^{-1} A P.

Equivalently, AA and BB are similar if there is an invertible PP with PB=APPB = AP, i.e. AP=PBAP = PB.

Intuition

Think of a linear operator T:V→VT : V \to V on a finite-dimensional vector space as a fixed geometric action — a rotation, a shear, a projection — that exists independently of any coordinate system. To compute with TT, we choose a basis B\mathcal{B} of VV and represent TT by a matrix [T]B[T]_{\mathcal{B}}: the columns of this matrix record where each basis vector of B\mathcal{B} is sent, expressed in coordinates relative to B\mathcal{B} itself. If we instead choose a different basis C\mathcal{C}, we obtain a possibly very different-looking matrix [T]C[T]_{\mathcal{C}}. Both matrices describe the same operator TT; they are two photographs of the same object taken from different angles. The change-of-basis matrix PP (whose columns are the C\mathcal{C}-coordinates of the B\mathcal{B}-basis vectors, or vice versa depending on convention) is the dictionary translating between the two coordinate systems, and the relation between the two matrices is exactly [T]C=P−1[T]BP[T]_{\mathcal{C}} = P^{-1} [T]_{\mathcal{B}} P. A good mental picture: imagine an ellipse-shaped trampoline being stretched by a linear map into another ellipse. In the standard basis, the matrix of this stretch might have off-diagonal entries mixing xx and yy. But if we choose a basis along the ellipse's own axes, the same stretch becomes a simple diagonal scaling. Nothing about the physical stretching changed — only our descriptive language did.

Figure
Same operator, two bases: a shear looks different but acts the same
Standard basis e₁, e₂ unit square image (sheared) A = [[1,1],[0,1]] (shear matrix) Different basis f₁, f₂ same square, new axes image looks simpler B = P⁻¹AP, still trace 2

Central results

TheoremSimilarity Equals Same Operator, Different Basis

Let VV be a finite-dimensional vector space over a field F\mathbb{F} with dim⁡V=n\dim V = n, and let T:V→VT : V \to V be a linear operator. Let B=(v1,…,vn)\mathcal{B} = (v_1, \dots, v_n) and C=(w1,…,wn)\mathcal{C} = (w_1, \dots, w_n) be two ordered bases of VV, and let PP be the change-of-basis matrix satisfying

[x]B=P [x]Cfor all x∈V,[x]_{\mathcal{B}} = P\,[x]_{\mathcal{C}} \quad \text{for all } x \in V,

so that the jj-th column of PP is [wj]B[w_j]_{\mathcal{B}}. Then PP is invertible and

[T]C=P−1[T]BP.[T]_{\mathcal{C}} = P^{-1} [T]_{\mathcal{B}} P.

Conversely, if AA and BB are similar n×nn\times n matrices over F\mathbb{F}, say B=P−1APB = P^{-1}AP, then there exist a vector space VV with dim⁡V=n\dim V = n, a linear operator T:V→VT:V\to V, and ordered bases B,C\mathcal{B}, \mathcal{C} of VV, such that A=[T]BA = [T]_{\mathcal{B}} and B=[T]CB = [T]_{\mathcal{C}}. Moreover, similarity of matrices, as defined by B=P−1APB = P^{-1}AP for some invertible PP, is an equivalence relation on the set of n×nn \times n matrices over F\mathbb{F}.

Proof

We prove the theorem in four parts: (1) forward direction (same operator gives similar matrices), (2) PP is invertible, (3) converse (similar matrices come from the same operator), (4) similarity is an equivalence relation.

Part 1: Forward direction. Fix x∈Vx \in V. By definition of the matrix of a linear operator relative to a basis, for any ordered basis D\mathcal{D} of VV we have

[T(x)]D=[T]D[x]D.[T(x)]_{\mathcal{D}} = [T]_{\mathcal{D}} [x]_{\mathcal{D}}.

This is the fundamental identity connecting operators, their matrix representations, and coordinate vectors (established when matrix representations of linear maps were introduced); we use it as a known fact, not as something to be reproven. We are given that PP satisfies [x]B=P[x]C[x]_{\mathcal{B}} = P [x]_{\mathcal{C}} for every x∈Vx \in V. Apply this identity to the vector T(x)T(x) in place of xx:

[T(x)]B=P [T(x)]C.[T(x)]_{\mathcal{B}} = P\,[T(x)]_{\mathcal{C}}.

Now compute [T(x)]B[T(x)]_{\mathcal{B}} two ways. On one hand, directly,

[T(x)]B=[T]B [x]B=[T]BP [x]C.[T(x)]_{\mathcal{B}} = [T]_{\mathcal{B}}\,[x]_{\mathcal{B}} = [T]_{\mathcal{B}} P\, [x]_{\mathcal{C}}.

On the other hand, using [T(x)]B=P[T(x)]C[T(x)]_{\mathcal{B}} = P [T(x)]_\mathcal{C} and [T(x)]C=[T]C[x]C[T(x)]_\mathcal{C} = [T]_\mathcal{C}[x]_\mathcal{C},

[T(x)]B=P [T]C [x]C.[T(x)]_{\mathcal{B}} = P\, [T]_{\mathcal{C}}\, [x]_{\mathcal{C}}.

Equating the two expressions,

[T]BP [x]C=P [T]C [x]Cfor every x∈V.[T]_{\mathcal{B}} P\, [x]_{\mathcal{C}} = P\, [T]_{\mathcal{C}}\, [x]_{\mathcal{C}} \qquad \text{for every } x \in V.

Since C\mathcal{C} is a basis, as xx ranges over VV, the coordinate vector [x]C[x]_{\mathcal{C}} ranges over all of Fn\mathbb{F}^n. Two matrices that produce equal outputs on every vector in Fn\mathbb{F}^n must be equal (apply both sides to each standard basis vector eie_i of Fn\mathbb{F}^n to read off column ii of each matrix). Hence

[T]BP=P [T]Cas matrices.[T]_{\mathcal{B}} P = P\, [T]_{\mathcal{C}} \quad \text{as matrices.}

Part 2: PP is invertible. Define QQ to be the matrix whose jj-th column is [vj]C[v_j]_{\mathcal{C}}, i.e. QQ is the change-of-basis matrix satisfying [x]C=Q[x]B[x]_{\mathcal{C}} = Q[x]_{\mathcal{B}} for all x∈Vx \in V (this is the analogous matrix built from expressing B\mathcal{B}-vectors in C\mathcal{C}-coordinates). Then for all xx,

[x]B=P[x]C=PQ[x]B.[x]_{\mathcal{B}} = P[x]_{\mathcal{C}} = P Q [x]_{\mathcal{B}}.

Taking x=vix = v_i for each ii, [vi]B=ei[v_i]_{\mathcal{B}} = e_i (the ii-th standard basis vector), so PQei=eiPQ e_i = e_i for every ii, which forces PQ=InPQ = I_n. Symmetrically, QP=InQP = I_n. Hence Q=P−1Q = P^{-1} and PP is invertible. Combining with Part 1, multiply [T]BP=P[T]C[T]_{\mathcal{B}} P = P [T]_{\mathcal{C}} on the left by P−1P^{-1}:

P−1[T]BP=[T]C.P^{-1}[T]_{\mathcal{B}} P = [T]_{\mathcal{C}}.

This proves the forward direction.

Part 3: Converse. Suppose A,BA, B are n×nn \times n matrices over F\mathbb{F} with B=P−1APB = P^{-1} A P for some invertible PP. Let V=FnV = \mathbb{F}^n and let B=(e1,…,en)\mathcal{B} = (e_1, \dots, e_n) be the standard ordered basis. Define T:V→VT : V \to V by T(x)=AxT(x) = Ax (matrix-vector multiplication), a linear map since matrix multiplication is linear in the vector argument. Then [T]B=A[T]_{\mathcal{B}} = A, because the jj-th column of [T]B[T]_{\mathcal{B}} is [T(ej)]B=[Aej]B=Aej[T(e_j)]_{\mathcal{B}} = [Ae_j]_{\mathcal{B}} = Ae_j itself (coordinates relative to the standard basis are the entries of the vector), and AejAe_j is exactly the jj-th column of AA. Let w1,…,wnw_1, \dots, w_n be the columns of PP; since PP is invertible, these columns form a basis C\mathcal{C} of VV (an n×nn\times n matrix is invertible iff its columns are linearly independent, hence a basis of Fn\mathbb{F}^n). The matrix whose jj-th column is [wj]B=wj[w_j]_{\mathcal{B}} = w_j is precisely PP, so PP is the change-of-basis matrix from C\mathcal{C}-coordinates to B\mathcal{B}-coordinates, exactly as in the hypothesis of Part 1. By Part 1 (already proven, applied to this concrete T,B,CT, \mathcal{B}, \mathcal{C}),

[T]C=P−1[T]BP=P−1AP=B.[T]_{\mathcal{C}} = P^{-1}[T]_{\mathcal{B}} P = P^{-1} A P = B.

Thus A=[T]BA = [T]_{\mathcal{B}} and B=[T]CB = [T]_{\mathcal{C}} for this operator TT and these two bases, as required.

Part 4: Similarity is an equivalence relation. We verify the three defining properties directly from the algebraic definition B=P−1APB = P^{-1}AP. Reflexivity. For any n×nn\times n matrix AA, take P=InP = I_n, which is invertible with In−1=InI_n^{-1} = I_n. Then In−1AIn=AI_n^{-1} A I_n = A, so A∼AA \sim A. Symmetry. Suppose A∼BA \sim B, so B=P−1APB = P^{-1} A P for some invertible PP. Then multiplying on the left by PP and on the right by P−1P^{-1},

PBP−1=A,i.e.A=(P−1)−1B(P−1).P B P^{-1} = A, \quad \text{i.e.} \quad A = (P^{-1})^{-1} B (P^{-1}).

Since PP is invertible, so is P−1P^{-1} (with inverse PP), so setting Q=P−1Q = P^{-1} we have A=Q−1BQA = Q^{-1} B Q, i.e. B∼AB \sim A. Transitivity. Suppose A∼BA \sim B and B∼CB \sim C, so B=P−1APB = P^{-1}AP and C=Q−1BQC = Q^{-1}BQ for invertible P,QP, Q. Substitute:

C=Q−1(P−1AP)Q=(Q−1P−1)A(PQ)=(PQ)−1A(PQ),C = Q^{-1}(P^{-1}AP)Q = (Q^{-1}P^{-1})A(PQ) = (PQ)^{-1} A (PQ),

using the fact that Q−1P−1=(PQ)−1Q^{-1}P^{-1} = (PQ)^{-1} (the standard identity for inverses of a product, verified since (PQ)(Q−1P−1)=P(QQ−1)P−1=PP−1=I(PQ)(Q^{-1}P^{-1}) = P(QQ^{-1})P^{-1} = PP^{-1} = I and similarly on the other side). Since P,QP, Q are invertible, so is their product PQPQ (product of invertible matrices is invertible, with inverse Q−1P−1Q^{-1}P^{-1}). Hence C=(PQ)−1A(PQ)C = (PQ)^{-1} A (PQ) exhibits A∼CA \sim C. All three properties hold, so ∼\sim is an equivalence relation on the set of n×nn\times n matrices over F\mathbb{F}. ■\blacksquare

∎
CorollarySimilarity Invariants

If A∼BA \sim B (i.e. B=P−1APB = P^{-1}AP for invertible PP), then: 1. det⁡(B)=det⁡(A)\det(B) = \det(A). 2. tr⁡(B)=tr⁡(A)\operatorname{tr}(B) = \operatorname{tr}(A). 3. rank⁡(B)=rank⁡(A)\operatorname{rank}(B) = \operatorname{rank}(A). 4. AA is invertible if and only if BB is invertible. 5. AA and BB have the same characteristic polynomial, hence the same eigenvalues with the same algebraic multiplicities.

Proof

Let B=P−1APB = P^{-1}AP with PP invertible. (1) Determinant. By multiplicativity of the determinant, det⁡(B)=det⁡(P−1)det⁡(A)det⁡(P)\det(B) = \det(P^{-1})\det(A)\det(P). Since det⁡(P−1)=1/det⁡(P)\det(P^{-1}) = 1/\det(P) (as det⁡(P−1)det⁡(P)=det⁡(P−1P)=det⁡(I)=1\det(P^{-1})\det(P) = \det(P^{-1}P) = \det(I) = 1), we get det⁡(B)=1det⁡(P)det⁡(A)det⁡(P)=det⁡(A)\det(B) = \frac{1}{\det(P)}\det(A)\det(P) = \det(A), using commutativity of scalar multiplication in F\mathbb{F}. (2) Trace. Recall the identity tr⁡(XY)=tr⁡(YX)\operatorname{tr}(XY) = \operatorname{tr}(YX) for any conformable matrices X,YX, Y (immediate from the definition of trace as the sum of diagonal entries and expanding both products entrywise: tr⁡(XY)=∑i∑jXijYji=∑j∑iYjiXij=tr⁡(YX)\operatorname{tr}(XY) = \sum_i \sum_j X_{ij}Y_{ji} = \sum_j \sum_i Y_{ji}X_{ij} = \operatorname{tr}(YX)). Apply this with X=P−1AX = P^{-1}A and Y=PY = P:

tr⁡(B)=tr⁡(P−1AP)=tr⁡((P−1A)P)=tr⁡(P(P−1A))=tr⁡(A).\operatorname{tr}(B) = \operatorname{tr}(P^{-1}AP) = \operatorname{tr}\big((P^{-1}A)P\big) = \operatorname{tr}\big(P(P^{-1}A)\big) = \operatorname{tr}(A).

(3) Rank. Multiplication by an invertible matrix does not change rank: if MM is invertible, rank⁡(MX)=rank⁡(X)=rank⁡(XM)\operatorname{rank}(MX) = \operatorname{rank}(X) = \operatorname{rank}(XM) for any conformable XX, because MM (and M−1M^{-1}) implement invertible linear maps that carry a basis of the column (resp. row) space to a basis of the same size. Applying this twice, rank⁡(B)=rank⁡(P−1AP)=rank⁡(AP)=rank⁡(A)\operatorname{rank}(B) = \operatorname{rank}(P^{-1}AP) = \operatorname{rank}(AP) = \operatorname{rank}(A). (4) Invertibility. AA is invertible iff rank⁡(A)=n\operatorname{rank}(A) = n iff (by part 3) rank⁡(B)=n\operatorname{rank}(B) = n iff BB is invertible. (5) Characteristic polynomial. For an indeterminate λ\lambda,

det⁡(B−λI)=det⁡(P−1AP−λP−1IP)=det⁡(P−1(A−λI)P)=det⁡(A−λI),\det(B - \lambda I) = \det(P^{-1}AP - \lambda P^{-1}IP) = \det\big(P^{-1}(A - \lambda I)P\big) = \det(A - \lambda I),

where the last equality is part (1) applied to the similar matrices A−λIA - \lambda I and B−λIB - \lambda I (which are similar via the same PP, since P−1(A−λI)P=P−1AP−λI=B−λIP^{-1}(A-\lambda I)P = P^{-1}AP - \lambda I = B - \lambda I). Since the characteristic polynomials agree as polynomials in λ\lambda, their roots — the eigenvalues — agree, with the same multiplicities as roots of the same polynomial. ■\blacksquare

∎

Worked examples

Example 1: Verifying similarity directly and confirming the invariants. Let

A=(2103),P=(1213).A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}, \qquad P = \begin{pmatrix} 1 & 2 \\ 1 & 3 \end{pmatrix}.

First check PP is invertible: det⁡P=1⋅3−2⋅1=1≠0\det P = 1\cdot 3 - 2 \cdot 1 = 1 \neq 0. Its inverse (using the 2×22\times 2 formula (abcd)−1=1ad−bc(d−b−ca)\begin{pmatrix}a&b\\c&d\end{pmatrix}^{-1} = \frac{1}{ad-bc}\begin{pmatrix}d & -b \\ -c & a\end{pmatrix}) is

P−1=(3−2−11).P^{-1} = \begin{pmatrix} 3 & -2 \\ -1 & 1 \end{pmatrix}.

Compute B=P−1APB = P^{-1}AP in two steps. First APAP:

AP=(2103)(1213)=(2⋅1+1⋅12⋅2+1⋅30⋅1+3⋅10⋅2+3⋅3)=(3739).AP = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}\begin{pmatrix}1 & 2 \\ 1 & 3\end{pmatrix} = \begin{pmatrix} 2\cdot1+1\cdot1 & 2\cdot2+1\cdot3 \\ 0\cdot1+3\cdot1 & 0\cdot2+3\cdot3 \end{pmatrix} = \begin{pmatrix} 3 & 7 \\ 3 & 9 \end{pmatrix}.

Then P−1(AP)P^{-1}(AP):

B=(3−2−11)(3739)=(3⋅3+(−2)⋅33⋅7+(−2)⋅9(−1)⋅3+1⋅3(−1)⋅7+1⋅9)=(3302).B = \begin{pmatrix} 3 & -2 \\ -1 & 1 \end{pmatrix}\begin{pmatrix} 3 & 7 \\ 3 & 9 \end{pmatrix} = \begin{pmatrix} 3\cdot3+(-2)\cdot3 & 3\cdot7+(-2)\cdot9 \\ (-1)\cdot3+1\cdot3 & (-1)\cdot7+1\cdot9 \end{pmatrix} = \begin{pmatrix} 3 & 3 \\ 0 & 2 \end{pmatrix}.

So A∼BA \sim B with B=(3302)B = \begin{pmatrix}3&3\\0&2\end{pmatrix}. Note AA and BB do not share a single common entry, yet:

  • tr⁡(A)=2+3=5\operatorname{tr}(A) = 2+3 = 5 and tr⁡(B)=3+2=5\operatorname{tr}(B) = 3+2 = 5. Match.
  • det⁡(A)=2⋅3−1⋅0=6\det(A) = 2\cdot3 - 1\cdot0 = 6 and det⁡(B)=3⋅2−3⋅0=6\det(B) = 3\cdot2 - 3\cdot0 = 6. Match.
  • Characteristic polynomial of AA: det⁡(A−λI)=(2−λ)(3−λ)=λ2−5λ+6\det(A - \lambda I) = (2-\lambda)(3-\lambda) = \lambda^2 - 5\lambda + 6.

Characteristic polynomial of BB: det⁡(B−λI)=(3−λ)(2−λ)−3⋅0=λ2−5λ+6\det(B - \lambda I) = (3-\lambda)(2-\lambda) - 3\cdot 0 = \lambda^2 - 5\lambda + 6. Match, as guaranteed by the corollary.

  • Both are upper triangular with eigenvalues {2,3}\{2, 3\} read off the diagonal — consistent, since similar matrices must have identical eigenvalue multisets, and here the eigenvalues literally appear as diagonal entries in each triangular representative.

Example 2: A basis-change interpretation with an explicit operator on R3\mathbb{R}^3. Let T:R3→R3T : \mathbb{R}^3 \to \mathbb{R}^3 be the linear operator whose matrix relative to the standard basis E=(e1,e2,e3)\mathcal{E} = (e_1, e_2, e_3) is

A=[T]E=(110021003).A = [T]_{\mathcal{E}} = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & 3 \end{pmatrix}.

Consider the new ordered basis C=(w1,w2,w3)\mathcal{C} = (w_1, w_2, w_3) with

w1=(1,0,0),w2=(1,1,0),w3=(1,1,1).w_1 = (1,0,0), \quad w_2 = (1,1,0), \quad w_3 = (1,1,1).

These are linearly independent (the matrix with these columns is lower triangular with nonzero diagonal, hence invertible), so C\mathcal{C} is indeed a basis. Let PP be the matrix whose columns are the E\mathcal{E}-coordinates of w1,w2,w3w_1, w_2, w_3 — since E\mathcal{E} is the standard basis, coordinates equal components, so

P=(111011001).P = \begin{pmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix}.

By the theorem, [T]C=P−1AP[T]_{\mathcal{C}} = P^{-1} A P. Compute P−1P^{-1} by solving Px=eiP x = e_i for each ii, or by the standard upper-triangular inverse pattern:

P−1=(1−1001−1001).P^{-1} = \begin{pmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \end{pmatrix}.

(Check: PP−1PP^{-1}, first row: (1)(1)+(1)(0)+(1)(0)=1(1)(1)+(1)(0)+(1)(0) = 1; (1)(−1)+(1)(1)+(1)(0)=0(1)(-1)+(1)(1)+(1)(0) = 0; (1)(0)+(1)(−1)+(1)(1)=0(1)(0)+(1)(-1)+(1)(1) = 0 — matches row 1 of II. The remaining rows check similarly.) Now compute APAP:

AP=(110021003)(111011001)=(11⋅1+1⋅11+1+002⋅1+1⋅0    →  22+1003).AP = \begin{pmatrix} 1&1&0\\0&2&1\\0&0&3 \end{pmatrix}\begin{pmatrix}1&1&1\\0&1&1\\0&0&1\end{pmatrix} = \begin{pmatrix} 1 & 1\cdot1+1\cdot1 & 1+1+0 \\ 0 & 2\cdot1+1\cdot0\;\; \to\; 2 & 2+1 \\ 0 & 0 & 3 \end{pmatrix}.

Let us redo this multiplication carefully entry by entry. Row 1 of AA is (1,1,0)(1,1,0):

  • column 1 of PP is (1,0,0)T(1,0,0)^T: dot product =1= 1.
  • column 2 of PP is (1,1,0)T(1,1,0)^T: dot product =1⋅1+1⋅1+0⋅0=2= 1\cdot1 + 1\cdot1 + 0\cdot0 = 2.
  • column 3 of PP is (1,1,1)T(1,1,1)^T: dot product =1⋅1+1⋅1+0⋅1=2= 1\cdot1+1\cdot1+0\cdot1 = 2.

Row 2 of AA is (0,2,1)(0,2,1):

  • vs column 1 (1,0,0)(1,0,0): 00.
  • vs column 2 (1,1,0)(1,1,0): 0⋅1+2⋅1+1⋅0=20\cdot1+2\cdot1+1\cdot0 = 2.
  • vs column 3 (1,1,1)(1,1,1): 0+2+1=30+2+1 = 3.

Row 3 of AA is (0,0,3)(0,0,3):

  • vs column 1: 00.
  • vs column 2: 00.
  • vs column 3: 33.

So

AP=(122023003).AP = \begin{pmatrix} 1 & 2 & 2 \\ 0 & 2 & 3 \\ 0 & 0 & 3 \end{pmatrix}.

Now compute B=P−1(AP)B = P^{-1}(AP), with P−1=(1−1001−1001)P^{-1} = \begin{pmatrix}1&-1&0\\0&1&-1\\0&0&1\end{pmatrix}. Row 1 of P−1P^{-1} is (1,−1,0)(1,-1,0), dotted with columns of APAP:

  • column 1 (1,0,0)(1,0,0): 11.
  • column 2 (2,2,0)(2,2,0): 1⋅2+(−1)⋅2=01\cdot2 + (-1)\cdot2 = 0.
  • column 3 (2,3,3)(2,3,3): 1⋅2+(−1)⋅3=−11\cdot2+(-1)\cdot3 = -1.

Row 2 of P−1P^{-1} is (0,1,−1)(0,1,-1):

  • column 1: 00.
  • column 2: 1⋅2+(−1)⋅0=21\cdot2 + (-1)\cdot0 = 2.
  • column 3: 1⋅3+(−1)⋅3=01\cdot3 + (-1)\cdot3 = 0.

Row 3 of P−1P^{-1} is (0,0,1)(0,0,1):

  • column 1: 00.
  • column 2: 00.
  • column 3: 33.

So

B=[T]C=(10−1020003).B = [T]_{\mathcal{C}} = \begin{pmatrix} 1 & 0 & -1 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{pmatrix}.

Check the invariants: tr⁡(A)=1+2+3=6=tr⁡(B)=1+2+3\operatorname{tr}(A) = 1+2+3 = 6 = \operatorname{tr}(B) = 1+2+3. Both matrices are triangular, so det⁡(A)=1⋅2⋅3=6=det⁡(B)\det(A) = 1\cdot2\cdot3 = 6 = \det(B), and both display the same eigenvalues 1,2,31, 2, 3 on their diagonals — exactly as guaranteed, since AA and BB represent the identical operator TT, merely described in the bases E\mathcal{E} and C\mathcal{C} respectively.

CounterexampleWhy PP must be invertible

Drop the hypothesis that PP is invertible and ask whether B=P−1APB = P^{-1}AP-type formulas (or more generally B=QAPB = QAP or PAQPAQ for arbitrary, possibly singular, matrices) still preserve the invariants of the corollary. They do not. Let

A=(1002),Q=(1000),A = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix}, \qquad Q = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix},

so QQ is singular (det⁡Q=0\det Q = 0). Define B=QAQB = Q A Q (using QQ in place of both P−1P^{-1} and PP, since QQ has no inverse to speak of, we simply conjugate formally with the same singular matrix on both sides):

QA=(1000)(1002)=(1000),B=(QA)Q=(1000)(1000)=(1000).QA = \begin{pmatrix}1&0\\0&0\end{pmatrix}\begin{pmatrix}1&0\\0&2\end{pmatrix} = \begin{pmatrix}1&0\\0&0\end{pmatrix}, \qquad B = (QA)Q = \begin{pmatrix}1&0\\0&0\end{pmatrix}\begin{pmatrix}1&0\\0&0\end{pmatrix} = \begin{pmatrix}1&0\\0&0\end{pmatrix}.

Now compare invariants:

  • tr⁡(A)=1+2=3\operatorname{tr}(A) = 1+2 = 3, but tr⁡(B)=1+0=1\operatorname{tr}(B) = 1+0 = 1. Trace is not preserved.
  • det⁡(A)=2\det(A) = 2, but det⁡(B)=0\det(B) = 0. Determinant is not preserved; in particular AA is invertible while BB is not, so invertibility is not preserved either.
  • Eigenvalues of AA are {1,2}\{1,2\}; eigenvalues of BB are {1,0}\{1,0\} (since BB is diagonal). Eigenvalues change.

The entire proof of the equivalence-relation property and of the invariants relied on cancellation identities such as P−1P=IP^{-1}P = I and det⁡(P−1)=1/det⁡(P)\det(P^{-1}) = 1/\det(P), both of which require PP invertible. Without invertibility, the map A↦QAQA \mapsto QAQ is not even a well-defined "change of representation" of a fixed operator — it genuinely distorts the operator's algebraic invariants, because QQ collapses part of the space (it has a nontrivial kernel), so no honest change of basis corresponds to it. This shows invertibility of PP is not a technical nicety but essential to every conclusion of the theorem.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail / must be checked
B=P−1APB = P^{-1}AP, PP invertibletrace, det, rank, invertibility, char. poly., eigenvalues (with multiplicity) all matchindividual entries of A,BA, B need not match at all
A,BA, B have the same eigenvalues—this does not imply A∼BA \sim B in general (see below)
A∼BA \sim B over C\mathbb{C} vs. over R\mathbb{R}if PP can be chosen with real entries, similarity holds over R\mathbb{R}similarity depends on the field: A,BA, B real might be similar over C\mathbb{C} but not over R\mathbb{R}
Similarity vs. matrix equalitysimilarity is much weaker than equalitystudents sometimes wrongly assume A∼B⇒A=BA\sim B \Rightarrow A = B; similarity is an equivalence class, not a single matrix
Non-invertible PPconjugation-like formulas can break every invariantsee the counterexample above

A frequently made error: concluding A∼BA \sim B merely because AA and BB have the same eigenvalues (even with multiplicity) and the same characteristic polynomial. This is necessary but not sufficient. For instance,

A=(2002),B=(2102)A = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}, \qquad B = \begin{pmatrix} 2 & 1 \\ 0 & 2 \end{pmatrix}

both have characteristic polynomial (λ−2)2(\lambda-2)^2 and the single eigenvalue 22 with algebraic multiplicity 22. But A=2IA = 2I is similar only to itself (since P−1(2I)P=2P−1P=2IP^{-1}(2I)P = 2P^{-1}P = 2I for any invertible PP), while B≠2IB \neq 2I, so A≁BA \not\sim B. The characteristic polynomial is an invariant of similarity, not a complete classifier of it; distinguishing matrices with equal characteristic polynomials up to similarity requires finer tools (such as the Jordan form), which lie beyond the present scope.

The mathematician behind it

Origins · 1 minArthur Cayley and how this was discovered
AC
Arthur Cayley
1821–1895 · British algebraist and founder of matrix theory

Arthur Cayley, working in mid-19th-century England alongside contemporaries such as James Joseph Sylvester, developed the algebra of matrices as objects in their own right, distinct from mere arrays used to solve linear systems. Cayley's 1858 memoir A Memoir on the Theory of Matrices introduced matrix addition, multiplication, and inversion as operations satisfying their own algebraic laws, and he proved foundational facts (including special cases of what is now the Cayley–Hamilton theorem) connecting a matrix to its characteristic polynomial. The notion of similarity — recognizing that different matrices could represent the same underlying linear transformation under a change of coordinates — crystallized out of this broader 19th-century program to treat linear substitutions of variables as algebraic objects with their own invariant theory, a project pursued by Cayley, Sylvester, and later Ferdinand Georg Frobenius, who gave a systematic treatment of canonical forms under similarity.

History
- 1858 — Cayley's memoir establishes matrix algebra, including inversion and multiplication, as a formal system.
- 1868 — Camille Jordan develops canonical forms for linear substitutions, precursors to the Jordan normal form governing similarity classes.
- 1878 — Frobenius systematizes the theory of bilinear and quadratic forms under linear substitutions, sharpening invariant-theoretic language around similarity.
- 1898 — Kronecker and Weierstrass-influenced work refines invariant factors and elementary divisors, completing the classification of matrices up to similarity over general fields.
- 1930s — Similarity and its invariants become standard material in linear algebra as the subject is axiomatized for vector spaces over general fields.
What exactly does it mean for two matrices to be similar?

Two n×nn \times n matrices AA and BB over a field F\mathbb{F} are similar if there is an invertible matrix PP with B=P−1APB = P^{-1}AP. Concretely, this means AA and BB describe the same underlying linear operator on some nn-dimensional vector space, just expressed relative to two different ordered bases. The matrix PP encodes the change of basis linking the two coordinate systems. Similarity is strictly weaker than matrix equality: similar matrices can look completely different entrywise, yet share every property that depends only on the operator itself rather than on the chosen coordinates, such as trace, determinant, rank, and eigenvalues.

Is similarity the same thing as row equivalence?

No, these are different and much weaker or stronger in different ways. Row equivalence (via elementary row operations, or equivalently B=EAB = EA for invertible EE) does not require any relationship on the right side of AA, and it does not preserve eigenvalues, determinant, or trace in general — it corresponds to systems of equations having the same solution set, not to the same linear operator. Similarity requires a two-sided conjugation P−1APP^{-1}AP using the same PP on both sides, which is exactly what is needed to reinterpret coordinates consistently for both inputs and outputs of an operator. Similar matrices are always square and share spectral invariants; row-equivalent matrices need not.

Do similar matrices always have the same eigenvectors?

No — eigenvectors are coordinate-dependent objects, unlike eigenvalues. If B=P−1APB = P^{-1}AP and vv is an eigenvector of AA with eigenvalue λ\lambda (so Av=λvAv = \lambda v), then P−1vP^{-1}v is an eigenvector of BB with the same eigenvalue λ\lambda, since B(P−1v)=P−1APP−1v=P−1Av=λP−1vB(P^{-1}v) = P^{-1}AP P^{-1} v = P^{-1}Av = \lambda P^{-1}v. So eigenvectors transform via P−1P^{-1}, while eigenvalues themselves stay fixed. This is exactly consistent with the operator picture: the eigenvector's coordinate representation changes when the basis changes, but the underlying eigenvector (as an abstract vector in VV) and its eigenvalue do not.

Can two matrices with the same trace and determinant fail to be similar?

Yes, definitely, once the matrix size is at least 2×22\times 2 with repeated eigenvalues. For example A=2I2A = 2I_2 and B=(2102)B = \begin{pmatrix}2&1\\0&2\end{pmatrix} both have trace 44, determinant 44, and characteristic polynomial (λ−2)2(\lambda - 2)^2, but they are not similar: since AA is a scalar matrix, P−1AP=AP^{-1}AP = A for every invertible PP, so AA's only similarity partner is itself, and B≠AB \ne A. This shows trace, determinant, and even the full characteristic polynomial are necessary but not sufficient invariants for similarity; a complete invariant requires finer data such as the Jordan canonical form.

Does similarity depend on which field the entries come from?

Yes. Similarity requires the conjugating matrix PP, and all its entries, to lie in the same field as AA and BB. It is possible for two real matrices to be similar when we allow PP to have complex entries, yet fail to be similar via any real invertible PP. A standard source of this phenomenon is a real matrix with non-real complex eigenvalues, which can be similar over C\mathbb{C} to a diagonal matrix of its complex eigenvalues, but over R\mathbb{R} it is only similar to a real block form (a rotation-scaling block), never to an actual diagonal matrix.

How is similarity related to diagonalization?

A matrix AA is called diagonalizable precisely when it is similar to some diagonal matrix DD, i.e. D=P−1APD = P^{-1}AP for an invertible PP whose columns turn out to be eigenvectors of AA. Diagonalization is thus a special, especially convenient case of the general similarity relationship: it asks not merely for some simpler-looking similar matrix, but specifically for a diagonal one. Not every matrix is diagonalizable (the earlier example B=(2102)B=\begin{pmatrix}2&1\\0&2\end{pmatrix} is a classic non-diagonalizable matrix), which is why the broader theory of similarity, and canonical forms such as the Jordan form, is needed to handle all cases.

Why should I care about similarity if I only care about solving Ax=bAx=b?

Solving individual linear systems is governed by row-reduction and invertibility, not similarity — those are separate concerns. Similarity matters whenever you care about a linear operator's own intrinsic behavior across repeated application, such as computing AkA^k for large kk, solving linear recurrences or differential equations x˙=Ax\dot x = Ax, or understanding long-term dynamics, stability, or oscillation. In all of these settings, finding a similar matrix in a simpler form (diagonal, or close to diagonal) makes the computation vastly easier while guaranteeing, via the invariants proved here, that the eigenvalues governing growth rates and oscillation frequencies are exactly the same as those of the original matrix.

Before this

Where this leads