<s>[INST] Finding the orthogonal projection of $(2,1,3)$. $V=\mathbb R^3,u=(2,1,3) $ and $W$={$(x,y,z):x+3y-2z=0$}.
Vectors ortogonal to $W$=Span{$(1,3,-2)$},Vectors on $W$=Span{$(-1,1,1)$}.
So,orthogonal basis is {$(1,3,-2),(-1,1,1)$}.Then,orthonormal basis is 
{$\frac{1}{\sqrt {14}}(1,3,-2),\frac{1}{\sqrt {3}}(-1,1,1)$}.
So orthogonal projection of 
(2,1,3)=$<\frac{1}{\sqrt {14}}(1,3,-2),(2,1,0)>\frac{1}{\sqrt {14}}(1,3,-2)$+$<\frac{1}{\sqrt {3}}(-1,1,1),(2,1,0)>\frac{1}{\sqrt {3}}(-1,1,1)>$
=$\frac{-1}{14}(1,3,-2)+\frac{2}{3}(-1,1,1)=(\frac{-25}{42},\frac{34}{42},\frac{22}{42})$
But it's correct answer is = $\frac{1}{
14}
(29,17,40)$
Where i'm missing?
 [/INST] If $W = \{(x,y,z): x+3y-2z=0\}$, then $x=2z-3y$, and every element of $W$ looks like
$$\left(\begin{array}{c} x \\ y \\ z \end{array}\right)
 \ \ = \ \ \left(\begin{array}{c} 2z-3y \\ y \\ z \end{array}\right)
\ \ = \ \ y\left(\begin{array}{c} -3 \\ 1 \\ 0 \end{array}\right)
+z\left(\begin{array}{c} 2 \\ 0 \\ 1 \end{array}\right)$$
This means that $W$ is spanned by $(-3,1,0)^{\top}$ and $(2,0,1)^{\top}$.
The vector $(-1,1,1)^{\top}$ lies in $W$ - you can check this:
$$\det\left(\begin{array}{ccc}
-1 & -3 & 2 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \end{array}\right) = 0$$
but it's not enough on its own to span $W$ since $\dim W =2$.
</s>