Without being so sure, the second fundamental theorem of calculus can be written in the following form:
Let $f \in {\cal C}^1(\mathbb{R}^n)$. Then, for all $x, y \in \mathbb{R}^n$, we have \begin{align} f(y) = f(x) + \int_0^1 \langle \nabla f(x + \tau(y-x)), y-x \rangle d \tau, \end{align} where $\nabla f(x)$ denotes the gradient of $f(x)$.
A use case of this formulation can be found in Nesterov's book (Introductory Lectures on Convex Programming) (Lemma 1.2.3).
I was wondering if there is form of this equation for the case where $x$ and $y$ live on the unit sphere $\mathbb{S}^{n-1} \subset \mathbb{R}^n$.
I am guessing that the formula would contain geodesics, but I couldn't find a solution online.
Thanks to Ted Shifrin, I came up with this (rather elementary) conclusion.
In the Euclidean case (${\cal M = \mathbb{R}^n}$), the geodesic curve is just a simple line, such that $\gamma(t) = x + t(y-x)$. If we plug this definition of $\gamma$ in the above equation, we obtain the equation that I wrote in the original question.