Let be $(M,g)$ a connected Riemannian manifold.
If $ \phi : [a,b] \rightarrow M$ is $C^\infty$ we define the arc-length of the curve $\phi$ as the quantity:
$$J(\phi )= \int_a^b f(\phi (t),\dot{\phi(t)})\; dt$$ where
$$ f(\phi(t),\dot{\phi(t)})^2= \sum_{\alpha, \beta} g_{\alpha,\beta}(\phi(t)) \:\dot{\phi}(t)^\alpha\: \dot{\phi}(t)^\beta$$ and $\phi^1(t),\dots, \phi^n(t)$ are the local coordinates of $\phi(t)$.
Why my book says that $f$ is a function with values in $M$, $$f:(a,b) \rightarrow M?$$ I'm confused.
Thanks for the help!