Tutorials › Linear Algebra › Triangularizing Complex Matrices

Invariant Subspaces and Cayley-Hamilton · Tutorial 571 of 1000

Triangularizing Complex Matrices

Learn how an eigenvector and induction reduce complex triangularization to a smaller matrix, and how to check the resulting change of basis.

Advanced 10 min read

What You'll Learn

  • State precisely what it means for a complex matrix to be similar to an upper-triangular matrix.
  • Use the Fundamental Theorem of Algebra to establish that a complex square matrix has an eigenvalue.
  • Build a basis beginning with an eigenvector and identify the resulting block matrix.
  • Apply induction to triangularize the smaller diagonal block.
  • Track how the change of basis transforms the upper-right block.
  • Check triangularization calculations by verifying the similarity equation.

What Triangularization Asks For

A complex square matrix need not already be upper triangular, and it need not be diagonalizable. Triangularization asks for a basis in which its matrix has zeros below the main diagonal. The key idea is to choose an eigenvector as the first basis vector: that makes the first column simple, leaving a smaller square matrix to handle by induction.

Throughout, matrices act on column vectors in \(\mathbb{C}^n\). An eigenvalue of \(\mathbf{A}\in\mathbb{C}^{n\times n}\) is a scalar \(\lambda\in\mathbb{C}\) for which there is a nonzero vector \(\mathbf{v}\) satisfying \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\). A matrix \(\mathbf{U}\) is upper triangular if \(u_{ij}=0\) whenever \(i>j\). Two square matrices \(\mathbf{A}\) and \(\mathbf{U}\) are similar if \(\mathbf{U}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) for some invertible matrix \(\mathbf{P}\) of the same size. The columns of \(\mathbf{P}\) are the basis vectors used to represent \(\mathbf{A}\) in the new basis.

Definition: A matrix \(\mathbf{A}\in\mathbb{C}^{n\times n}\) is triangularizable over \(\mathbb{C}\) if there is an invertible \(\mathbf{P}\in\mathbb{C}^{n\times n}\) such that \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) is upper triangular. The matrix \(\mathbf{P}\) specifies the change of basis; triangularization does not assert that \(\mathbf{A}\) itself is triangular.

Why a Complex Matrix Has an Eigenvector

The induction needs an eigenvector at every positive dimension. This is where the scalar field matters. The Fundamental Theorem of Algebra states that every nonconstant polynomial with complex coefficients has a complex root. For a square matrix, the relevant polynomial is its characteristic polynomial \(p_{\mathbf{A}}(\lambda)=\det(\mathbf{A}-\lambda\mathbf{I}_n)\).

Lemma: Every matrix \(\mathbf{A}\in\mathbb{C}^{n\times n}\), with \(n\ge 1\), has at least one eigenvalue in \(\mathbb{C}\), and hence has a nonzero eigenvector.

Proof. The determinant expansion shows that \(p_{\mathbf{A}}(\lambda)\) is a polynomial of degree \(n\) with leading coefficient \((-1)^n\). In particular, it is nonconstant. By the Fundamental Theorem of Algebra, there is a \(\lambda\in\mathbb{C}\) such that \(p_{\mathbf{A}}(\lambda)=0\). By the determinant criterion for a square matrix, \(\det(\mathbf{A}-\lambda\mathbf{I}_n)=0\) means that \(\mathbf{A}-\lambda\mathbf{I}_n\) has a nonzero vector \(\mathbf{v}\) in its null space. Thus \((\mathbf{A}-\lambda\mathbf{I}_n)\mathbf{v}=\mathbf{0}\), or \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\), as required. \(\square\)

The lemma supplies a first eigenvector, but it does not by itself triangularize the whole matrix. The remaining step is to arrange a basis so that the part not yet handled is an \((n-1)\times(n-1)\) matrix. Once that block is triangularized, its change of basis must be applied without disturbing the first eigenvector.

The Induction Argument

Theorem: Every matrix \(\mathbf{A}\in\mathbb{C}^{n\times n}\), for \(n\ge 1\), is similar over \(\mathbb{C}\) to an upper-triangular matrix.

