# When calculating P, for diagonalization, does the order of eigenvalues matter?

I'm trying to find the value of this matrix, $A = \begin{pmatrix} 1 & 4 \\ 3 & 2\end{pmatrix}$ to the power of $10$.

I've determined (and confirmed on Wolfram) that the eigenvalues are $5$, and $-2$.
I started looking for P by using the eigenvalue $5$, and found the eigenvector $\begin{bmatrix} 1 \\ 1 \end{bmatrix}$.
I did the same for the eigenvalue $-2$, and found eigenvector $\begin{bmatrix} -4 \\ 3 \end{bmatrix}$

I then put these together to get $P: \begin{bmatrix} 1 & -4\\ 1 & 3 \end{bmatrix}$. I followed that by finding $P^{-1}: \dfrac{1}{7} \begin{bmatrix} 3 & 4\\ -1 & 1 \end{bmatrix}$.

The problem is, that $PAP^{-1}$ is not diagonalizing. I checked Wolfram, and I found that the reason is because my $P$ should have been $\begin{bmatrix} -4 & 1\\ 3 & 1 \end{bmatrix}$.

My question is, what is the general rule about what eigenvalue to plug in first and how to arrange the columns of $P$?

-
You have and $P$ and $P^{-1}$ swapped, should be $P^{-1}AP$. – Amzoti Dec 9 '12 at 22:17
If $\Pi$ is a permutation matrix and $\Lambda$ is diagonal, then $\Pi^{-1} \Lambda \Pi$ is also diagonal (with the same, rearranged entries). Hence if $P^{-1} A P = \Lambda$, then $(P \Pi)^{-1} A P \Pi = \Pi^{-1} \Lambda \Pi$, the rearranged diagonal matrix. – copper.hat Dec 9 '12 at 22:40

The problem does not lie in the order of the eigenvalues or the order of the columns of $P$. What should be diagonal is $P^{-1}AP$, not $PAP^{-1}$. The order of the eigenvalues or eigenvectors do not matter, as long as the ordering of eigenvalues is consistent with the ordering of eigenvectors.