I have to diagonolize a matrix A \begin{bmatrix}0&-3&-1&1\\2&5&1&-1\\-2&-3&1&1\\2&3&1&1\end{bmatrix}
I do $det(A-λ)=0$ and I get $λ_{1}=1$, $λ_{2}=2$, $λ_{3}=2$, $λ_{4}=2$
So possible diagonal matrix looks like: \begin{bmatrix}1&0&0&0\\0&2&0&0\\0&0&2&0\\0&0&0&2\end{bmatrix}
Then I look for eigenvectors for $λ=1$ and $λ=2$
I get:
For $λ=1$: $(1, -1, 1,-1)$
For $λ=2$: $(1, 0, 0, 2)$, $(0, 1, 0, 3)$, $(0, 0, 1, 1)$
I create matrix P made of eigenvectors (as columns):
\begin{bmatrix}1&1&0&0\\-1&0&1&0\\1&0&0&1\\-1&2&3&1\end{bmatrix}
And when checking if the diagonal matrix is correct by using formula:
$A=P^{-1}*D*P$
I don't get the correct answer :(
Can someone check my steps? I tried to do that a few times but still I am not getting the correct result.
Your computations are totally correct, but you made a tiny mistake in the order of the decomposition of $A$. It has to be $A = PDP^{-1}$.
Just remind yourself, what if A was e.g. symmetric, since then one could find orthogonal transformations and there you immediately see, that the most right matrix has to contain the eigenvectors in a horizontal manner and the left matrix has to contain them standing.