# Diagonalising a matrix

## Main Question or Discussion Point

Hey guys, i'm having trouble trying to understand how the diagonalised matrix is produced

e.g.

A =
1 | 3 | 0
3 | -2 |-1
0 | -1 | 1

I've calculated the eigenvalues to be 1, -4, 3

My question is, how do we know that
D =
1 | 0 | 0
0 | 3 | 0
0 | 0 | -4

and not any other combination of 1, 3, -4 along the diagonal, or does it make no difference?

Last edited:

HallsofIvy
Homework Helper
I'm not sure I understand your question. Why does "diagonalize a matrix" mean to you?

Using the eigenvalues to form the main diagonal of a matrix, you form D. Then determine the eigenvectors corresponding to those eigenvalues to create P (remember to keep the eigenvectors in order corresponding to the entries in D). Then invert P to find P^-1. This should yield the equation A=PDP^-1

Good Luck!

Using the eigenvalues to form the main diagonal of a matrix, you form D
So it doesn't matter the order in which you order the eigenvalues? Cos that would produce a slightly different diagonal

rock.freak667
Homework Helper
So it doesn't matter the order in which you order the eigenvalues? Cos that would produce a slightly different diagonal
when you get the e.values and their corresponding e.vectors, to form D you would have to put the e.vectors in the corresponding column. That is, if you put the first e.value in the first column, you put the e.vector in that same column for P.

when you get the e.values and their corresponding e.vectors, to form D you would have to put the e.vectors in the corresponding column. That is, if you put the first e.value in the first column, you put the e.vector in that same column for P.
I understand this but is there more than one answer for D?

Using my example in the 1st question i could get

1 | 0 | 0
0 | 3 | 0
0 | 0 | -4

or

1 | 0 | 0
0 | -4 | 0
0 | 0 | 3

etc..simply by assigning a different first eigenvalue from either 1, 3, or -4

rock.freak667
Homework Helper
I understand this but is there more than one answer for D?

Using my example in the 1st question i could get

1 | 0 | 0
0 | 3 | 0
0 | 0 | -4

or

1 | 0 | 0
0 | -4 | 0
0 | 0 | 3

etc..simply by assigning a different first eigenvalue from either 1, 3, or -4
yes there is, but the matrix P would change as well. In the first matrix the e.value of 3 is in column 2, so in P, you'd put the e.vector that corresponds to 3 as the column 2.

for the 2nd matrix, 3 is in the 3rd column,so you'd put the e.vector for 3 in the 3rd column

Ok thanks cos i was getting worried i wasn't getting the same answers for P and D that is given in one of the tutorial books that i'm using where my answers just differed by column arrangements

Hey, I have a similar question to this but the posts here doesn't seem to solve my problem. I need to solve a matrix to to a certain power by using the diagonal matrix. It seems with different arrangement of eigenvalues gives me different answers. Out of the different arrangment they seem to be only one arrangement that gives an answer that correspond to the value achieved through matrix multiplication. But I can't see the pattern to identify the correct pattern for the general matrix. I tried to arrange it from the smallest to the largest but it sometimes work and sometimes it doesn't.

Is there an actual proper way to arrange eigenvalues and eigenvectors to form the diagonal matrix and the vector which contains the eigenvectors?

I think I should have given an example.
Let A be
l 1 -2 l
l -2 4 l
with Eigenvalue 0 and 5
if 0 I set it as
l 2 l
l 1 l

if 5 I set it as
l 1 l
l -2l

if I set P
l 2 1l
l 1 -2l
with D as the diagonal matrix then A^3= (P^-1)D^3P
A^3 =
l 25 -50l
l-50 100l
this is correct if u multiple A.A.A explicitly.

But if I set P
l1 2l
l-2 1l
then A^3 becomes
l25 50l
l50 100l

HallsofIvy
Homework Helper
Then you are doing a multiplication wrong somewhere.
If A is a diagonalizable matrix so that A= PDP-1 for some diagonal matrix D and invertible matrix P, then An= (PDP-1)(PDP-1)...(PDP-1) (n times)= PDnP-1.

Choosing different orders for the eigenvalues will give different diagonal matrices D and different P but for all of those PDnP-1 will be the same.

If you use
$$P= \left[\begin{array}{cc}1 & 2 \\-2 & 1\end{array}\right]$$
$$P= \left[\begin{array}{cc}1 & 2 \\-2 & 1\end{array}\right]$$
you will also need to swap the rows in D, using
$$D= \left[\begin{array}{cc}5 & 0 \\0 & 0\end{array}\right]$$
rather than
$$D= \left[\begin{array}{cc}0 & 0 \\0 & 5\end{array}\right]$$
Did you do that?

Yeah I swapped P's columns and changed D. I first also thought I did some multiplication error but then I tried the multiplication with Maple and it seems no different to the paradoxical conclusion that I came to.

oh wait, I think I have understood why my multiplication doesn't work. Just now, I used your forumale of PD^nP^-1 instead of P^-1D^nP which my lecturer gave to me. It turns out your forumale actually works.

Thanks a lot, now I can finally be relieved for my maths exam.

HallsofIvy
Remarkable, isn't it! 