Proof. We use induction on \(n\). If \(n=1\), then \(\mathbf{A}\) already has one entry and is upper triangular. Now let \(n\ge2\), and assume the theorem holds for matrices of size \((n-1)\times(n-1)\).

By the lemma, choose an eigenvalue \(\lambda\) and a corresponding nonzero eigenvector \(\mathbf{v}_1\). Extend \(\mathbf{v}_1\) to a basis \((\mathbf{v}_1,\dots,\mathbf{v}_n)\) of \(\mathbb{C}^n\), and let \(\mathbf{Q}\) be the matrix with these basis vectors as columns. Such an extension can be made by appending standard basis vectors not already in the current span until the list spans \(\mathbb{C}^n\). Since the columns of \(\mathbf{Q}\) form a basis, \(\mathbf{Q}\) is invertible.

In this basis, the first column of \(\mathbf{Q}^{-1}\mathbf{A}\mathbf{Q}\) is \(\lambda\mathbf{e}_1\): indeed, \(\mathbf{A}\mathbf{v}_1=\lambda\mathbf{v}_1\), whose coordinate vector in this basis is \((\lambda,0,\dots,0)^\top\). Therefore, for some row \(\mathbf{r}\) and some \(\mathbf{B}\in\mathbb{C}^{(n-1)\times(n-1)}\), the matrix has block form

$$ \mathbf{Q}^{-1}\mathbf{A}\mathbf{Q} = \begin{bmatrix} \lambda & \mathbf{r}\\ \mathbf{0} & \mathbf{B} \end{bmatrix}. $$

By the induction hypothesis, there is an invertible \(\mathbf{S}\in\mathbb{C}^{(n-1)\times(n-1)}\) such that \(\mathbf{S}^{-1}\mathbf{B}\mathbf{S}=\mathbf{U}\), where \(\mathbf{U}\) is upper triangular. Set \(\mathbf{D}=\begin{bmatrix}1&\mathbf{0}\\ \mathbf{0}&\mathbf{S}\end{bmatrix}\), which is invertible with \(\mathbf{D}^{-1}=\begin{bmatrix}1&\mathbf{0}\\ \mathbf{0}&\mathbf{S}^{-1}\end{bmatrix}\). Block multiplication gives

$$ \mathbf{D}^{-1} \begin{bmatrix} \lambda & \mathbf{r}\\ \mathbf{0} & \mathbf{B} \end{bmatrix} \mathbf{D} = \begin{bmatrix} \lambda & \mathbf{r}\mathbf{S}\\ \mathbf{0} & \mathbf{S}^{-1}\mathbf{B}\mathbf{S} \end{bmatrix} = \begin{bmatrix} \lambda & \mathbf{r}\mathbf{S}\\ \mathbf{0} & \mathbf{U} \end{bmatrix}. $$

This last matrix is upper triangular: its lower-left block is zero, its first diagonal block is the scalar \(\lambda\), and its lower-right block \(\mathbf{U}\) is upper triangular. Finally, set \(\mathbf{P}=\mathbf{Q}\mathbf{D}\), which is invertible as a product of invertible matrices. Then

$$ \mathbf{P}^{-1}\mathbf{A}\mathbf{P} = \mathbf{D}^{-1}\mathbf{Q}^{-1}\mathbf{A}\mathbf{Q}\mathbf{D} = \begin{bmatrix} \lambda & \mathbf{r}\mathbf{S}\\ \mathbf{0} & \mathbf{U} \end{bmatrix}, $$

which is upper triangular. This proves the induction step and therefore the theorem for every \(n\ge1\). \(\square\)

The upper-right row changes from \(\mathbf{r}\) to \(\mathbf{r}\mathbf{S}\). This is necessary: changing the basis in the lower-dimensional block changes how the first row acts on that block. The zero lower-left block remains zero, which is why the resulting matrix stays upper triangular.

Worked Constructions

Worked Example: A Complex 2×2 Matrix with Two Eigenvectors

