Say you have the functions f(x) and g(x)
f(x)=x2; g(x)=ln(x)
This is the seemingly easy question (which might need implicit derivatives): What is the minimum distance in any direction between the functions f(x) and g(x)?
The problem is that it is fairly easy to calculate the minimum VERTICAL distance, i.e. you calculate (f-g)'(x)=0 and that is fairly simple. But there
is an absolute minimum distance that belongs to some other line, neither horizontal nor vertical, but of the next equation: r(x)=ax+b
with a and b belonging to the real numbers.
Any ideas?Marvin - 11-10-2014 at 06:23
Does the line of minimum distance always cross the curves at a normal?smaerd - 11-10-2014 at 06:24
edit- oh I re-read your original post and now I see what the question is asking. If I get time today I'll give it a shot and see if I can provide
helpful hints(assuming I get the answer).
[Edited on 11-10-2014 by smaerd]Metacelsus - 11-10-2014 at 11:22
Step 1: Find a formula for the distance of an arbitrary point (x,y) to the curve y = x^2. Use the fact that the vector between (x,y) and the closest
point will be normal to the curve.
Step 2: Plug in the formula y = ln(x)
Step 3: Minimize it.
I don't want to devote a lot of time to this, but I can help. I've solved similar problems before.woelen - 11-10-2014 at 11:33
Solving this problem in principle is not difficult, but in practice you need a lot of (tedious) algebraic manipulations and you certainly need to
numerically estimate the shortest distance.
Proceed as outlined below.
You have two points, one on the curve y=x2 and the other on the curve y=ln(x). You have the freedom to choose two x-coordinates freely.
Let's call them x1 and x2.
Now we have two points (x1, x12) and (x2, ln(x2)). The square of the distance between these two
points equals (x1-x2)2 + (x12-ln(x2))2.
The task which you have left is finding the global minimum of this square distance (you can of course also use the distance, but that makes things
only unnecessarily complex due to the presence of a square root). Finding the minimum of the square distance can be done by computing the partial
derivatives with respect to x1 and with respect to x2 and setting both partial derivates equal to zero. In general, such points
either are (possibly local) minima, or saddle points. In your specific situation there only is one such point and it will be the global minimum. By
means of a rough sketch you can get decent estimates of x1 and x2 near the global minimum. Using Newton-Raphson iteration on the
system of equations of both derivates yields more accurate solutions.
Does the line of minimum distance always cross the curves at a normal ?
I think that was meant as a hint.
The shortest distance between two curves is always the normal line common to both.
It is a unique solution.
The slope of the tangent to each curve is the same , at the point on each curve
that joins the normal line common to both. That means the tangents at those
two points are parallel and the line normal is perpendicular to them. It is also the
solution where the two tangents are farthest apart. All other parallel tangents
have a shorter distance apart and two solutions , one of lesser slope and one
of greater slope.
@ Eddygp
My reasoning up to here is right. While the value of the derivative of X² must
equal the value of the derivative of lnx , each is going to need it's own coordinate
solution of x. Forget what I wrote before. It's been a long time since I did this sort
of thing and it shows.
Now, d'(b)=0 --> you get an answer for b and, since a=1/(2b), you have the value of a.
[Edited on 14-10-2014 by Eddygp]woelen - 15-10-2014 at 00:55
Instead of minimizing the distance, you can use the square of the distance. This still gives a monster, but it has fewer heads than your monster Eddygp - 15-10-2014 at 11:35