# Simple Question

1. Feb 4, 2008

### Gear300

This is sort of a simple question.

If there is a point P near a function F(x), then, so long as F(x) is continuous, the shortest distance between P and F(x) would be along a line connecting P and F(x), in which it is perpendicular to the tangent of F(x) at the point of intersection.

Is this statement valid?

2. Feb 4, 2008

### sutupidmath

What do you think?

3. Feb 4, 2008

### Gear300

seems logical...or was that just a rhetorical question?

4. Feb 4, 2008

### qspeechc

Are you saying that the line of shortest distance will be perpendicular, or the perpendicular will be the shortest? The former seems correct to me, but not the latter.

5. Feb 4, 2008

### HallsofIvy

Staff Emeritus
First of all, I have no idea what you mean by point being near a function! I assume you mean near the graph of the function but it is interesting that just defining "near" in this case requires that you know the answer to your question! Fortunately, it is not necessary to assume "near". It is easy to show that the shortest distanced from a point to a line is along the perpendicular from that point to that line. If a line from a point to a curve gives a 'local' minimum, then it must be perpendicular to the tangent line at the point where it meets the curve and so "perpendicular to the curve" since that is defined as "perpendicular to the tangent line".

For the global problem we have to be a little more careful! For example, suppose f(x) is defined by f(x)= x2- 4 if $-2\le x\le 2$ and not defined for other values of x (the graph is the parabola with vertex at (0,-4) and x-intercepts (-2,0) and (0,2) but not extending beyond x=-2 or x= 2). If p= (0, 2), then the nearest points on the graph to p are (-2, 0) and (0, 2) but the lines from p to those are not perpendicular to the graph. If we were to define f(x)= x2- 4 only for -2< x< 2, there wouldn't even be a "shortest distance"!

If you are talking about a graph without endpoints, which I suspect is what you intend, then all "global minima" are "local minima" and so are along lines perpendicular to the graph.

6. Feb 5, 2008

### qspeechc

OK, assume the function is f(x). A general point on the function is (x, f(x)). So the gradient of the tangent at a general point is f'(x). Let the point be P(a, b). Now the distance d from P to the function is:
d = sqrt[(x-a)^2 + (f(x)-b)^2]
Now we want to minimise this distance. It is easier to minimise the square of the distance. We can do this because distance is positive. So minimise the square distance by setting its derivative =0, thus:
2(x-a) + 2.f'(x)[f(x)-b]= o
f'(x)[f(x)-b]= -(x-a)
f(x) = -(x-a)/f'(x) +b

So the point on the function f(x) that minimises the distance is (x, -(x-a)/f'(x) +b)
So the gradient from this point on the function to the point P is:
gradient = delta y/delta x = [-(x-a)/f'(x) + b -b]/[x-a] = -1/f'(x)

Thus we have proved they are perpendicular.

7. Feb 5, 2008

### HallsofIvy

Staff Emeritus
Yes, if the minimum occurs where the derivative is 0. That's the proviso I mentioned above.

8. Feb 5, 2008

### qspeechc

Do you mean a minimum can occur where the derivative is not zero? This can only happen on closed intervals, am I correct? Oh yes, I guess you are correct, then, but I don't think the question warranted that, but yes, it was not stipulated explicitly in the question.

9. Feb 5, 2008

### Gear300

I see, I see...interesting. Makes sense. Thanks.

Last edited: Feb 5, 2008
10. Feb 5, 2008

### HallsofIvy

Staff Emeritus
Depends upon exactly what the original question you are answering said!

Does not require that F(x) be defined for all x and so the example I gave before is a counterexample.

In fact, a simple counterexample where the graph is defined for all x just occured to me:

Let F(x)= |x| and p= (0,-1). The shortest line from p to the graph of F is the line segment from p= (0,-1) to to (0,0) and that is not perpendicular to the graph.

If F(x) is differentiable (not just continuous) and the graph of F has no endpoints, then the shortest line segment from p to the graph of F must be perpendicular to the graph.

11. Feb 5, 2008

### qspeechc

I don't really like the absolute value function- it just feels so contrived :tongue: