You're trying to minimize the distance between the point

and an arbitrary point on the curve,

.
The distance between two such points is given by the function

so this is the function whose derivative you should check.
But before you do that, it's helpful to know that

is minimized at the same point as the modified distance function

.
Differentiating, you have

Set this to zero and solve for the critical points.

You can use the rational root theorem to find some potential candidates for roots to the cubic. The constant term has factors

, while the leading coefficient has factors

. The only candidates for rational roots are

. The only one of these that works is

, so

is a root to the cubic above.
Polynomial division reveals that we can factor the cubic as

which has only one real root at

. Checking the value of the derivative of

to the left and right of this point confirms that a minimum occurs here.
Therefore the closest point on the curve to

is

.