[Math] Find a point on the line: $y=2x-5$ that is the closest to $P(1,2)$

linear algebra

This is our line: $f(x)=2x-5$

I have to find a point on this line that is the closest to the point $P(1,2)$. How do I go on about solving this? Should I use derivative and distance from the point to the line? I've done this so far:

$d\to$ distance between $P(1,2)$ and $f(x)$

$d= \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$

But how do I get the $x_2,y_2 $ from $f(x)$?

Best Answer

Actually, there is a simpler way. Since $f$ is a line, the point $P$ and the point on $f$ closest to $P$ will define a line perpendicular to $f$. That means that you can get the equation for the line with slope $m=-\frac{1}{2}$ (the inverse of the reciprocal of the slope of $f$) through the point $(1,2)$, and then find the intersection of that line and $f$.

Related Question