# Homework Help: Diagonalizing Matrices

1. Apr 30, 2012

### rtw528

This isn't really a homework question, but it is relevent to heling me finish my homework.
When you are diagonalizing a matrix, how do you know what order to put the eigenvectors in.
One of my homework problems is with the eigenvalues 1, 2, and 4.
[-1]
[1] is the matrix corresponding to the eigenvalue 1.
[1]

[1]
[0] is the matrix corresponding to the eigenvalue 2
[0]

[7]
[-4] is the matrix corresponding to the eigenvalue 4.
[1]

The answers in the back of the book give the diagonalized matrix as
[7 1 -1]
[-4 0 1]
[2 0 1]

2. Apr 30, 2012

### Staff: Mentor

The matrix above is NOT the diagonal matrix - it is the matrix P, the one with the eigenvectors as columns. The order in which you put the eigenvectors doesn't matter except that it affects how the eigenvalues will appear in the diagonal matrix.

For your example, the columns in P correspond to the eigenvalues 4, 2, and 1, respectively. The diagonal matrix will be
$$\begin{bmatrix} 4 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1\end{bmatrix}$$

3. Apr 30, 2012

### HallsofIvy

If the eigenvalues are $\lambda_1$ with eigenvector $v_1$, $\lambda_2$ with eigenvector $v_2$, and $\lambda_3$ with eigenvector $v_3$, then the order in which you use the vectors as columns in matrix "P" will determine the order of the eigenvalues in the diagonal matrix.

That is, if P have columns $v_1$, $v_2$, $v_3$, in that order, then the diagonal matrix will be
$$\begin{bmatrix}\lambda_1 & 0 & 0 \\ 0 & \lambda_2 & 0 \\ 0 & 0 & \lambda_3\end{bmatrix}$$
changing the columns in P changes the order in the diagonal matrix.

For example, if P have columns $v_2$, $v_1$, $v_3$, in that order, then the diagonal matrix will be
$$\begin{bmatrix}\lambda_2 & 0 & 0 \\ 0 & \lambda_1 & 0 \\ 0 & 0 & \lambda_3\end{bmatrix}$$