Let $f:\mathbb R \to \mathbb R^n$ be a differentiable mapping with $f'(t) \neq 0$ for all $t$ in $\mathbb R$. Let $p$ be a fixed point not on the image curve of $f$. If $q = f(t\_0)$ is the point of the curve closest to $p$, that is, $|p-q | \leq |p-f(t)|$ for all $t$ in $\mathbb R$, show that vector $(p-q)$ is orthogonal to the curve at $q$.

Hint: Differentiate the function $M(t) = |p-f(t)|^2$

This one was supposed to be the easiest problem on the problem set, but for some reason I cannot come up with an answer... I did the rest of the problems... Any help is much appreciated.