Calculus – Distance Between e^x and ln(x) Using Tangent/Normal Method

calculus-of-variationsexponential functionfunctionsgraphing-functions

I have been trying to find the shortest distance between $f(x)=e^x$ and $g(x)=\ln(x)$.

All methods I have seen include taking the $y=x$ line as the mirror and find a point on both curves which have same slope as the mirror ($1$ in this case).

Now this method is working only because it is a very specific case as the functions are inverse of each other. The general method would be to find a common normal between the two curves and calculate the distance from where the normal intersects them.

I am trying to apply this method for the given question but am getting unexpected results.

First I found derivatives for both curves, took their reciprocals, and multiplied them by a minus sign to get the slope of the normal:

$m_{f(x)normal}=-\frac{1}{e^x}$

$m_{g(x)normal}=-x$

Now, both these slopes must be equal in case of a common normal.

But equating them yields:

$xe^x=1$

This is far from the actual answer of $x=1$ and $x=0$ where the normal intersect the curves.

Where am I going wrong?

Best Answer

The slopes you have computed for the normal for each curve are correct, but it is not always necessary that they are equal for the same value of $x$.

It must be the case that for some $x_1$, the slope of the normal at a point $(x_1, e^{x_1})$ on the curve $y=e^x$ is $-\frac{1}{e^{x_1}}$, which is equal to $(-x_2)$ which is the slope of the normal at another point $(x_2,\ln(x_2))$ on the curve $y= \ln x $.

Proceeding from this premise, we write the equations for the normal for $y=e^x$ and $y=\ln x$:

$$y-e^{x_1} = -\frac{1}{e^{x_1}}\cdot (x-x_1)$$

$$ y - \ln(x_2) = -x_2 \cdot (x-x_2)$$

Now, since these two equations represent the same normal, we equate the coefficients of $y$, $x$ and the constants. We obtain:

$$ 1 = 1$$

$$-\frac{1}{e^{x_1}} = -x_2 \tag1$$

and

$$ \frac{x_1}{e^{x_1}} + e^{x_1} = x_2^2 + \ln(x_2) \tag2$$

Using equation $(1)$, we rewrite rquation $(2)$ as:

$$ x_1 x_2 + \frac{1}{x_2} = x_2^2 + \ln(x_2)$$

From this, you can see that the values $x_1=0$ and $x_2=1$ satisfy the equations.

Related Question