# Least Square Solutions

Find the closest point or points to b $= (-1,2)^T$ that lie on the line $x + y = 0$ and also find the line $2x + y = 0$.

The question is obviously elementary but I do not know how to set it up properly to find the points. I know for $x + y = 0$ we have a slope of -1 going through the origin and hence the closest point there is $(-\frac32, \frac32)$, but how can I set it up so that I can find that point. Also, I already know how to do it using differentiation, I only want to know how to do it algebraically using $Ax = b$ form.

-

Note that $x + y = 0$ describes a slope in the direction of $\left( \begin{matrix} 1 \\ -1 \end{matrix} \right)$. We want to find the point $c \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)$ on this line such that $\left( \left( \begin{matrix} -1 \\ 2 \end{matrix} \right) - c \left( \begin{matrix} 1 \\ -1 \end{matrix} \right) \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right) = 0$. Solving for $c \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)$ we get: $\frac{\left( \begin{matrix} -1 \\ 2 \end{matrix} \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)}{\left( \begin{matrix} 1 \\ -1 \end{matrix} \right) \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right)} \cdot \left( \begin{matrix} 1 \\ -1 \end{matrix} \right) = \left( \begin{matrix} -\frac{3}{2} \\ \frac{3}{2} \end{matrix} \right)$

-
Thank you very much Sean! I understand now with your help. – diimension Oct 14 '12 at 3:28