[Math] How to find a point on a line closest to a specified point using calculus

calculus

I have a line function that is $y = x + 4$ and I want to find the point on that line that is closest to the point $(1,1)$.

Here is my attempt. $y = x + 4$ so that means $(x, x + 4)$ should be my initial point and $(1,1)$ will be my final point.

I assume I'll need to make use of the distance formula so $\sqrt[2]{(1-x)^2 + (-x-3)^2}$

This is where I'm stuck. I think I need to take the derivative of it, but when I do, I come out with $\frac{1}{2}(4x + 10)^\frac{-1}{2}$ which doesn't seem right especially if I want to set it to $0$.

Best Answer

Hint: Minimizing the distance is equivalent to minimizing the square of the distance. Remove that square root sign. You get a harmless quadratic.

So I would write "equivalently, we minimize the square of the distance $\dots$. "

The calculation can be done without removing the square root sign, but the probability of mechanical error increases markedly.