<s>[INST] How do I find this matrix? a) Let $\mathbf{P}$ be the $2\times 2$ matrix that projects vectors onto $\mathbf{u} = \begin{pmatrix}2\\ -1 \end{pmatrix}$. That is,
$\mathbf{P} {v} = \operatorname{proj}_{u} ({v}) = \text{Projection of $\mathbf{v}$ onto $\mathbf{u}$}.$

Using the geometric meaning of the matrix and the picture, find
$\mathbf{P} \begin{pmatrix}2 \\ -1 \end{pmatrix} \text{ and } \mathbf{P} \begin{pmatrix}1 \\ 2 \end{pmatrix} .$
The answer to part a)
\begin{align*} 
\mathbf{P} \begin{pmatrix}2 \\ -1 \end{pmatrix} = \boxed{\begin{pmatrix} 2 \\- 1\end{pmatrix}}, \mathbf{P} \begin{pmatrix}1 \\ 2 \end{pmatrix} = \boxed{\begin{pmatrix} 0 \\ 0\end{pmatrix}}.
\end{align*}
b) Now, let $\mathbf{P}$ be the $2\times 2$ matrix that projects vectors onto $\mathbf{u} = \begin{pmatrix}2\\ -1 \end{pmatrix}$. That is,
$\mathbf{P} {v} = \operatorname{proj}_{{u}} ({v}) = \text{Projection of $\mathbf{v}$ onto $\mathbf{u}$}.$Use your answers from part (a) to figure out $\mathbf{P}$.
I set $P = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ and I have $\begin{pmatrix} a & b \\ c & d \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2 \\ -1 \end{pmatrix}.$ How should I continue?
 [/INST] You should set $(x,y)^T=(2,-1)^T$ as you did for your answer in part (a). This will not give you the values you seek, but will produce simultaneous equations for them. By repeating the same process, but for the other values obtained at the end of part (a), you will arrive at the values of $a,b,c,d$ and therefore $P$.
</s>