# Find the closest point on $y=\frac{1}{e}x+e^2+1$ to the curve $y=\ln(x)$

I`m trying to find the closest point on $$y=\frac{1}{e}x+e^2+1$$ to the curve $$y=\ln(x)$$

what I tried is to make $\frac{d}{dx}$ to both of them like :
$$\frac{1}{x} = \frac{1}{e} \rightarrow x=e$$ so I insert $x=e$ in $y=\frac{1}{e}x+e^2+1$ and found the point $(e,e^2+2)$ and I want to know if its the right way to do that.
Thanks!

• Jun 10, 2013 at 10:25

An idea: you want the closest point of the form $\,(x\,,\,\log x)\;$ to the line $\frac1ex-y+e^2+1=0\;$ , distance given by the well known formula from anaytic geometry:

$$\frac{|\frac1ex-\log x+e^2+1|}{\sqrt{\frac1{e^2}+1}}=\frac{|x-e\log x+e^3+e|}{\sqrt{e^2+1}}$$

Now you want to minimize the above, which is the same as minimizing the numerator, so differentiating (check the signs of the following according to the sign inside the absolute value!):

$$\pm\left(1-\frac ex\right)=0\iff x=e\;,\;\text{ and the wanted point is}\;\;(e\,,\,e^2+2)$$

and thus the minimal distance is

$$\frac{e-e\log e+e^3+e}{\sqrt{e^2+1}}=e\sqrt{e^2+1}$$

Now, this is the same you got, yet I think your method won't work in the general case: what you did here is "to ask" (find out) where does the curve $\;y=\log x\;$ have tangent line with slope equal to the straight line's, which has constant slope equal to $\;\frac1e\;$ . This is, imo., pretty clear intuitively since then the corresponding points on both curve will be as close as possible, yet if one of the curves is not a straight line (or even worse: if not both functions are differentiable) this may not work. I'm lacking some geometric depth so perhaps someone else can complete/check all this.

If you are trying to find the minimum vertical distance, then your method is correct, but your answer is not. However, you do not seem to have a firm grip on the problem. You seem to be hand waving a bit, so let's do this with no handwaving.

Recall that the distance between two points $(x_0,y_0)$ and $(x_1, y_1)$ is given by the Pythagorean Theorem:

$$\| (x_0,y_0) - (x_1,y_1)\| = \sqrt{(x_1 - x_0)^2 + (y_1 - y_0)^2}$$

Assuming you want to find the minimum vertical distance, then you want to find the minimum value of

$$f(x) = \| (x, x/e + e^2 + 1) - (x, \ln x)\| = \sqrt{ \left(\frac{x}{e} + e^2 + 1 - \ln x\right)^2 } = \left| \frac{x}{e} + e^2 +1 - \ln x \right|$$ Note that $\frac{x}{e} + e^2 + 1 - \ln x > 0$ on $x > 0$ so that $f(x) = \frac{x}{e} + e^2 + 1 - \ln x$. Then, $f'(x) = \frac{1}{e} - \frac{1}{x}$, and so the minimum value occurs at $f(e) = \frac{e}{e} + e^2 + 1 - \ln(e)$.

By the way, to show that $\frac{x}{e} + e^2 + 1 - \ln x > 0$, we could define $g(x) = \frac{x}{e} + e^2 + 1 - \ln x$ and take derivatives. We get $g'(x) = \frac{1}{x} - \frac{1}{e}$ so that $g$ has a critical point at $x = e$ (the value $x = 0$ is not a critical point as the function is undefined there). Note that $f'(x) < 0$ when $0 < x < e$ and $f'(x) > 0$ when $x > e$. This shows that $g(x)$ attains a minimum value at $x = e$. Since $g(e) > 0$, and $g(e)$ is the minimum value of $g$, we have that $g(x) > 0$ for all $x > 0$.

Alternatively, to show that $g(x) > 0$, you could note that $y = x/e + e^2 + 1$ and $\ln x$ never intersect so that the distance between them is always positive. Since the two functions are continuous on $(0, \infty)$ and, say, $\frac{1}{e} + e^2 + 1 > \ln(1)$, then $x/e + e^2 + 1 > \ln x$ for all x > 0$. • @GitGud Thanks, as I should have realized his mistake. Jun 10, 2013 at 12:03 • Yes I understood both your answers. thanks. Jun 10, 2013 at 12:16 Suppose we are given two differentiable functions$f,g:\mathbb{R}\to\mathbb{R}$, and we want to find$x,y$such that the distance $$\Vert(x,f(x))-(y,g(y))\Vert$$ "between the curves" is minimized. Assume that there is such a minimum, and that it is attained for$x=x^*$and$y=y^*. Define \begin{align} h(x,y) &= \Vert(x,f(x))-(y,g(y))\Vert^2 \\ &= (x-y)^2+(f(x)-g(y))^2 \\ &= x^2-2xy+y^2+f(x)^2-2f(x)g(y)+g(y)^2. \end{align} Thenh$has a global minimum at$(x^*,y^*)$, so$Dh(x^*,y^*)=0$. We compute $$Dh(x,y)=2\begin{bmatrix}x-y+f'(x)(f(x)-g(y)) & y-x+g'(y)(g(y)-f(x))\end{bmatrix},$$ so $$f'(x^*)=-\left(\frac{g(y^*)-f(x^*)}{y^*-x^*}\right)^{-1}=g'(y^*),$$ assuming that the quantities exist. Notice that the expression in the brackets is the slope of the line joining$(x^*,f(x^*))$and$(y^*,g(y^*))\$. Geometrically, this line is normal to both curves. (Using this observation along with symmetry would have shortened the above argument.)

So yes, your method is correct.

• This answer is nice, but I find it to be slightly overkill in the sense that if the OP is asking about a calc 1 problem, then only calc 1 methods (single-variable calculus) should be used to answer the question. Jun 10, 2013 at 11:57
• @JavaMan: I have no idea what "calc 1" is. Anyway, as I mentioned in the answer, a bit of symmetry would have eliminated most of the calculations.
– wj32
Jun 11, 2013 at 0:06
• By Calc 1, I only meant first year single-variable calculus. Jun 11, 2013 at 1:42