<s>[INST] What is wrong with this projection onto two basis vectors? Given
\begin{align}
b_1 &= \begin{bmatrix} 2 \\ -1 \end{bmatrix} \\
b_2 &= \begin{bmatrix} 1 \\ 3 \end{bmatrix} \\
v &= \begin{bmatrix} 3 \\ 2 \end{bmatrix}
\end{align}
it is clear that
\begin{align}
v &= b_1 + b_2 \\
&= \begin{bmatrix} b_1 & b_2 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix}
\end{align}
However, I want to compute the vector $\begin{bmatrix} 1 \\ 1 \end{bmatrix}$ manually using projections. I know that
$$
v = \left(v \cdot \frac{b_1}{||b_1||}\right)\frac{b_1}{||b_1||} + \left(v \cdot \frac{b_2}{||b_2||}\right)\frac{b_2}{||b_2||}
$$
and so I expect that
\begin{align}
v \cdot \frac{b_1}{||b_1||^2} &= 1 \\
v \cdot \frac{b_2}{||b_2||^2} &= 1
\end{align}
However, what I get instead is
\begin{align}
v \cdot \frac{b_1}{||b_1||^2} &= \begin{bmatrix} 3 & 2 \end{bmatrix} \begin{bmatrix} \frac{2}{5} \\ \frac{-1}{5} \end{bmatrix} \\
&= \frac{4}{5} \\
v \cdot \frac{b_2}{||b_2||^2} &= \begin{bmatrix} 3 & 2 \end{bmatrix} \begin{bmatrix} \frac{1}{10} \\ \frac{3}{10} \end{bmatrix} \\
&= \frac{9}{10}
\end{align}
Where am I going wrong?
 [/INST] The flaw lies in the fact that equation $v = \left(v \cdot \frac{b_1}{||b_1||}\right)\frac{b_1}{||b_1||} + \left(v \cdot \frac{b_2}{||b_2||}\right)\frac{b_2}{||b_2||}$ is valid only when $b_1$ and $b_2$ are orthogonal. (It also requires $v$ to be in the span of $\{b_1,b_2\}$, although that is satisfied here.)
Side note: I recommend against writing things like $b_1 + b_2
= \begin{bmatrix} b_1 & b_2 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix}$, because it will lead to confusion about when matrix multiplication is and isn't valid. Multiplying by $\begin{bmatrix} 1 \\ 1 \end{bmatrix}$ happens to be a proxy for adding two real numbers, but that doesn't mean it should be used as a proxy for adding any two mathematical objects.
</s>