When I solve for the point in $y = \sqrt{x}$ closest to the origin using calculus, I get $x = -1/2$. And this is the case for ALL functions $y = \sqrt{x + c}$ using the distance formula $d^2 = x^2 + y^2$.

Why is it that the extreme point is somewhere the function is not even defined? Obviously (at least to me), isn't the closest point to the origin (0, 0)?



We want the nearest distance from the origin to some point P in the function $y = \sqrt{x}$. We can use $d^2 = (x2 - x1)^2 + (y2 - y1)^2$ as the optimization function with the constraint that the other point (say, (x2, y2)) be on the curve $y = \sqrt{x}$. We set the other point, say (x1, y1), to the origin and be (0, 0).

When you put them all together, you get $d^2 = (x - 0)^2 + (\sqrt{x} - 0)^2 = x^2 + x$. You get the derivative of that and set it to zero to optimize. $d(d^2)/dx = 2x + 1 = 0$ and so $x = -1/2$.

My question is why is this the case? Is there a way to end up with x = 0 using calculus? Without necessarily JUST looking at the graph.

  • 4
    $\begingroup$ Given that $(0,0)$ is itself a solution to $y=\sqrt{x}$, the closest point to $(0,0)$ on the curve defined by $y=\sqrt{x}$ is of course itself, not any other point. Can you post the steps you were using to conclude this $x=-1/2$, so that people are able to see where the wrong step is? $\endgroup$ Jun 2, 2013 at 7:47
  • $\begingroup$ I actually don't 'know' the solution for (0, 0). I'm asking why optimizing this problem yields x = -1/2 even though this isn't even defined for $y = \sqrt{x}$. It was just the most obvious conclusion (to me). $\endgroup$
    – user56833
    Jun 2, 2013 at 7:50
  • $\begingroup$ Well, your intuition is correct :) The only way people will be able to tell you why you are getting $x=-1/2$ is if you post your work so that people can look at it, though. $\endgroup$ Jun 2, 2013 at 7:51

3 Answers 3


The square of the distance from the origin is as follows:




In optimizing this, make sure you're considering all the critical points, including the endpoints of the domain (in this case $x=0$), not just the points where the derivative equals $0$.


I'm assuming you're saying that each point can be written as $(x, \sqrt{x})$ and hence the square of the distance from the origin is $d^2=x^2+(\sqrt{x})^2=x^2+x$ which is a parabola with a minimum at $x=-\frac{1}{2}$. The problem with this is that you are neglecting the domain of the function. The original function can not take negative x-values and similarly the square of the distance can't be negative. So you have to solve for the minimum distance subject to these constraints and the solution (as should be intuitively obvious) is then the point $(0,0)$


The reason your method doesn't work is because if you allow $x$ to be negative, then $y$ is allowed to be complex, and the distance to the origin is no longer $x^2+y^2$, it is $x^2+|y|^2$. In this case then the distance to the origin is $x^2+|x|$, and since $x^2+|x|\ge 0$, the minimum distance is $0$ when $x=0$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .