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
-
Lagrange remainder: there exists $\theta\in(0,1)$ such that $$ R_n(a+h) = \frac{h^n}{n!}f^{(n)}(a+\theta h); $$
-
Cauchy remainder: there exists $\theta\in(0,1)$ such that $$ R_n(a+h) = \frac{(1-\theta)^{n-1} h^n}{(n-1)!} f^{(n)}(a+\theta h). $$
-
Integral remainder: if we further assume $f^{(n)}$ is continuous on $x\in[a,a+h]$, then $$ \begin{align*} R_n(a+h) = \frac{h^n}{(n-1)!} \int_{0}^{1} (1-t)^{n-1} f^{(n)}(a+th)\, dt. \end{align*} $$
Proof 1 (Lagrange remainder only) Proof 2 (less motivated) Proof (integral remainder)