Eigenvalues and eigenvectors - putting in the form $PDP^{-1}$ Okay so I just need some help towards the end, if possible. I have a $2 \times 2$ matrix that looks like this: 
$$
\begin{bmatrix}
18 & 10 \\
-30 & -17
\end{bmatrix}
$$
I need to find all eigenvectors and eigenvalues corresponding to it - I've done that, I think. I got two eigenvalues which are $3$ and $-2$. Then I tried to express this matrix in the form $PDP^{-1}$. I came up with:
$$
P =
\begin{bmatrix}
2 & 1 \\   
-3 & -2
\end{bmatrix}
$$
I'm not sure if D should be:
$$
\begin{bmatrix}
3 & 0 \\
0 & -2
\end{bmatrix}
$$
or if the $-2$ and $3$ should be switched about. I've tried both anyway.
$$
P^{-1} = 
\begin{bmatrix}
2 & 1 \\
-3 & -2
\end{bmatrix}
$$
I try to multiply them together to check that I get the same as my original matrix, but I seem to get the wrong values (but tantalisingly close). 
For example, with the three above I get $(18 \hspace{.15cm} 10)$ for $a$ and $b$, which is good but for $c$ and $d$ I get, ($-18+12=-6  -9+8$=-1) respectively, though I need -30 and -17 in those positions.. 
I must have made a mistake along the way but am not sure which it is - any clues? Thanks.
 A: The eigenvalues of your matrix are indeed $3$ and $-2$.
You must have also computed the eigenvectors associated with each eigenvalues and found them to be:
$$v_{3} = \begin{bmatrix} -2 & 3 \end{bmatrix}^T \quad ; \quad v_{-2} =\begin{bmatrix} -1 & 2 \end{bmatrix}^T.$$
(the subscript represents the eigenvalue to which the eigenvector is associated with)
The way you write your matrix $P$ is directly related to the way you want to write your matrix $D$.
If you want to write $D = \begin{bmatrix}
3 & 0\\ 
0 & -2
\end{bmatrix}$
then the first column of $P$ will be $v_3$ and the second one will be $v_{-2}$, i.e., $P = \begin{bmatrix}
-2 & -1\\ 
3 & 2
\end{bmatrix}$, in which case
$P^{-1} = \begin{bmatrix}
-2 & -1\\ 
3 & 2
\end{bmatrix}.$ 
If you want to write $D = \begin{bmatrix}
-2 & 0\\ 
0 & 3
\end{bmatrix}$
then the first column of $P$ will be $v_{-2}$ and the second one will be $v_3$, i.e. $P = \begin{bmatrix}
-1 & -2\\ 
2 & 3
\end{bmatrix}$, in which case
$P^{-1} = \begin{bmatrix}
3 & 2\\ 
-2 & -1
\end{bmatrix}.$ 
A: You must have made a mistake when multiplying the matrices at the end, for your matrices $P,P^{-1},D$ are all correct.
Got it - should be $-18-12$, not $-18+12$. Similarly, the other entry should be $-9-8$. This way you get $-30$ and $-17$.
A: you have $\begin{bmatrix}
18 & 10 \\
-30 & -17
\end{bmatrix} \pmatrix{2\\-3} = 3\pmatrix{2\\-3}\tag 1$
  and $\begin{bmatrix}
18 & 10 \\
-30 & -17
\end{bmatrix} \pmatrix{1\\-2} = 3=-2\pmatrix{1\\-2}\tag 2$
writing $(1)$ and $(2)$ as matrix equation you get 
$$ \begin{bmatrix}
18 & 10 \\
-30 & -17
\end{bmatrix} \begin{bmatrix}
2 & 1 \\
-3 & -2
\end{bmatrix} = 
\begin{bmatrix}
2 & 1 \\
-3 & -2
\end{bmatrix}\begin{bmatrix}
3 & 0 \\
0 & -2
\end{bmatrix} .
$$ 
