Point in $e^x$ that is closest to a line I have a function $$f(x) = e^x$$
And a line $$y = \frac{x}{a}-1$$
The $y$-coordinate of a point on $f(x)$ that is closest to the line mentioned above, is $\frac{1}{e}$.
I thought about two options:


*

*Finding the tangent to the point given in the graph and then find a function of distance between both lines with $d = \frac{|C_1-C_2|}{\sqrt{A^2+B^2}}$. However, I can't know if the tangent and the line are parallel.

*Finding the distance between $(x_1,e^{x_1})$ and $(x_2, \frac{x_2}{a}-1)$.


In both cases I would find the derivative of this distance function, plug in $x = -1$ where the derivative equals $0$, and find $a$. However, I don't seem to find something good from both ways.
I know the point they're talking about is $(-1, \frac{1}{e})$, but I think I need to find first the purpose function (distance) and then plug in $x=-1$ as I said before.
I know that the line that connects between the point and the line is perpendicular to the line (that's how you find the shortest distance).
Is there something I'm missing? Any help please?
 A: We measure minimum distances from one curve with domain $\mathbb{R}$ to another with the same domain, that do not intersect, by looking at the normals of both curves, and lining them up, if we can. Just as the minimum distance from one line with domain $\mathbb{R}$ to another nonintersecting line with the same domain is in some sense a "perpendicular" distance. 
If the normals are parallel in two dimensions, then it must be that the tangents are parallel.
So we must look on the curve $y=e^x$ and see when $y'=e^x=\frac{1}{a}$ because $\frac{1}{a}$ is the derivative of the other function no matter what value of $x$ . That is when $x=\ln (\frac{1}{a})=-\ln a$. 
So we know the closest point to the line is $(-\ln a, \frac{1}{a})$. Now use your distance formula, from point to line, to find the distance. 
A: Your approach is correct. You want to find the distance between $(x,e^{x})$ and $(y,\frac{1}{a}y-1)$.
This gives $z^2=\left(e^x-\frac{1}{a}y+1\right)^2+(x-y)^2$
If you know how to find the maxima and minima of a 3-d function, then you can solve the problem from here.
