Two Relations, Two Coordinate Changes
Similarity and congruence both compare square matrices using an invertible change of coordinates, but they answer different questions. Similarity compares matrices of the same linear operator in different bases. Congruence compares matrices of the same bilinear form in different bases. The formulas differ because an operator takes one vector as input, whereas a bilinear form takes two.
Throughout, matrices and changes of coordinates are over \(\mathbb{R}\), unless eigenvalues are being considered; for those, we may regard a real matrix as acting over \(\mathbb{C}\). Let \(\mathbf{P}\) be an invertible \(n\times n\) matrix. Two \(n\times n\) matrices \(\mathbf{A}\) and \(\mathbf{B}\) are similar if \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). They are congruent if \(\mathbf{B}=\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\). The same matrix \(\mathbf{P}\) need not give the same result under these two formulas.
To see why, let \(T:\mathbb{R}^n\to\mathbb{R}^n\) be linear. Suppose the columns of \(\mathbf{P}\) are the new basis vectors written in old coordinates. If \(\mathbf{y}\) is the coordinate vector in the new basis, then \(\mathbf{x}=\mathbf{P}\mathbf{y}\) is the coordinate vector in the old basis. If \(\mathbf{A}\) is the matrix of \(T\) in the old basis, the old coordinates of the output are \(\mathbf{A}\mathbf{P}\mathbf{y}\). Converting those output coordinates to the new basis multiplies by \(\mathbf{P}^{-1}\). Thus the new matrix is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).
A bilinear form takes two inputs. If its matrix in old coordinates is \(\mathbf{A}\), its value on vectors with old coordinate columns \(\mathbf{x}\) and \(\mathbf{z}\) is \(\mathbf{x}^{\top}\mathbf{A}\mathbf{z}\). Substitute \(\mathbf{x}=\mathbf{P}\mathbf{y}\) and \(\mathbf{z}=\mathbf{P}\mathbf{w}\). The result is \(\mathbf{y}^{\top}(\mathbf{P}^{\top}\mathbf{A}\mathbf{P})\mathbf{w}\), so the new matrix of the form is obtained by congruence.
Proof. For the operator, write \(\mathbf{x}=\mathbf{P}\mathbf{y}\). The old-coordinate output is \(\mathbf{A}\mathbf{x}=\mathbf{A}\mathbf{P}\mathbf{y}\); a vector with old coordinates \(\mathbf{v}\) has new coordinates \(\mathbf{P}^{-1}\mathbf{v}\). Therefore the new output coordinates are \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{y}\), giving the stated matrix. For the form, its value on old-coordinate columns \(\mathbf{x},\mathbf{z}\) is \(\mathbf{x}^{\top}\mathbf{A}\mathbf{z}\). Substituting \(\mathbf{x}=\mathbf{P}\mathbf{y}\) and \(\mathbf{z}=\mathbf{P}\mathbf{w}\) gives \((\mathbf{P}\mathbf{y})^{\top}\mathbf{A}(\mathbf{P}\mathbf{w})=\mathbf{y}^{\top}\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\mathbf{w}\), which is the form’s matrix in the new coordinates. \(\square\)
Similarity Preserves Eigenvalues
For a square matrix \(\mathbf{A}\), its characteristic polynomial is \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I})\). An eigenvalue is a scalar \(\lambda\) for which \(\mathbf{A}-\lambda\mathbf{I}\) is singular. Similarity preserves the entire characteristic polynomial, not just its roots.
Proof. Since \(\mathbf{I}=\mathbf{P}^{-1}\mathbf{I}\mathbf{P}\), we have \(\mathbf{B}-\lambda\mathbf{I}=\mathbf{P}^{-1}(\mathbf{A}-\lambda\mathbf{I})\mathbf{P}\). Taking determinants and using the product rule for determinants gives \(\det(\mathbf{B}-\lambda\mathbf{I})=\det(\mathbf{P}^{-1})\det(\mathbf{A}-\lambda\mathbf{I})\det(\mathbf{P})\). Because \(\det(\mathbf{P}^{-1})\det(\mathbf{P})=1\), this equals \(p_{\mathbf{A}}(\lambda)\). Thus the characteristic polynomials are equal, so their roots and their multiplicities are equal. \(\square\)
Worked Example: A Similarity Change of Basis
Let \(\mathbf{A}=\begin{bmatrix}1&0\\0&2\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). Find the matrix similar to \(\mathbf{A}\) using this \(\mathbf{P}\), and check its eigenvalues.
The inverse is \(\mathbf{P}^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\), since multiplying it by \(\mathbf{P}\) gives \(\mathbf{I}_2\). First calculate
Then
Check: multiplying \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) in the displayed order gives \(\mathbf{B}\), as required. Also \(p_{\mathbf{B}}(\lambda)=\det\begin{bmatrix}1-\lambda&-1\\0&2-\lambda\end{bmatrix}=(1-\lambda)(2-\lambda)=p_{\mathbf{A}}(\lambda)\). Both matrices have eigenvalues \(1\) and \(2\).
Congruence Changes the Matrix of a Form
For a real symmetric matrix \(\mathbf{A}\), the associated quadratic form is \(q_{\mathbf{A}}(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\). If \(\mathbf{B}=\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\), then \(q_{\mathbf{B}}(\mathbf{y})=q_{\mathbf{A}}(\mathbf{P}\mathbf{y})\): the numerical expression for the form changes because the coordinates change. This does not mean its eigenvalues must stay fixed.
Worked Example: Congruence Changes Eigenvalues
Take \(\mathbf{A}=\mathbf{I}_2\) and \(\mathbf{P}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\). Compute the congruent matrix and compare the eigenvalues.
Here \(\mathbf{P}^{\top}=\mathbf{P}\), so
The eigenvalues of \(\mathbf{A}\) are \(1,1\), while those of \(\mathbf{B}\) are \(4,1\). They differ, even though the matrices are congruent. The forms agree after the coordinate substitution: for \(\mathbf{y}=(y_1,y_2)^{\top}\), \(q_{\mathbf{B}}(\mathbf{y})=4y_1^2+y_2^2=q_{\mathbf{A}}(2y_1,y_2)\). This check confirms that the congruence describes a coordinate change of the form.
For real symmetric forms, congruence is the relation used for classification. The inertia of a real symmetric form is the triple \((r_+,r_-,r_0)\), counting positive, negative, and zero entries, respectively, in a diagonal form obtained by congruence. Sylvester’s law of inertia states that these counts do not depend on the diagonalization: two real symmetric matrices are congruent exactly when their inertias agree. In particular, this classification concerns the signs of the form, not the eigenvalues of its matrix.
Congruence also preserves rank. If \(\mathbf{P}\) is invertible, then the image of the map represented by \(\mathbf{A}\mathbf{P}\) is the image of \(\mathbf{A}\), since \(\mathbf{P}\) maps onto the whole domain. Multiplication on the left by \(\mathbf{P}^{\top}\) maps that image bijectively to another subspace of the same dimension. Thus \(\operatorname{rank}(\mathbf{P}^{\top}\mathbf{A}\mathbf{P})=\operatorname{rank}\mathbf{A}\). For symmetric forms, the zero count in the inertia is therefore also unchanged.
Worked Example: An Indefinite Form Under Congruence
Let \(\mathbf{A}=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\) and \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). Compute \(\mathbf{B}=\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\), then compare the eigenvalues and the signs of the forms.
First, \(\mathbf{A}\mathbf{P}=\begin{bmatrix}1&1\\0&-1\end{bmatrix}\), and \(\mathbf{P}^{\top}=\begin{bmatrix}1&0\\1&1\end{bmatrix}\). Therefore
The original characteristic polynomial is \(p_{\mathbf{A}}(\lambda)=\lambda^2-1\). For the new matrix, \(p_{\mathbf{B}}(\lambda)=\det\begin{bmatrix}1-\lambda&1\\1&-\lambda\end{bmatrix}=\lambda^2-\lambda-1\). These polynomials differ, so the eigenvalues are not preserved. Yet the quadratic forms have the same inertia: \(q_{\mathbf{A}}(x_1,x_2)=x_1^2-x_2^2\), while substituting \((x_1,x_2)=(y_1+y_2,y_2)\) gives \(q_{\mathbf{B}}(y_1,y_2)=y_1^2+2y_1y_2\). The second expression takes positive and negative values: at \((1,0)\) it is \(1\), and at \((1,-1)\) it is \(-1\). Both forms are nonsingular since \(\det\mathbf{A}=-1\) and \(\det\mathbf{B}=-1\), so each has inertia \((1,1,0)\).
Check: direct multiplication gave \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}=\mathbf{B}\), and \(q_{\mathbf{B}}(\mathbf{y})=q_{\mathbf{A}}(\mathbf{P}\mathbf{y})\) follows from the displayed substitution. The changed eigenvalues and unchanged inertia illustrate the different information the two comparisons preserve.
When the Two Relations Coincide—and a Common Error
If \(\mathbf{P}\) is orthogonal, then \(\mathbf{P}^{\top}=\mathbf{P}^{-1}\). In that special case \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), so the congruence is also a similarity and preserves eigenvalues. For a general invertible \(\mathbf{P}\), transpose and inverse are not interchangeable. The formula \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\) is not a similarity merely because it has a matrix on each side of \(\mathbf{A}\).
Common mistake. With \(\mathbf{A}=\mathbf{I}_2\) and \(\mathbf{P}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\), one might claim that \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\) preserves eigenvalues because it is a change of basis for an operator. That claim confuses the two formulas: the congruence gives \(\begin{bmatrix}4&0\\0&1\end{bmatrix}\), whose eigenvalues are \(4,1\). The operator change of basis instead gives \(\mathbf{P}^{-1}\mathbf{I}_2\mathbf{P}=\mathbf{I}_2\), whose eigenvalues remain \(1,1\). The correction is to identify the object first: use similarity for operator matrices and congruence for matrices of bilinear forms.
| Question | Use | What is preserved |
|---|---|---|
| Same linear operator in different bases? | Similarity: \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) | Characteristic polynomial and eigenvalues |
| Same bilinear form in different bases? | Congruence: \(\mathbf{P}^{\top}\mathbf{A}\mathbf{P}\) | For real symmetric forms, inertia and rank |
| Is \(\mathbf{P}\) orthogonal? | Then \(\mathbf{P}^{\top}=\mathbf{P}^{-1}\) | The congruence is also a similarity |
The practical diagnostic is to ask what the matrix represents before deciding which relation to use. A matrix for a linear map changes by similarity when its basis changes. A matrix for a bilinear form changes by congruence when its basis changes. Their shared appearance as “a change involving an invertible matrix” does not make them interchangeable: similarity preserves eigenvalues, while congruence is the natural relation for classifying real symmetric forms by inertia.
Check Your Understanding
For each question, distinguish the matrix relation from the property it preserves.
- State the change-of-basis formula for an operator matrix and for a bilinear-form matrix.
- Why does similarity preserve the characteristic polynomial? Give the determinant identity used in the proof.
- For \(\mathbf{A}=\mathbf{I}_2\) and \(\mathbf{P}=\operatorname{diag}(3,1)\), calculate the congruent matrix and its eigenvalues.
- When do the formulas for similarity and congruence agree for a given change matrix \(\mathbf{P}\)?
- Can two congruent real symmetric matrices have different eigenvalues but the same inertia? Explain using one worked example above.