[Math] proving that the shortest line conntecting a point and a line will be perpendicular to that line

calculusgeometryoptimization

So I have a problem for my final math project that I've been fiddling with for hours without success. I have to use calculus to prove that the shortest line connecting a point to a line will always be perpendicular to the line. Here's what I've got so far

  1. Use the distance formula
  2. take the derivative of it and set it equal to 0
    now heres where I'm confused.. what do I take it in terms of? I know that I have to use this information to find the slope connecting then line, but I don't know how…

Best Answer

Suppose the line is non-vertical and has the equation $y=mx+b$, and let the point be $(x_0,y_0)$. Then the distance from the point to the line is $$d=\sqrt{(x-x_0)^2+(mx+b-y_0)^2}.$$

Since the square root is awkward to work with, we minimize $d^2$ instead.

$$f(x)=d^2=(x-x_0)^2+(mx+b,y_0)^2.$$

Now use the usual procedure with critical points and so on to minimize $f$. Once you find the value of $x$ which minimizes $f$, you can obtain the point on the line which is closest to $(x_0,y_0)$. Of course, from there you can easily find the slope of the line through $(x_0,y_0)$ and the closest point.