# Gradient of a function defined on a curve

Given:

$f=f(\vec{r})$ and

$\vec{r}=\vec{r}(s)$, therefore

$f = f(\vec{r}(s)) = f(s)$, $f$ is defined only on the curve $\vec{r}(s)$.

How then does one express the gradient of $f$

$\nabla f(\vec{r}) = ...$

You can't. Consider the simple case where the curve is the $x$-axis in $\mathbb R^2$ and extend the function $f$ to all of $\mathbb R^2$ in two different ways: by $f_1(x,y) = f(x)$ and by $f_2(x,y) = f(x) + y$. These two functions agree along the curve, but their gradients are different: $\partial f_1 / \partial y = 0$ while $\partial f_2 / \partial y = 1$. Thus it is impossible to define the gradient of this partial function in a reasonable fashion.
In order to discuss the gradient of a function $f$ at a point $p$, we need $f$ to be defined in an open neighbourhood of $p$.