<s>[INST] Find $P$ where $P^{-1}AP$ for a given matrix $A$ I am doing a past paper and I have been given a matrix A:
\begin{bmatrix}
    4       & -1 & -3 &  2 \\
    4       & -2 & -4 &  4 \\
    -4       & 4 & 6 & -4  \\
    -6       & 5 & 7 & -4  \\
\end{bmatrix}
and I need to find a matrix $P$ such that $P^{-1}AP$ = 
\begin{bmatrix}
    2       & 0 & 0 &  0 \\
    0       & 2 & 1 &  0 \\
    0       & 0 & 2 & 0  \\
    0       & 0 & 0 & -2  \\
\end{bmatrix}
I'm really not sure how to begin with this question, would anyone be able to help out?
 [/INST] From the given information, we know that matrix A had eigenvalues 2, -2, and 2 is an eigenvalue of multiplicity.
We want to find eigenvectors that are associated with each of these eigenvalues.
find $v$ such that
$(A-\lambda I) v = 0$
$\lambda = 2$
$\begin{bmatrix}
    2       & -1 & -3 &  2 \\
    4       & -4 & -4 &  4 \\
    -4       & 4 & 4 & -4  \\
    -6       & 5 & 7 & -6  \\
\end{bmatrix}v = 0$
With a little bit of trial and error we find 
$\begin{bmatrix} 1\\1\\1\\1 \end{bmatrix}, \begin{bmatrix} -1\\0\\0\\1 \end{bmatrix} $
You might have found different eigenvectors, any two independent vectors in the eigenspace will do.
for the remaining vector we are looking for some vector $w$ such that
$Aw = 2w + v$ where $v$ is one of the the eigenvectors that is associated with the eigenvalue 2.
if such a vector exists then 
$(A-2I) w = v\\ 
(A-2I)^2 w = (A-2I)v = 0$
$(A-2I)^2 = \begin{bmatrix} 0&0&0&0\\-16&16&16&-16\\16&-16&-16&16\\16&-16&-16&16\end{bmatrix}$
Which means that $w$ must be some linear combination of
$\begin{bmatrix} 1\\1\\0\\0\end{bmatrix},\begin{bmatrix} 1\\0\\1\\0\end{bmatrix},\begin{bmatrix} 1\\0\\0\\1\end{bmatrix}$
find some combination of these such that $(A-2I)w$ equals one of the eigenvectors you already have.
$(A-2I)\begin{bmatrix} 1\\0\\1\\0\end{bmatrix} =\begin{bmatrix} -1\\0\\0\\1 \end{bmatrix}$
$A \begin{bmatrix} 1&-1&1\\1&0&0\\1&0&1\\1&1&0\end{bmatrix}= \begin{bmatrix} 1&-1&1\\1&0&0\\1&0&1\\1&1&0\end{bmatrix}\begin{bmatrix} 2&0&0\\0&2&1\\0&0&2\end{bmatrix}$
And I will leave it to you to find the remaining eigenvector and complete the matrix.
</s>