## § 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: \mathbb R \rightarrow \mathbb R$ be a smooth function, and let $n \in \mathbb N$ be an "approximation cutoff". Then there exists for all $x_0 \in \mathbb R$ a smooth function $r \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 $n$. For $n = 0$, we need to show that there exists an $r$ such that $f(x) = f(x_0) + r$. We begin by parametrising the path from $x_0$ to $x$ as $p(t) \equiv (1 - t) x_0 + tx$. Then we consider $(f \circ p)'$:
\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=1$ yields:
\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) \equiv \int_0^1 \frac{df((1 - t)x_0) + tx)}{dx} dt$ where the $g[1](x)$ witnesses that we have the first derivative of $f$ in its expression. By rearranging, we get:
\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)$ is of the form:
\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}