Tutorials › Linear Algebra › Worked Complex Triangularization

Invariant Subspaces and Cayley-Hamilton · Tutorial 572 of 1000

Worked Complex Triangularization

Learn how to build and check an upper-triangular matrix by changing basis one invariant direction at a time.

Advanced 10 min read

What You'll Learn

  • Find an eigenvector of a complex matrix and use it as the first basis vector.
  • Compute a matrix representation using the convention that basis vectors are columns.
  • Reduce a remaining 2×2 block by choosing an eigenvector within that block.
  • Combine successive basis changes to triangularize a 3×3 matrix.
  • Verify a claimed triangularization by checking that the change-of-basis matrix is invertible and that \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{T}\).

Triangularizing One Direction at a Time

For a concrete matrix, triangularization is a sequence of choices that makes the action of the matrix easier to read. First find an eigenvector and place it at the start of a basis. In that basis, the first column has only one nonzero entry. For a 3×3 matrix, the remaining two coordinates form a 2×2 block; finding an eigenvector of that block and changing basis within those coordinates completes the triangularization.

All matrices and vectors in this tutorial have entries in \(\mathbb{C}\). An eigenvector of \(\mathbf{A}\in\mathbb{C}^{n\times n}\) is a nonzero vector \(\mathbf{v}\) such that \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\) for some \(\lambda\in\mathbb{C}\), called its eigenvalue. If \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) is a basis, let \(\mathbf{P}\) be the matrix whose columns are those basis vectors. The matrix representing the action of \(\mathbf{A}\) in this basis is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). An upper-triangular matrix has zero entries below its main diagonal.

Key idea: If the first vector in a basis is an eigenvector, then the first column of the matrix in that basis is \((\lambda,0,\dots,0)^{\top}\). For a 3×3 matrix, the lower-right 2×2 block describes what remains to be triangularized.

This is a constructive method, not a claim that every arbitrary basis works. The first basis vector must be an eigenvector. The other basis vectors can initially be any vectors that complete a basis; if the remaining block is not upper triangular, change basis within that block.

Why the Basis Change Works

Theorem: Let \(\mathbf{A}\in\mathbb{C}^{n\times n}\), and let \(\mathbf{P}\) be an invertible matrix whose columns form an ordered basis. The columns of \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) are the coordinates, in that basis, of \(\mathbf{A}\) applied to the corresponding basis vectors.

Proof. Write the columns of \(\mathbf{P}\) as \(\mathbf{b}_1,\dots,\mathbf{b}_n\), and let \(\mathbf{e}_j\) be the \(j\)th standard basis vector. Then \(\mathbf{P}\mathbf{e}_j=\mathbf{b}_j\). By matrix multiplication, \(\mathbf{A}\mathbf{P}\mathbf{e}_j=\mathbf{A}\mathbf{b}_j\). Multiplication by \(\mathbf{P}^{-1}\) converts a vector into its coordinates in the basis given by the columns of \(\mathbf{P}\), since \(\mathbf{P}[\mathbf{x}]_{\mathcal{B}}=\mathbf{x}\). Therefore \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{e}_j\) is the coordinate vector of \(\mathbf{A}\mathbf{b}_j\). This holds for each \(j\), so it describes every column of the matrix. \(\square\)

Theorem (Reduction within a remaining block): Suppose a basis gives the matrix \(\begin{bmatrix}\lambda&\mathbf{r}\\\mathbf{0}&\mathbf{B}\end{bmatrix}\), where \(\mathbf{B}\in\mathbb{C}^{(n-1)\times(n-1)}\). If an invertible matrix \(\mathbf{Q}\) makes \(\mathbf{Q}^{-1}\mathbf{B}\mathbf{Q}\) upper triangular, then changing the full basis by \(\operatorname{diag}(1,\mathbf{Q})\) makes the full matrix upper triangular.

Proof. Denote the starting matrix by \(\mathbf{C}\), and set \(\mathbf{D}=\operatorname{diag}(1,\mathbf{Q})\). The matrix \(\mathbf{D}\) is invertible, with \(\mathbf{D}^{-1}=\operatorname{diag}(1,\mathbf{Q}^{-1})\). Multiplying the blocks gives \(\mathbf{D}^{-1}\mathbf{C}\mathbf{D}=\begin{bmatrix}\lambda&\mathbf{r}\mathbf{Q}\\\mathbf{0}&\mathbf{Q}^{-1}\mathbf{B}\mathbf{Q}\end{bmatrix}\). The lower-left block is still zero, and the lower-right block is upper triangular by assumption. The top row has no entries below the main diagonal, while the lower-right block has none either. Thus the full matrix is upper triangular. \(\square\)

The first theorem explains how to read the transformed matrix; the second explains why a basis change inside the remaining coordinates does not disturb the eigenvector already placed first. The next examples show the calculations explicitly.

A Complex 2×2 Example

Worked Example: A Complex Matrix with Two Eigenvalues

