Solution (source code)

= Solution

The first $n$ terms of <Taylor's theorem>, with the <Taylor remainder> in mean-value form, are
$$
\boxed{f(x)=\sum_{k=0}^{n-1}\frac{f^{(k)}(a)}{k!}(x-a)^k+R_n(x),\qquad R_n(x)=\frac{f^{(n)}(\xi)}{n!}(x-a)^n,}
$$
where $\xi$ lies between $a$ and $x$ for $x\ne a$. Sufficient hypotheses are continuous <derivatives> through order $n-1$ on the interval between the endpoints and an $n$th <derivative> in its interior. At $x=a$ the remainder is zero. The finite <Taylor polynomial> ends at degree $n-1$; this identity does not require convergence of an infinite <Taylor series>.