# Diagonalization

## Diagonalization

### Linear algebra diagonalization

Diagonalization is the process of taking a matrix and breaking it into a product of three distinct matrices. Although it sounds counterintuitive, breaking a matrix into a product of three matrices happens to be very useful when trying to find the high powers of a matrix.

And so, if a matrix is diagonalizable, then it can be mathematically written as:

Where D is a diagonal matrix, and the convenience of this formula comes from the fact that it can help us find $A^{k}$ (when k is very big). This is due the relationship:

Given the components of equation 1 and 2, an important reminder is the computation of an inverse matrix which can be shown below:

When finding the diagonalization of a matrix, you will use these three basic formulas plus a few other mathematical tools which will be mentioned in the next sections.

### What is a diagonal matrix

For this particular lesson is of utmost important that you are comfortable working with diagonal matrices. A diagonal matrix is that in which the entries on the main diagonal have values different than zero, and the rest of the values in the whole matrix are zeros.

During this lesson you will be solving for eigenvalues and vectors, and so, D will always have a notation in which the main diagonal of a square matrix are the only terms which are not zero, and which happen to be the eigenvalues of the diagonalizable matrix.

At this point, we recommend you to have already studied the lesson on eigenvalues and eigenvectors if you have not done so. If you have, but think a review will be good to refresh your mind, please take a moment to go back and check the topic before you continue.

### How to diagonalize a matrix

The process of diagonalizing a matrix is quite simple depending on the information you are provided with in each problem. For that, we will show you how is done by looking into some examples.

During the process of diagonalization, or related procedures, you will be required to know how to compute the determinant of a 2x2 matrix or the determinant of a 3x3 matrix. Although you may find bigger nxn matrix determinants in your studies, at school, independently or in linear algebra books, the two mentioned are the most common, therefore, we will keep our examples to 2x2 and 3x3 matrices.

To begin with, let us look at an example in which we show how diagonalization is helpful when computing the higher power of a matrix.

### Example 1:

• Let $A = PDP^{-1}$. Compute $A^{10}$ if:
• The first step in order to compute $A^{10}$ is to obtain the inverse of matrix P using equation 3.
• Having all P, D and $P^{-1}$ we just follow the process shown in equation 2 to obtain $A^{10}$:

This operation may now seem very simple but there is catch here, although we have provided P and D in for this example, they are usually not given in exam problems or assignments, you actually have to obtain them yourself. So, how exactly do we find P and D to work through the formula A= $PDP^{-1}$? You need to follow the next steps:

• To find P:
• Calculate the eigenvalues of A using the formula det $\left(A - I \lambda\right) = 0$
• Find the eigenvectors of each eigenvalue
• Use the eigenvectors as columns of matrix P
• To find D:
• Fill the diagonal entries with corresponding eigenvalues
• Fill the rest of the entries as zero

Consequently, let us work an example of this:

### Example 2:

Diagonalize matrix A

Remember that diagonalizing means to find P, D and $P^{-1}$ in the formula A= $PDP^{-1}$, therefore, let us find each of them following the steps we just described above.

We start by looking for P.

• First, we have to calculate the eigenvalues of matrix A using the characteristic polynomial equation det $\left(A - I \lambda\right) = 0$, since the roots of the resulting characteristic polynomial are the eigenvalues of A.
• While working to find the eigenvalues , remember you can solve the quadratic equation with the quadratic formula. Having all the possible values of $\lambda$ , let us find the eigenvectors associated with each of them. For $\lambda$ =1:
• In order to solve for the vector $\overline{x}$ we use an augmented matrix:
• And so, we can write our general solution to obtain the eigenvector associated to $\lambda$ =1.
• Following the same process, now to obtain the eigenvector associated to $\lambda$ = 8:
• Using an augmented matrix to solve for vector $\overline{x}$:
• Writing the general solution and the final eigenvector associated to $\lambda$ = 8
• Now we use the two eigenvectors found to write down P. Remember you just have to use the eigenvectors as columns to produce the matrix for P.
• The next two things we have to write down are the matrices D and $P^{-1}$ which at this point should come up straight forward. Since D is a diagonal matrix, we know the only nonzero components inside of it will be those in the main diagonal, thus, we fill the main diagonal using the eigenvalues found before of $\lambda$ = 1 and $\lambda$ = 8 in the next manner:
• Finally, we obtain the inverse of P by applying equation 3:
• Remember what it means to have diagonalized a matrix, just obtaining the correct notations for D and $P^{-1}$ , therefore, the complete diagonalization looks like:

And that is how you diagonalize a matrix, you truly don't need to go through the process of calculating equation 1 because you would only end up with matrix A as a result, so the final result of the problems in this case is just for you to have found the values of D and $P^{-1}$ .

Now, it is important that you know if a matrix is diagonalizable or not before you go through the trouble of calculating D and $P^{-1}$ . In other words, imagine you go through the whole process we just described and computed above, just to realize you come up with trivial solutions? That is just a waste of time and energy in something that does not make any sense, and for that, we need to learn how to identify if a matrix is diagonalizable or not beforehand.

This verification process is what we call the Diagonalization theorem and is quite simple, you just need to check for two things:

• For an nxn matrix to be diagonalizable there should be n linearly independent eigenvectors.

This means that, if you have a 2x2 matrix, then you should be able to find 2 linearly independent eigenvectors for such matrix. If you have a 3x3 matrix, there should be 3 linearly independent eigenvectors and so forth.

• The condition AP = PD should be met.

After confirming the first condition, you must have already the values for the eigenvalues and eigenvectors, and so, use this information to come up with the matrices of P and D. Then multiply A times P and P times D in order to see if the result is equal.

If these two conditions are met for a given matrix A, then such matrix is diagonalizable. If you check for the first condition and is not met, then you can save yourself the trouble to go through the second condition since that is enough to tell you that the matrix you are provided with is not diagonalizable.

Let us work through an example problem in which you will have to identify if the given matrix is diagonalizable or not:

### Example 3:

Is A diagonalizable?

To start the verification process through the diagonalization theorem, let us go through the first condition for matrix diagonalization: Are there two linearly independent eigenvectors? Let's find out!

• Remember we have to find the eigenvalues first:
• Now we find the associated eigenvectors. For $lambda$ = 0:
• And for $lambda$ = 4:
• Therefore, the eigenvectors are:
• By just observing the two eigenvectors, we can clearly see they are linearly independent. Therefore the first condition for diagonalization has been met.

Let us now check if the equality AP = PD can be verified, for that, we need to write down matrices P and D. Remember, P is formed by combining the two eigenvectors (which are column vectors) into one matrix; D being a diagonal matrix is very simple because you just fill up the main diagonal spaces inside the appropriate square matrix using the obtained eigenvalues, while the rest of the digits in the matrix will be zero. And so, the matrices for P and D look as follows:

• The only step left is to compute the matrix multiplications AP and PD and check if the results are equal.

### Further examples on diagonalization:

Example 4 takes on again in calculating a higher power of a given matrix, while examples 5 and 6 focus in finding out if the given matrix is diagonalizable. The lesson ends with example 7 which takes on the general way to diagonalize the matrix provided (which is just finding P, D and $P^{-1}$ ).

Besides practicing with the examples we provide here, we do recommend visiting a few different sites to complement this lesson: A comprehensive example on the diagonalization of a matrix can be found there, and an interesting argument is made about the diagonalization of matrices and its theorem on this lecture piece.

For now, without further ado, let us work in our remaining examples:

### Example 4:

• Let A = P, D and $P^{-1}$ ), then compute $A^{4}$ if:

• Using equation 2, the expression for $A^{4}$ is as follows:
• To solve such equation we first need to calculate the inverse of matrix P:
• Elevating D to the fourth power is quite simple, just elevate each of the values inside the matrix to the fourth power and you will obtain:
• Notice that in the case of matrices such as D, the power effect is noticeable only diagonally since the rest of the terms in the matrix are zeros. Therefore the rest of the terms remain as zeros, since zero to any power equals to zero.

Having all of the components ready, we can now compute $A^{4}$:

### Example 5:

Is the following matrix diagonalizable?

Using the theorem for diagonalization of a matrix, verify the two required conditions: First, are there two linearly independent eigenvectors? And second, is the condition AP = PD met?