Triangularize \(\mathbf{A}=\begin{bmatrix}1&i\\i&1\end{bmatrix}\), where \(i^2=-1\), by finding an eigenvector and extending it to a basis.

Try \(\mathbf{v}=(1,1)^{\top}\). Direct multiplication gives \(\mathbf{A}\mathbf{v}=(1+i,1+i)^{\top}=(1+i)\mathbf{v}\), so \(\lambda=1+i\) is an eigenvalue. Choose \(\mathbf{w}=(1,0)^{\top}\) to complete a basis. Its basis matrix and inverse are

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

The columns are independent: if \(a(1,1)^{\top}+b(1,0)^{\top}=\mathbf{0}\), the second coordinate gives \(a=0\), then the first gives \(b=0\). Now \(\mathbf{A}\mathbf{v}=(1+i)\mathbf{v}\), while \(\mathbf{A}\mathbf{w}=(1,i)^{\top}=i\mathbf{v}+(1-i)\mathbf{w}\). Thus the columns of the transformed matrix are \((1+i,0)^{\top}\) and \((i,1-i)^{\top}\):

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

Check: Multiplying by columns verifies \(\mathbf{A}\mathbf{P}=\mathbf{P}\begin{bmatrix}1+i&i\\0&1-i\end{bmatrix}\). The first column on both sides is \((1+i,1+i)^{\top}\). The second column on both sides is \((1,i)^{\top}\), because \(i\mathbf{v}+(1-i)\mathbf{w}=(1,i)^{\top}\). Since \(\mathbf{P}\) is invertible, this confirms the similarity and the triangular form.

A Repeated Eigenvalue Does Not Require Diagonalization

Worked Example: A Triangular Form with a Repeated Diagonal Entry

Triangularize \(\mathbf{A}=\begin{bmatrix}0&1\\-1&2\end{bmatrix}\) over \(\mathbb{C}\). The vector \(\mathbf{v}=(1,1)^{\top}\) satisfies \(\mathbf{A}\mathbf{v}=(1,1)^{\top}=\mathbf{v}\), so use it as the first basis vector. Choose \(\mathbf{w}=(1,0)^{\top}\) as the second. As in the previous example, \(\mathbf{P}=\begin{bmatrix}1&1\\1&0\end{bmatrix}\) and \(\mathbf{P}^{-1}=\begin{bmatrix}0&1\\1&-1\end{bmatrix}\).

For the second basis vector, \(\mathbf{A}\mathbf{w}=(0,-1)^{\top}=-\mathbf{v}+\mathbf{w}\). The coordinate columns are therefore \((1,0)^{\top}\) and \((-1,1)^{\top}\), giving

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

Check: The first column of \(\mathbf{A}\mathbf{P}\) is \(\mathbf{A}\mathbf{v}=\mathbf{v}\), matching the first column of \(\mathbf{P}\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). The second is \(\mathbf{A}\mathbf{w}=-\mathbf{v}+\mathbf{w}=(0,-1)^{\top}\), matching the second column of that product. The repeated diagonal entry does not make the matrix diagonal: the nonzero entry \(-1\) records that \(\mathbf{A}\mathbf{w}\) is not just a multiple of \(\mathbf{w}\).

Triangularizing a 3×3 Matrix in Two Stages

Worked Example: Find an Eigenvector, Then Reduce the Remaining Block

Triangularize \(\mathbf{A}=\begin{bmatrix}1&2i-1&1\\1&2i-1&0\\-1&1&2\end{bmatrix}\). First take \(\mathbf{v}_1=(1,1,0)^{\top}\). Adding the first two columns of \(\mathbf{A}\) gives \((2i,2i,0)^{\top}=2i\mathbf{v}_1\), so \(2i\) is an eigenvalue. Extend \(\mathbf{v}_1\) to the basis \(\mathcal{B}_0=(\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3)\), where \(\mathbf{v}_2=(1,0,0)^{\top}\) and \(\mathbf{v}_3=(0,0,1)^{\top}\). The basis matrix and its inverse are

$$ \mathbf{P}_0=\begin{bmatrix}1&1&0\\1&0&0\\0&0&1\end{bmatrix}, \qquad \mathbf{P}_0^{-1}=\begin{bmatrix}0&1&0\\1&-1&0\\0&0&1\end{bmatrix}. $$

Applying \(\mathbf{A}\) to these basis vectors gives \(\mathbf{A}\mathbf{v}_1=2i\mathbf{v}_1\), \(\mathbf{A}\mathbf{v}_2=\mathbf{v}_1-\mathbf{v}_3\), and \(\mathbf{A}\mathbf{v}_3=\mathbf{v}_2+2\mathbf{v}_3\). Hence

$$ \mathbf{P}_0^{-1}\mathbf{A}\mathbf{P}_0 = \begin{bmatrix}2i&1&0\\0&0&1\\0&-1&2\end{bmatrix} = \begin{bmatrix}2i&\mathbf{r}\\\mathbf{0}&\mathbf{B}\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}0&1\\-1&2\end{bmatrix}. $$

