Theorem (Taylor's theorem)

Suppose $f$ and its first $n-1$ derivatives are continuous on $[a,a+h]$, and $f$ is $n$-times differentiable on $(a,a+h)$.

Then $$ f(a+h) = P_{n-1}(a+h) + R_n(a+h) $$ where $P_{n-1}$ is the $(n-1)$-th order Taylor polynomial $$ P_{n-1}(a+h) = \fsum i0{n-1} \frac{h^i}{i!} f^{(i)}(a) $$ and the error term $R_n(h)$ can be written in the form of

Proof 1 (Lagrange remainder only) Proof 2 (less motivated) Proof (integral remainder)