Triangularize \(\mathbf{A}=\begin{bmatrix}1&i\\ i&1\end{bmatrix}\) by constructing a basis of eigenvectors. Direct multiplication gives \(\mathbf{A}\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}1+i\\1+i\end{bmatrix}=(1+i)\begin{bmatrix}1\\1\end{bmatrix}\) and \(\mathbf{A}\begin{bmatrix}1\\-1\end{bmatrix}=\begin{bmatrix}1-i\\i-1\end{bmatrix}=(1-i)\begin{bmatrix}1\\-1\end{bmatrix}\).

Use these vectors as columns of \(\mathbf{P}\). The columns are independent because the determinant of \(\mathbf{P}\) is \(-2\ne0\):

$$ \mathbf{P}=\begin{bmatrix}1&1\\1&-1\end{bmatrix}, \qquad \mathbf{P}^{-1}=\frac12\begin{bmatrix}1&1\\1&-1\end{bmatrix}, \qquad \mathbf{T}=\begin{bmatrix}1+i&0\\0&1-i\end{bmatrix}. $$

To check the similarity, multiply \(\mathbf{A}\mathbf{P}\) column by column. Its columns are \((1+i)\begin{bmatrix}1\\1\end{bmatrix}\) and \((1-i)\begin{bmatrix}1\\-1\end{bmatrix}\), so

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}1+i&1-i\\1+i&i-1\end{bmatrix} = \mathbf{P}\mathbf{T}. $$

Since \(\mathbf{P}\) is invertible, this verifies \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{T}\). The resulting matrix is diagonal, and therefore upper triangular.

Worked Example: Triangularizing a 3×3 Matrix Through a Smaller Block

Consider

$$ \mathbf{A}= \begin{bmatrix} 2&1&0\\ 0&0&1\\ 0&-1&0 \end{bmatrix}. $$

The first standard basis vector is an eigenvector with eigenvalue \(2\). The lower-right block is \(\mathbf{B}=\begin{bmatrix}0&1\\-1&0\end{bmatrix}\). Its eigenvectors \(\begin{bmatrix}1\\i\end{bmatrix}\) and \(\begin{bmatrix}1\\-i\end{bmatrix}\) have eigenvalues \(i\) and \(-i\), respectively, since

$$ \mathbf{B}\begin{bmatrix}1\\i\end{bmatrix} =\begin{bmatrix}i\\-1\end{bmatrix} =i\begin{bmatrix}1\\i\end{bmatrix}, \qquad \mathbf{B}\begin{bmatrix}1\\-i\end{bmatrix} =\begin{bmatrix}-i\\-1\end{bmatrix} =-i\begin{bmatrix}1\\-i\end{bmatrix}. $$

Keep the first standard basis vector and use these two eigenvectors for the lower block. This gives

$$ \mathbf{P}= \begin{bmatrix} 1&0&0\\ 0&1&1\\ 0&i&-i \end{bmatrix}, \qquad \mathbf{P}^{-1}= \begin{bmatrix} 1&0&0\\ 0&\tfrac12&-\tfrac{i}{2}\\ 0&\tfrac12&\tfrac{i}{2} \end{bmatrix}. $$

The lower-right \(2\times2\) block of \(\mathbf{P}\) has determinant \(-2i\ne0\), so \(\mathbf{P}\) is invertible. Multiplying gives

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix} 2&1&1\\ 0&i&-i\\ 0&-1&-1 \end{bmatrix}. $$

Now multiply in the other order. The rows of \(\mathbf{P}\) give \(\mathbf{P}\mathbf{T}\) as follows:

$$ \mathbf{T}= \begin{bmatrix} 2&1&1\\ 0&i&0\\ 0&0&-i \end{bmatrix}, \qquad \mathbf{P}\mathbf{T} = \begin{bmatrix} 2&1&1\\ 0&i&-i\\ 0&-1&-1 \end{bmatrix}. $$

Thus \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{T}\), and invertibility of \(\mathbf{P}\) verifies \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{T}\). The lower block has been triangularized, while the transformed upper-right row is \((1,1)\).

Worked Example: A Nontriangular Matrix Similar to an Upper-Triangular One

