Let $g:I \to \mathbb{R}$ be a $C^{k+1}$ function, $a,x \in I$, then: $$g(x)=g(a)+g'(a)(x-a)+ \ldots +\frac{1}{k!}g^{(k)}(a)(x-a)^k+ \quad \frac{1}{k!}\int_a^x(x-s)^kg^{(k+1)}(s)\,ds $$ Proof: Taking $x$ fixed, the RHS of the equation above is a function of $a$ and its derivative wrt $a$ is zero (that can be easily verified, so I will not write the computations, for the last term simply use the Fundamental Theorem of Calculus), so it remains constant when varying $a$. In particular when it is evaluated at $a=x$ its value is $g(x)$ as wanted.
Since the function is constant (when varying $a$) then the RHS equals $g(x)$ for all $a \in I$ and since $x$ was arbitrary the equation holds for all $x \in I$
Can anyone confirm this proof is correct? It seems tricky and so simple that makes me suspect
BTW this is taken from the apendix of Hubbard's book Vector calculus, linear algebra and differential forms