how to find minimum distance from a point to a graph using Mathematica?

103 Views Asked by At

Find the point on the graph of $y= x^{3/2}$ that is closest to the point $(4, 0)$.

This is an optimization problem. I used the distance formula.

$d=\sqrt{(4-x)^2+(0-x^{3/2})^2}$

$d^2=16-8x+x^2+x^3$

Then I took the derivative of $d^2$ (after squaring both sides)

$(d^2)'=3x^2 +2x-8$

$0=(3x-4)(x+2)$

$x=\frac43$, $x=-2$

For the minimum distance, $x=\frac43$, so $y= \frac8{3\sqrt3}$

I want to be able to check my work using Mathematica. Does anyone know how I can do this? Thank you in advance!

1

There are 1 best solutions below

4
On BEST ANSWER

If you are OK with solution by incantation, you can do the following:

f = Function[x, x^(3/2.)] (* your function *)
{px, py} = {4, 0}  (* your point *)
d2 = (px - x)^2 + (py - f[x])^2  (* your objective *)
Minimize[d2, x]  (* simplest approach to minimization *)

enter image description here