The exercise is the following:
It is known that a certain $\small{2\times2}$ matrix $A$ has two eigenvalues:
$\lambda=3$, which has a corresponding eigenvector $v_{3}=(\frac{3}{2};-1)$; and
$\lambda=\sqrt{2}$, which has a corresponding eigenvector $v_{\sqrt{2}}=(-1;1)$.
Calculate $P$, such that $$P^{-1}\cdot A\cdot P=\begin{pmatrix} \sqrt{2} & 0\\ 0 & 3 \end{pmatrix}$$
I know that, if $A=\begin{pmatrix} a & c\\ b & d \end{pmatrix}$, then:
$\begin{pmatrix} a-3 & c\\ b & d-3 \end{pmatrix}\cdot \begin{pmatrix} \frac{3}{2} \\ -1 \end{pmatrix}=\begin{pmatrix} 0 \\ 0 \end{pmatrix}$
$\begin{pmatrix} a-\sqrt{2} & c\\ b & d-\sqrt{2} \end{pmatrix}\cdot \begin{pmatrix} -1 \\ 1 \end{pmatrix}=\begin{pmatrix} 0 \\ 0 \end{pmatrix}$
This way, I obtain $A=\begin{pmatrix} 9-2\sqrt{2} & 9-3\sqrt{2}\\ -6+2\sqrt{2} & -6+3\sqrt{2} \end{pmatrix}$, so now all there's left to do is to try $P=\begin{pmatrix} -1 & \frac{3}{2}\\ 1 & -1 \end{pmatrix}$ and $P=\begin{pmatrix} \frac{3}{2} & -1\\ -1 & 1 \end{pmatrix}$ and check which one gives me the desired diagonal matrix (which, by the way, is the first option)
My question is: isn't there a MUCH easier way to do this?
The simpler way is to note that the eigenvectors of a matrix $A$ are the basis in which the transformation is represented by a diagonal matrix $D$ with the eigenvalues as diagonal elements. And if $$ P^{-1}AP=D $$ than $$ A=PDP^{-1} $$
For the diagonal form
$$D=\begin{pmatrix} \sqrt{2} & 0\\ 0 & 3 \end{pmatrix}$$
the ''basis'' matrix (with, as columns, the corresponding eigenvectors) is
$$ P=\begin{pmatrix} -1 & 3/2\\ 1 & -1 \end{pmatrix}$$
so we can easily find $P^{-1}$ and calculate $A=PDP^{-1}$