§ Mean value theorem and Taylor's theorem. (TODO)

I realise that there are many theorems that I learnt during my preparation for JEE that I simply don't know how to prove. This is one of them. Here I exhibit the proof of Taylor's theorem from Tu's introduction to smooth manifolds.
Taylor's theorem: Let f:RRf: \mathbb R \rightarrow \mathbb R be a smooth function, and let nNn \in \mathbb N be an "approximation cutoff". Then there exists for all x0Rx_0 \in \mathbb R a smooth function rCRr \in C^{\infty} \mathbb R such that: f(x) = f(x 0) + (x - x 0) f'(x 0)/1! + (x - x 0)^2 f'(x 0)/2! + \dots + (x - x 0)^n f^{(n)'}(x 0)/n! + (x - x 0)^{n+1} r
We prove this by induction on nn. For n=0n = 0, we need to show that there exists an rr such that f(x)=f(x0)+rf(x) = f(x_0) + r. We begin by parametrising the path from x0x_0 to xx as p(t)(1t)x0+txp(t) \equiv (1 - t) x_0 + tx. Then we consider (fp)(f \circ p)':
f(p(t))dt=df((1t)x0)+tx)dt=(xx0)df((1t)x0)+tx)dx \begin{aligned} &\frac{f(p(t))}{dt} = \frac{df((1 - t) x_0) + tx)}{dt} \\ &= (x - x_0) \frac{df((1 - t)x_0) + tx)}{dx} \end{aligned}
Integrating on both sides with limits t=0,t=1t=0, t=1 yields:
01df(p(t))dtdt=01(xx0)df((1t)x0)+tx)dxdtf(p(1))f(p(0))=(xx0)01df((1t)x0)+tx)dxdtf(x)f(x0)=(xx0)g[1](x) \begin{aligned} &\int_0^1 \frac{df(p(t))}{dt} dt = \int_0^1 (x - x_0) \frac{df((1 - t)x_0) + tx)}{dx} dt \\ f(p(1)) - f(p(0)) = (x - x_0) \int_0^1 \frac{df((1 - t)x_0) + tx)}{dx} dt \\ f(x) - f(x_0) = (x - x_0) g[1](x) \\ \end{aligned}
where we define g[1](x)01df((1t)x0)+tx)dxdtg[1](x) \equiv \int_0^1 \frac{df((1 - t)x_0) + tx)}{dx} dt where the g[1](x)g[1](x) witnesses that we have the first derivative of ff in its expression. By rearranging, we get:
f(x)f(x0)=(xx0)g[1](x)f(x)=f(x0)+(xx0)g[1](x) \begin{aligned} f(x) - f(x_0) = (x - x_0) g[1](x) \\ f(x) = f(x_0) + (x - x_0) g[1](x) \\ \end{aligned}
If we want higher derivatives, then we simply notice that g[1](x)g[1](x) is of the form:
g[1](x)01f((1t)x0)+tx)dtg[1](x)01f((1t)x0)+tx)dt \begin{aligned} g[1](x) \equiv \int_0^1 f'((1 - t)x_0) + tx) dt \\ g[1](x) \equiv \int_0^1 f'((1 - t)x_0) + tx) dt \\ \end{aligned}