Find the point on the line $y = 2x + 1$ that is closest to the point $(5, 2)$? The question is: Find the point on the line $y = 2x + 1$ that is closest to the point $(5, 2)$.
I know the high (or middle) school method. Create a line that is perpendicular to this line, so the slope will be $-1/2$. Then the intersection is the answer.
But I meet this question from a linear algebra textbook. I want to use projection onto a line method. Projecting vector $b$ onto vector $a$ with the error $e=b-\hat{x}a$.
Thus, $a \cdot (b-\hat{x}a)=0$ or $a\cdot b-\hat{x}a\cdot a=0$.
Thus, $\hat{x}=\frac{a\cdot b}{a\cdot a}$
But the problem is that here $a$ and $b$ are pure vectors. My question is given a specific line. Then I don't know how to do with it.
 A: Pick a point on the line, such as $(0,1)$. The vector joining $(0,1)$ to $(5,2)$ is their difference, $(5,1)$. We need to project this in the direction of the line, which is given by $(1,2)$ (to wit, the parametric equation is $L(t)=(0,1)+t(1,2)$). This projection is $$\frac{(5,1)\cdot (1,2)}{(1,2)\cdot (1,2)}(1,2) = \frac{7}{5}(1,2) = \left(\frac{7}{5},\frac{14}{5}\right).$$We obtain the point in the line which is closest to $(5,2)$ by adding this vector to the point $(0,1)$. Thus the point in the line which is closest to $(5,2)$ is $$\left(\frac{7}{5},\frac{19}{5}\right).$$
A: Let the point on the line which is closest to (5, 2) be $(x, 2x + 1)$.
Let a be a vector from (0,1) to $(x, 2x + 1)$, so a $= (x, 2x).$
Let b be a vector from (2,5) to $(x, 2x + 1)$, so b $= (x-5, 2x-1).$
a $\cdot$ b = 0$ (since a and b must be perpendicular to each other)
$x(x-5) + 2x(2x - 1) = 0$
$5x^2 - 7x = 0$
$x = 0$ or $x = \frac{7}{5}$
But $x \neq 0$ so $x = \frac{7}{5}$
Sub $x = \frac{7}{5}$ into $y = 2x + 1$ to get $y = \frac{19}{5}$.
A: Calculus solution:
Let d be the distance. the point on line is where it is tangent to a circle with radius d and center (5, 2) and we can write:
$d=\sqrt{(x-5)^2+(y-2)^2}=\sqrt{(x-5)^2+(2x+1-2)^2}=\sqrt{5x^2-14x+26}$
Taking derivative and equating to 0 we get:
$x=\frac 7 5$
$y=\frac {19}5$