• In order to find the eigenvectors, we have to find the eigenvalues related to A by using the characteristic polynomial equation:
• Then we have to find the associated eigenvector to each of the eigenvalues found. For $lambda$ = 5:
• Using and augmented matrix to solve for the vector $\bar{x}$ and obtain the associated eigenvector.
• Now doing the same for $\lambda$ = -1
• Working through the corresponding augmented matrix to obtain the second eigenvector:
• And so, we have two linearly independent eigenvectors and the first condition for matrix diagonalization has been met.

To continue, let us check for the second condition which says that the matrix multiplication AP must be equal to PD. For that, we write down the matrices P and D using the eigenvectors and eigenvalues found:

• Computing AP and PD and comparing them:

And so, the second condition is met and we can conclude that A is diagonalizable.

### Example 5:

Can you diagonalize matrix A if A looks as follows:

To diagonalize A you need to check the two conditions of the diagonalization theorem. First, since A is a 3x3 matrix, are there 3 linearly independent eigenvectors?

• We start by finding the eigenvalues:
• Computing the eigenvector associated to $\lambda$ = 2:
• Therefore, the components $x_2$ and $x_3$ are equal to zero, while the component $x_1$ is a free variable. Writing down the general solution and eigenvector associated to $\lambda$ = 2 using the found components:
• Repeating this process to find the eigenvector associated to $\lambda$ =4:
• Writing down the general solution and the eigenvector:

And so we run into a problem, through this method we can only find two linearly independent eigenvectors, which means that the very first condition for the theorem of a diagonalized matrix is not met. Therefore, our final conclusion is that for this problem, A is not a diagonalizable matrix.

### Example 7:

Diagonalize the following matrix:

• For this problem we just need to find P, D and $P^{-1}$ . So let us start by computing P. We do so using the characteristic polynomial equation to find the appropriate eigenvalues and then their associated eigenvectors:
• Next, we find the associated eigenvector to $\lambda$ = 10:

• Writing the general solution for vector $\bar{x}$ and the found eigenvector:

• Notice that since $x_2$ is a free variable which can take any value, we have made it equal to 4 in order to obtain a simplified eigenvector.

Now computing the associated eigenvector to $\lambda$ = -4:

• And we write down the general solution and obtained eigenvector:
• Having found the eigenvalues and eigenvectors, we can now construct both P and D:
• Using P, we can now compute its inverse:
• And our final solution is:

And so, we have come to the end of our lesson on diagonalization matrix methods. Do not forget to visit the links provided whenever you need a review or want some more practice.

### Diagonalization

#### Lessons

An $n \times n$ matrix $A$ is diagonalizable if and only if $A$ has $n$ linearly independent eigenvectors.

If you have $n$ linearly independent eigenvectors, then you can use the formula

$A=PDP^{-1}$

where:
The columns of $P$ are the eigenvectors
The diagonal entries of $D$ are eigenvalues corresponding to the eigenvectors
$P^{-1}$ is the inverse of $P$

To see if a matrix is diagonalizable, you need to verify two things
1. There are n linearly independent eigenvectors
2. $AP=PD$

Useful fact: If $A$ is an $n \times n$ matrix with $n$ distinct eigenvalues, then it is diagonalizable.
• Introduction
Diagonalization Overview:
a)
The Formula $A=PDP^{-1}$
• Why is it useful?
• Finding High Powers of $A$

b)
How to Diagonalize a Matrix
• Calculate the eigenvalue
• Find the eigenvectors
• Combine the eigenvectors to create $P$
• Use the eigenvalues to create $D$
• Find $P^{-1}$

c)
How to See if a Matrix is Diagonalizable
• Finding the basis of each eigenspace
• Create a Matrix $P$ and Matrix $D$
• Check if $AP=PD$

• 1.
Computing a Matrix of High Power
Let $A=PDP^{-1}$, then compute $A^4$ if

• 2.
Determining if a Matrix is Diagonalizable
Is the following matrix diagonalizable?

• 3.
Is the following matrix diagonalizable?

• 4.
Diagonalizing the Matrix
Diagonalize the following matrix.

• 5.
Proof relating to Diagonalization
Show that if A is diagonalizable and invertible, then so is $A^{-1}$.