Find the shortest distance between point $(2,0)$ and function $\sqrt{16x^2 + 5x+16}$.

I want to find the shortest distance between point $(2,0)$ and function $\sqrt{16x^2 + 5x+16}$, So I did the optimization but the answer is always wrong.

\begin{align}D=&\sqrt{(x-2)^2+(y)^2}\\ y^2=&{16x^2 + 5x+16}\\ &\text{(by substituting)}\\ D=&\sqrt{(x-2)^2+(16x^2 + 5x+16)}\\ D=& \sqrt{17{x}^{2}+ x + 20}\\ &\text{(Convert to a polynomial since root doesn't matter in the domain)}\\ D(x)=& 17x^2+x+20 \\ D^\prime(x)=& 34x+1 \\ x =& \frac{-1}{34}\end{align}

Which is clearly not the closest point, So what did I do wrong?

Here is the question and my answer, which is evaluated as wrong.

• I was wrong, it actually looks strange :)
– Sil
Nov 27, 2016 at 18:11
• Have you substituted $x$ into $D$ to find the distance? Nov 27, 2016 at 18:12
• @amWhy Yes I did, I assumed that my answer was wrong after I looked at a plot which didn't really convince me that the closest point is at $\frac{-1}{34}$ Nov 27, 2016 at 18:14
• Should the path to the closest point be perpendicular to the tangent line or does this apply only for straight lines? Nov 27, 2016 at 18:16
• I'm wondering about your decision to to equate $D(x) = \sqrt{17x^2+ x + 20}$ to $D(x) = 17x^2 + x + 20 = (D(x))^2$? You should have $(D(x))^2 = 17x^2 + x + 20?$ Nov 27, 2016 at 18:29

Your result is correct. The confusion is caused by the software you use to vizualize the graph - they do scale the axis differently AND they hide values of $y$ (see some graphs below for omitted values between $0$ and $3$).

Maple (even with 1:1 ratio checked, values hidden on $y$ axis):

Google: (all $y$ values shown, but scale is different)

Mathematica (with AspectRatio->1, again missing values on $y$ axis)

You need to be careful about this and setup tools properly. Here is for example Geogebra which is using 1:1 scale by default and does not hide any values from the plot since you see whole canvas (https://www.geogebra.org/graphing). You can see that your result now makes sense visually.

• Ok, but when i insert the result I got in the quiz it get evaluated as wrong, May be it has something with the power 2 (look at the question's comments). Nov 27, 2016 at 18:55
• What are you inserting where?
– Sil
Nov 27, 2016 at 18:56
• Quiz on Optimization on Coursera, Calculus One course. Nov 27, 2016 at 18:58
• Well based on your updated question, you are inserting function value, not the distance value.
– Sil
Nov 27, 2016 at 19:10
• Maple should give a better plot with the "scaling=constrained" option.
– user307169
Nov 27, 2016 at 19:29

We can minimize $(x-2)^2+y^2$ for convenience, since squaring is increasing on positive reals. Then as you substituted $$f(x)=(x-2)^2+16x^2+5x+16\Rightarrow f(x)=17x^2+x+20\Rightarrow f'(x)=34x+1=0\Rightarrow x=-\frac{1}{34}$$ As you found. Making the closest point on the curve $$(-\frac{1}{34},\sqrt{16(1/34)^2-5/34+16})\sim (-.03,3.99)$$ What's the problem?

• And the distance should be somewhere close to 3.98, but the quiz I am taking evaluate this as a wrong answer. Nov 27, 2016 at 18:27
• @OmarAhmad, try giving an exact answer instead of an approximate one. e.g. $\sqrt 2$ and not $1.414$ etc.
– user307169
Nov 27, 2016 at 18:50
• @tilper Actually we insert the formula itself not numbers, so it is not about perception. Nov 27, 2016 at 18:52
• @OmarAhmad insert what formula? I'm not sure I understand.
– user307169
Nov 27, 2016 at 18:53
• @OmarAhmad ah, got it. Aren't you supposed to give the distance though? So you should be using $\sqrt{17x^2 + x +20}$.
– user307169
Nov 27, 2016 at 19:01