So far we have assumed that our functions were analytic. But how can we tell which are?
Taylor's theorem with remainder helps us determine how close a Taylor polynomial comes to the original function.
Theorem: If $f(x)$ is $(k+1)$-times differentiable on an interval around $a$, and if $x$ is in that interval, then $$ f(x) = \sum_{n=0}^k \frac{f^{(n)}(a)}{n!} (x-a)^n + R_k(x),$$ where the remainder is given by $$R_k(x) = \frac{f^{(k+1)}(z)}{(k+1)!} (x-a)^{k+1}$$ for some point $z$ between $a$ and $x$.
If a function $f$ can be differentiated infinitely many times, and
$$
\lim_{k\to\infty}R_k(x)=0,
$$
then $f$ is analytic.
Corollary: If the $(k+1)$st derivative of $f$ is bounded by $M$ on an interval of radius $d$ around $x=a$, then the remainder $R_k(x)$ is bounded by $$\frac{M}{(k+1)!}(x-a)^{k+1}.$$
From this corollary, we can see that the remainders for $e^x$ and $\sin(x)$, for example, go to zero as $k \to \infty$, so these functions are analytic.
Taylor's theorem is similar to Rolle's theorem and the Mean Value Theorem, both of which involve a mystery point between $a$ and $b$. The proof of Taylor's theorem involves repeated application of Rolle's theorem.