# finding the closest distance between a point a curve

consider the curve $y=x^2$

what are the points on the curve that are the closest to the point $(1,0)$

using calculus I got the two points but what is the connection between normals and the closest distance to a curve from a point

is it that drawing normals from 1,0 and seeing where it meets the curve gives the points closest to it - although a normal from 1,0 does go through the origin even though the origin is not the closest to the curve

please explain these observations

• an arbitrary point on the curve is of the form $(x,x^2)$. Find the distance between this point and $(1,0)$ so you will have a function of $x$ that determines the distance. Find its minimum (by differentiating the function) Oct 10, 2014 at 22:07
• The line from $(0,1)$ to $(x,y)$ will be normal to the curve at $(x,y)$ if and only if $(x,y)$ is a local minimum, maximum, or inflection point of the distance function. In your example, the origin is a local maximum. (I'm assuming you meant the points on the curve closest to $(0,1)$?) Oct 10, 2014 at 22:08
• @mjqxxxx why is it that this happens - a normal at (x,y) if and only if it is a local min, max or inflection point Oct 11, 2014 at 12:29

You may construct a cirle with centre in $A$ and radius $R$. It has the following equation: $$(x-x_a)^2 + (y-y_a)^2 = R^2$$ The lowest $R$ for which this circle intersects $f(x)$ is the solution of your problem. So you have to substitute $y$ in the equation above with expression for $f(x)$ and solve resulting equation for $x$. Then you have to find the lowest $R > 0$ for which exists at least one solution. This value for $R$ will be the answer.

Distance from point (1,0) is the function: $$d((x,y)) = \sqrt{(x-1)^2+(y-0)^2}$$ It's a function $(x,y) \to (d)$.

Now your curve is a function $(x) \to (x,y)$, so that $$f(x) = (x,x^2)$$.

Now you can use function composition to combine them to $d(f(x))$ to find distance of each point.

$$d(f(x)) = \sqrt{(x-1)^2+(x^2-0)^2}$$. Now your task is to find x with minimum value. Minimum value is found by derivative is zero,

$$D(d(f(x))) = {{2x^3+x-1}\over{\sqrt{x^4+x^2+2x+1}}} = 0$$ Thus we're left with: $2x^3+x-1=0$, which gives us $x\approx 0.58975$.

Thus the nearest point is $(x,y)= (x,x^2) \approx (0.58975, 0.3478050625)$.

The closest distance is $d(f(0.58975)) \approx 0.537841$.

$$(1)\quad{y_1-f(x)\over x_1-x}={-1\over f'(x)}$$ Equation (1) is based on the fact that if $f(x)$ has some slope value 'm' at some point (x,y) on $f(x)$, then it also has a slope perpendicular to 'm' at the same point, and given by the negative reciprocal of 'm'.

If we let $f(x)=x^2$, then $f'(x)=2x$.

When $x_1=1$ , and $y_1=0$ , we have:

$${0-x^2\over 1-x}={-1\over 2x}$$

Clearing both sides of fractions and moving everything over to the left hand member we obtain:

$2x^3+x-1=0$

Solving for x we get: $x\approx0.589755...$

Since it's implied that $y=f(x)$, we can write $x=x_2\approx0.589755...$

and $f(x_2)=y_2\approx0.347810...$

We know that the point $(x_2,y_2)$ is on $f(x)$ because it satisfies the conditions of equation (1). We also know that the shortest distance from our known point $(x_1,y_1)$ not on $f(x)$, will lie on the normal line emanating from the point $(x_2,y_2)$. Consequently, the shortest distance is:

$\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\approx0.537841...$

As correctly ThePortakal mentioned, let $(x,y)\in C$ where $C$ is the curve. Then $\|(x,y)-(1,0)\|_2=\sqrt {(x-1)^2+y^2}=\sqrt {(x-1)^2+(x^2)^2}$ because $y=x^2$. Set $f(x)=(x-1)^2+x^4$ which is differentiable. Find it's minimum let's say in $x_0$ with $f(x_0)=a$ and then the minimum distance would be $\sqrt a$.