Articles / Linear Algebra · Part 13
Characteristic Polynomial and Diagonalization
Learn what the characteristic polynomial is, how to find eigenvalues, and how to diagonalize a matrix step by step. Explore the conditions for diagonalization and how it simplifies matrix powers.
In the previous article, we learned about eigenvalues and eigenvectors. Eigenvectors represent special directions that remain unchanged in direction under a matrix transformation, while eigenvalues describe how those directions are scaled.
These concepts allow us to simplify matrices using a technique called diagonalization.
Instead of working directly with a complicated matrix, we can sometimes represent it using a diagonal matrix, which is much easier to work with.
Diagonalization is especially useful when calculating matrix powers, studying transformations, and solving problems in mathematics, physics, and computer science.
2. Characteristic Polynomial
The characteristic polynomial is a polynomial equation used to find the eigenvalues of a square matrix.
Recall the eigenvalue equation:
\[
A\mathbf{v}=\lambda\mathbf{v}
\]
Rearranging:
\[
(A-\lambda I)\mathbf{v}=\mathbf{0}
\]
For this equation to have a non-zero solution, the matrix \(A-\lambda I\) must be singular. Therefore:
\[
\det(A-\lambda I)=0
\]
This equation is called the characteristic equation, and the expression
\[
\boxed{p(\lambda)=\det(A-\lambda I)}
\]
is called the characteristic polynomial.
The roots of the characteristic polynomial are the eigenvalues of the matrix.
3. Finding the Characteristic Polynomial
Consider the matrix:
\[
A=
\begin{bmatrix}
2&1\\
1&2
\end{bmatrix}
\]
First, subtract \(\lambda I\):
\[
A-\lambda I=
\begin{bmatrix}
2-\lambda&1\\
1&2-\lambda
\end{bmatrix}
\]
Now calculate its determinant:
\[
\begin{aligned}
p(\lambda)
&=\det(A-\lambda I)\\
&=(2-\lambda)(2-\lambda)-1\\
&=(2-\lambda)^2-1\\
&=4-4\lambda+\lambda^2-1\\
&=\lambda^2-4\lambda+3
\end{aligned}
\]
Therefore, the characteristic polynomial is:
\[
\boxed{p(\lambda)=\lambda^2-4\lambda+3}
\]
To find the eigenvalues, set the polynomial equal to zero:
\[
\lambda^2-4\lambda+3=0
\]
Factor it:
\[
(\lambda-1)(\lambda-3)=0
\]
Thus:
\[
\boxed{\lambda_1=1,\qquad\lambda_2=3}
\]
4. What Is Diagonalization?
Diagonalization is the process of expressing a square matrix in the form:
\[
\boxed{A=PDP^{-1}}
\]
Where:
- \(A\) is the original matrix.
- \(P\) is a matrix whose columns are eigenvectors of \(A\).
- \(D\) is a diagonal matrix containing the corresponding eigenvalues.
- \(P^{-1}\) is the inverse of (P).
The diagonal matrix (D) is much simpler because all its non-diagonal entries are zero.
For example:
\[
D=
\begin{bmatrix}
3&0\\
0&1
\end{bmatrix}
\]
Instead of performing complicated calculations with (A), we can often work with (D).
5. Conditions for Diagonalization
An \(n\times n\) matrix is diagonalizable if it has \(n\) linearly independent eigenvectors.
These eigenvectors can be arranged as the columns of \(P\).
If the eigenvectors are linearly independent, \(P\) is invertible, and the diagonalization is possible.
Important: Having repeated eigenvalues does not automatically mean a matrix is not diagonalizable. What matters is whether the matrix has enough linearly independent eigenvectors.
6. Step-by-Step Diagonalization Example
We will diagonalize the matrix:
\[
A=
\begin{bmatrix}
2&1\\
1&2
\end{bmatrix}
\]
From the previous calculation, its eigenvalues are:
\[
\lambda_1=3,\qquad\lambda_2=1
\]
Step 1: Find the eigenvectors
For \(\lambda_1=3\), the corresponding eigenvector is:
\[
\mathbf{v}_1=
\begin{bmatrix}
1\
1
\end{bmatrix}
\]
For \(\lambda_2=1\), the corresponding eigenvector is:
\[
\mathbf{v}_2=
\begin{bmatrix}
1\
-1
\end{bmatrix}
\]
Step 2: Construct matrix (P)
Place the eigenvectors as columns of \(P\):
\[
P=
\begin{bmatrix}
1&1\\
1&-1
\end{bmatrix}
\]
Step 3: Construct diagonal matrix (D)
Place the corresponding eigenvalues along the diagonal, keeping the same order as the eigenvectors in (P):
\[
D=
\begin{bmatrix}
3&0\\
0&1
\end{bmatrix}
\]
Step 4: Calculate \(P^{-1}\)
For a \(2\times2\) matrix:
\[
\frac{1}{ad-bc}
\begin{bmatrix}
d&-b\
-c&a
\end{bmatrix}
\]
Therefore:
\[
\begin{aligned}
P^{-1}
&=\frac{1}{(1)(-1)-(1)(1)}
\begin{bmatrix}
-1&-1\\
-1&1
\end{bmatrix}\\[6pt]
&=\frac{1}{-2}
\begin{bmatrix}
-1&-1\\
-1&1
\end{bmatrix}
\end{aligned}
\]
Hence:
\[
\boxed{
P^{-1}=
\begin{bmatrix}
\frac12&\frac12\\
\frac12&-\frac12
\end{bmatrix}
}
\]
Step 5: Write the diagonalization
We have obtained:
\[
P=
\begin{bmatrix}
1&1\\
1&-1
\end{bmatrix},
\qquad
D=
\begin{bmatrix}
3&0\\
0&1
\end{bmatrix}
\]
\[
P^{-1}=
\begin{bmatrix}
\frac12&\frac12\\
\frac12&-\frac12
\end{bmatrix}
\]
Therefore:
\[
\boxed{A=PDP^{-1}}
\]
Or, equivalently:
\[
\boxed{D=P^{-1}AP}
\]
Both forms describe the same diagonalization.
7. Why Is Diagonalization Useful?
One of the most important applications of diagonalization is calculating powers of a matrix.
Suppose we need to calculate:
\[
A^{10}
\]
Multiplying a matrix by itself ten times can be tedious. But if:
\[
A=PDP^{-1}
\]
then:
\[
A^2=PDP^{-1}PDP^{-1}
\]
Since:
\[
P^{-1}P=I
\]
we get:
\[
A^2=PD^2P^{-1}
\]
Similarly:
\[
A^3=PD^3P^{-1}
\]
Therefore, in general:
\[
\boxed{A^k=PD^kP^{-1}}
\]
Calculating powers of a diagonal matrix is easy because we simply raise each diagonal entry to the required power.
For example:
\[
D^k=
\begin{bmatrix}
3^k&0\\
0&1^k
\end{bmatrix}
\]
This makes diagonalization extremely useful in repeated transformations and mathematical models.
8. Applications
Diagonalization is useful in several fields:
- Computer Science: Simplifying repeated matrix operations and algorithms.
- Machine Learning: Understanding transformations and mathematical structures used in data analysis.
- Physics: Studying systems, energy states, and transformations.
- Differential Equations: Solving systems of differential equations using matrix methods.
- Graph Theory: Analyzing graph properties and certain network processes.
9. Summary
The characteristic polynomial is used to find the eigenvalues of a square matrix.
\[
p(\lambda)=\det(A-\lambda I)
\]
The roots of this polynomial give the eigenvalues.
Diagonalization expresses a matrix as:
\[
A=PDP^{-1}
\]
where (P) contains linearly independent eigenvectors and (D) contains their corresponding eigenvalues.
A matrix is diagonalizable if it has enough linearly independent eigenvectors to form an invertible matrix (P).
One of its major advantages is simplifying matrix powers:
\[
A^k=PD^kP^{-1}
\]
Diagonalization connects eigenvalues and eigenvectors with practical matrix calculations and prepares us for more advanced topics in Linear Algebra.
Quick quiz
5 questionsOriginally published at farhanpaal.com — https://farhanpaal.com/articles/characteristic-polynomial-and-diagonalization/
Keep a copy
Read offline as a printout or PDF.
farhanpaal.com