The remaining block has eigenvector \(\mathbf{z}=(1,1)^{\top}\), since \(\mathbf{B}\mathbf{z}=(1,1)^{\top}\). Complete it with \(\mathbf{w}=(1,0)^{\top}\). In this 2-dimensional block, \(\mathbf{B}\mathbf{w}=(0,-1)^{\top}=-\mathbf{z}+\mathbf{w}\), so the basis matrix \(\mathbf{S}=\begin{bmatrix}1&1\\1&0\end{bmatrix}\) gives \(\mathbf{S}^{-1}\mathbf{B}\mathbf{S}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Use this change only in the last two coordinates, with \(\mathbf{Q}=\operatorname{diag}(1,\mathbf{S})\). The full basis matrix is

$$ \mathbf{P}=\mathbf{P}_0\mathbf{Q} =\begin{bmatrix}1&1&1\\1&0&0\\0&1&0\end{bmatrix}. $$

The columns of \(\mathbf{P}\) are \(\mathbf{p}_1=(1,1,0)^{\top}\), \(\mathbf{p}_2=(1,0,1)^{\top}\), and \(\mathbf{p}_3=(1,0,0)^{\top}\). They form a basis; for example, \(\det\mathbf{P}=1\). The resulting matrix is

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

Check: The columns of \(\mathbf{A}\mathbf{P}\) are \(\mathbf{A}\mathbf{p}_1=(2i,2i,0)^{\top}\), \(\mathbf{A}\mathbf{p}_2=(2,1,1)^{\top}\), and \(\mathbf{A}\mathbf{p}_3=(1,1,-1)^{\top}\). The proposed triangular matrix expresses these as \(2i\mathbf{p}_1\), \(\mathbf{p}_1+\mathbf{p}_2\), and \(\mathbf{p}_1-\mathbf{p}_2+\mathbf{p}_3\), respectively. Those combinations equal the three computed columns, so \(\mathbf{A}\mathbf{P}=\mathbf{P}(\mathbf{P}^{-1}\mathbf{A}\mathbf{P})\).

Common Pitfall: Omitting the Right-Hand Basis Matrix

The similarity formula is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), not merely \(\mathbf{P}^{-1}\mathbf{A}\). The right-hand factor matters because the input coordinates must first be converted from the chosen basis to standard coordinates. In the first worked example, omitting \(\mathbf{P}\) gives the incorrect expression \(\mathbf{P}^{-1}\mathbf{A}=\begin{bmatrix}i&1\\1-i&i-1\end{bmatrix}\), which is not the matrix of \(\mathbf{A}\) in the basis \((\mathbf{v},\mathbf{w})\). Indeed, the first coordinate vector represents \(\mathbf{v}\), so its image must have coordinates \((1+i,0)^{\top}\); the first column of the incorrect expression is \((i,1-i)^{\top}\). The correct computation includes \(\mathbf{P}\): \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{e}_1=\mathbf{P}^{-1}\mathbf{A}\mathbf{v}=(1+i,0)^{\top}\).

A second check is to verify \(\mathbf{A}\mathbf{P}=\mathbf{P}\mathbf{T}\), where \(\mathbf{T}\) is the proposed triangular matrix. This checks every column against the action of \(\mathbf{A}\), and also catches a basis matrix whose columns were ordered differently from the calculations.

What to Look For in a Completed Triangularization

The diagonal entries of the triangular matrix show the successive eigenvalues found during the construction. The entries above the diagonal describe how the images of later basis vectors may include earlier basis vectors. They need not be zero, as the repeated-eigenvalue example demonstrates. Triangularization is useful precisely because it reveals this structure without requiring the matrix to be diagonalizable.

For a 3×3 calculation, the practical sequence is: choose an eigenvector, extend it to a basis, calculate the remaining 2×2 block, then choose a basis for that block that makes it upper triangular. Keep the change confined to the remaining coordinates, and finally verify the full result by multiplying back. This makes each stage transparent and helps distinguish an actual change of basis from a matrix that is only superficially triangular.

Check Your Understanding

For each calculation, keep the basis vectors as columns and verify the final similarity by multiplying back.

  1. For \(\begin{bmatrix}2&i\\i&2\end{bmatrix}\), test \((1,1)^{\top}\) as a first basis vector and find a second vector that completes a basis.
  2. For \(\begin{bmatrix}0&1\\-1&2\end{bmatrix}\), compute the coordinates of the image of \((1,0)^{\top}\) in the basis \(((1,1)^{\top},(1,0)^{\top})\).
  3. Explain why an eigenvector placed first forces zeros below the first entry of the first column in the transformed matrix.
  4. In a 3×3 triangularization, what part of the transformed matrix must be made upper triangular after the first eigenvector is placed first?
  5. Write the multiplication check that confirms a proposed \(\mathbf{T}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).

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