Given eigenvalues $\lambda_1 = 1$, $\lambda_2 = 4$ with corresponding eigenvectors
\[
v_1 = \begin{pmatrix}1 \\ -1\end{pmatrix}, \quad
v_2 = \begin{pmatrix}2 \\ 1\end{pmatrix}
\]
Form the matrix $P$ using eigenvectors as columns:
\[
P = \begin{pmatrix}1 & 2 \\ -1 & 1\end{pmatrix}
\]
Form the diagonal matrix $D$:
\[
D = \begin{pmatrix}1 & 0 \\ 0 & 4\end{pmatrix}
\]
We use the formula:
\[
M = P D P^{-1}
\]
Step $1:$ Compute $P^{-1}$
\[
\det(P) = (1)(1) - (2)(-1) = 3
\]
\[
P^{-1} = \frac{1}{3}
\begin{pmatrix}
1 & -2 \\
1 & 1
\end{pmatrix}
\]
Step $2:$ Compute $PD$
\[
PD =
\begin{pmatrix}1 & 2 \\ -1 & 1\end{pmatrix}
\begin{pmatrix}1 & 0 \\ 0 & 4\end{pmatrix}
=
\begin{pmatrix}1 & 8 \\ -1 & 4\end{pmatrix}
\]
Step $3:$ Compute $M = PDP^{-1}$
\[
M =
\begin{pmatrix}1 & 8 \\ -1 & 4\end{pmatrix}
\cdot
\frac{1}{3}
\begin{pmatrix}1 & -2 \\ 1 & 1\end{pmatrix}
\]
\[
M = \frac{1}{3}
\begin{pmatrix}
1 + 8 & -2 + 8 \\
-1 + 4 & 2 + 4
\end{pmatrix}
=
\frac{1}{3}
\begin{pmatrix}
9 & 6 \\
3 & 6
\end{pmatrix}
\]
\[
M =
\begin{pmatrix}
3 & 2 \\
1 & 2
\end{pmatrix}
\]
Final Answer: $
\boxed{
M =
\begin{pmatrix}
3 & 2 \\
1 & 2
\end{pmatrix}
}$
$\underline{\textbf{Alternate Solution :}}$
$AX=\lambda X$
Now, let $A=\begin{bmatrix} a & b\\ c & d \end{bmatrix}$
When $\lambda=1$:
$\begin{bmatrix} a & b\\ c & d \end{bmatrix}\begin{bmatrix} 1\\ -1 \end{bmatrix}
=1\begin{bmatrix} 1\\ -1 \end{bmatrix}$
$\therefore a-b=1$ and $c-d=-1$
When $\lambda=4$:
$\begin{bmatrix} a & b\\ c & d \end{bmatrix}\begin{bmatrix} 2\\ 1 \end{bmatrix}
=4\begin{bmatrix} 2\\ 1 \end{bmatrix}$
$\therefore 2a+b=8$ and $2c+d=4$
Solving simultaneously, we get:
$a-b=1$
$2a+b=8$
Adding, $3a=9 \Rightarrow a=3$
So, $b=2$
Also,
$c-d=-1$
$2c+d=4$
Adding, $3c=3 \Rightarrow c=1$
So, $d=2$
Hence,
$A=\begin{bmatrix} 3 & 2\\ 1 & 2 \end{bmatrix}$