Let \(\mathbf{A}=\begin{bmatrix}2&1\\-1&4\end{bmatrix}\). It is not upper triangular because its entry in row 2, column 1 is \(-1\). Choose \(\mathbf{P}=\begin{bmatrix}1&0\\1&1\end{bmatrix}\), with \(\mathbf{P}^{-1}=\begin{bmatrix}1&0\\-1&1\end{bmatrix}\). The columns of \(\mathbf{P}\) are independent, as \(\det\mathbf{P}=1\).

Set \(\mathbf{T}=\begin{bmatrix}3&1\\0&3\end{bmatrix}\). Verify the proposed change of basis by computing both products:

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}2&1\\-1&4\end{bmatrix} \begin{bmatrix}1&0\\1&1\end{bmatrix} = \begin{bmatrix}3&1\\3&4\end{bmatrix}, \qquad \mathbf{P}\mathbf{T} = \begin{bmatrix}1&0\\1&1\end{bmatrix} \begin{bmatrix}3&1\\0&3\end{bmatrix} = \begin{bmatrix}3&1\\3&4\end{bmatrix}. $$

Since \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{T}\) and \(\mathbf{P}\) is invertible, \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{T}\). This example illustrates the point of similarity: triangular form is a property of the matrix in a suitable basis, not necessarily of its original entries.

Why the Scalar Field Matters

The theorem is stated over \(\mathbb{C}\) because the eigenvector step is guaranteed by the Fundamental Theorem of Algebra. Over \(\mathbb{R}\), an eigenvalue need not exist. For instance, the real matrix \(\begin{bmatrix}0&-1\\1&0\end{bmatrix}\) has characteristic polynomial \(\lambda^2+1\), which has no real root. The induction cannot begin with a real eigenvector in that case. Considering the same matrix over \(\mathbb{C}\) supplies eigenvalues \(i\) and \(-i\), so the complex theorem applies.

Triangularization is also weaker than diagonalization: upper-triangular entries above the diagonal may remain nonzero. In the induction proof, the only task for the smaller block is to become upper triangular; there is no requirement that it become diagonal. The diagonal entries of the final matrix are complex numbers, but this proof does not yet establish any further formula about them.

Common Pitfall: Forgetting to Transform the Upper-Right Block

When changing the basis in the lower-right block, it is incorrect to replace \(\mathbf{B}\) by \(\mathbf{S}^{-1}\mathbf{B}\mathbf{S}\) while leaving the upper-right row \(\mathbf{r}\) unchanged. The full block multiplication gives \(\mathbf{r}\mathbf{S}\), not \(\mathbf{r}\). In the 3×3 example, the original upper-right row is \((1,0)\), and the lower-block change of basis is \(\mathbf{S}=\begin{bmatrix}1&1\\i&-i\end{bmatrix}\). The correct row is

$$ (1,0)\begin{bmatrix}1&1\\i&-i\end{bmatrix}=(1,1). $$

If one incorrectly keeps \((1,0)\), the proposed triangular matrix would have first row \((2,1,0)\). Multiplying that incorrect matrix by \(\mathbf{P}\) gives first row \((2,1,0)\), whereas the first row of \(\mathbf{A}\mathbf{P}\) is \((2,1,1)\). Thus \(\mathbf{A}\mathbf{P}\ne\mathbf{P}\mathbf{T}\), exposing the error. The reliable check is to multiply the proposed matrices and verify \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{T}\).

Check Your Understanding

Use the induction argument and the worked calculations to answer the following.

  1. Why does the Fundamental Theorem of Algebra guarantee an eigenvalue for every nonempty complex square matrix?
  2. In the induction proof, why is the lower-left block of \(\mathbf{Q}^{-1}\mathbf{A}\mathbf{Q}\) zero?
  3. If the upper-right block is \(\mathbf{r}\), what does it become after conjugation by \(\begin{bmatrix}1&\mathbf{0}\\ \mathbf{0}&\mathbf{S}\end{bmatrix}\)?
  4. For \(\mathbf{A}=\begin{bmatrix}0&1\\-1&0\end{bmatrix}\), verify that \((1,i)^\top\) is an eigenvector over \(\mathbb{C}\), and state its eigenvalue.
  5. Explain why a matrix similar to an upper-triangular matrix need not itself be upper triangular.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon