# Thread: optimization finding the minimum distance

1. ## optimization finding the minimum distance

i'm having trouble solving this problem?

Find the point on the graph of the function that is closest to the given point

function: f(x)=x^2
point: (2, 1/2)

i know that you need to write the distance formula for this, but am unsure where to plug in the secondary equation

2. Originally Posted by wolfxpax
i'm having trouble solving this problem?

Find the point on the graph of the function that is closest to the given point

function: f(x)=x^2
point: (2, 1/2)

i know that you need to write the distance formula for this, but am unsure where to plug in the secondary equation
If your function is $\displaystyle y = x^2$, then every point will be $\displaystyle (x, y) = (x, x^2)$.

The distance from $\displaystyle \left(2, \frac{1}{2}\right)$ is given by

$\displaystyle D = \sqrt{\left(2 - x\right)^2 + \left(\frac{1}{2} - x^2\right)^2}$

$\displaystyle = \sqrt{4 - 4x + x^2 + \frac{1}{4} - x^2 + x^4}$

$\displaystyle = \sqrt{x^4 - 4x + \frac{17}{4}}$

$\displaystyle = \left(x^4 - 4x + \frac{17}{4}\right)^{\frac{1}{2}}$.

To find the minimum distance, we have to differentiate.

Let $\displaystyle u = x^4 - 4x + \frac{17}{4}$ so that $\displaystyle D = u^{\frac{1}{2}}$.

$\displaystyle \frac{du}{dx} = 4x^3 - 4$

$\displaystyle \frac{dD}{du} = \frac{1}{2}u^{-\frac{1}{2}}$

$\displaystyle = \frac{1}{2}\left(x^4 - 4x + \frac{17}{4}\right)^{-\frac{1}{2}}$.

So $\displaystyle \frac{dD}{dx} = \frac{2x^3 - 2}{\sqrt{x^4 - 4x + \frac{17}{4}}}$.

To find the minimum, this has to be equal to 0.

$\displaystyle 0 = \frac{2x^3 - 2}{\sqrt{x^4 - 4x + \frac{17}{4}}}$

$\displaystyle 0 = 2x^3 - 2$

$\displaystyle 2 = 2x^3$

$\displaystyle x^3 = 1$

$\displaystyle x = 1$.

Assuming this is a minimum and not a maximum or stationary inflexion point, then the point on the graph $\displaystyle y = x^2$ which is minimum distance from $\displaystyle \left(2, \frac{1}{2}\right)$ is

$\displaystyle (x, y) = (1, 1)$.

3. By the way, since distance is always positive, minimizing $\displaystyle d= \sqrt{x^2+ y^2}$ is exactly the same as minimizing $\displaystyle d^2= x^2+ y^2$ and that avoids the square root.

One problem with the original poster not showing any work is that we have no idea where in Calculus he is or what techniques he has available.

I would be inclined to use "Lagrange multipliers" on this: Let $\displaystyle D= (x- 2)^2+ (y- 1/2)^2$, the square of the distance between (x,y) and (2, 1/2). Let $\displaystyle F= y- x^2= 0$. Then $\displaystyle grad D= \nabla D= 2(x-2)\vec{i}+ 2(y- 1/2)\vec{j}= (2x- 4)\vec{i}+ (2y-1)\vec{j}$ and $\displaystyle grad F= \nabla F= -2x\vec{i}+ \vec{j}$.

"Lagrange multipliers" says that at a minimum (or maximum) point of D, subject to the constraint F= constant, those two gradient vectors must be parallel so each must be a multiple of the other: $\displaystyle \nabla D= \lambda \nabla F$ where $\displaystyle \lambda$ is the multiple, the "Lagrange multiplier". For problems like this, involving distance, it is easy to see why that is true. $\displaystyle \nabla D$ always points in the direction of fastest increase of a function. Here, $\displaystyle \nabla D$ points directly toward the point (2, 1/2) because that is the way to minimize the distance- move directly toward it. But if we are constrained to stay on some curve, we cannot move directly toward the point. What we can do is see if that vectors points "to the left" or "to the right" on the curve and move that way. We know we have gotten as close as possible (minimized distance) when that vector, showing "the way we want to go" is perpendicular to the curve.

For a curve given by F(x,y)= constant, $\displaystyle \nabla F$ is itself perpendicular to the curve at every point so the condition "$\displaystyle \nabla D$ is perpendicular to the curve" becomes "$\displaystyle \nabla D$ is parallel to $\displaystyle \nabla F$" and so means one is a multiple of the other:

$\displaystyle \nabla D= (2x-4)\vec{i}+ (2y- 1)\vec{j}= \lambda(-2x\vec{i}+ \vec{j}= \lambda \nabla F$. Equating x and y components, that gives the two equations $\displaystyle 2x-4= -2\lambda x$ and $\displaystyle 2y- 1= \lambda$. Those, together with the equation of the curve, $\displaystyle y= x^2$ gives three equations to solve for x, y, and $\displaystyle \lambda$. I often find that, since the value of $\displaystyle \lambda$ is not relevant, that it helps to eliminate $\displaystyle \lambda$ first by dividing those two equations:
$\displaystyle \frac{2x-4}{2y-1}= -2x$. That, together with $\displaystyle y= x^2$ give two equations to solve for x and y.