Taylor Polynomials
The Taylor polynomial of degree $n$ of a function around $x = 0$ is $P_n(x) = \sum_{k=0}^{n} \dfrac{f^{(k)}(0)}{k!}\,x^k$. The navy curve is the function itself, the red curve the polynomial. As the degree grows the polynomial clings to the function over a wider interval, but not everywhere for every function.
What to notice
- For $\sin x$, $\cos x$ and $e^x$ the polynomial approaches the function at every $x$ as the degree grows; distant points only need more terms.
- For $\ln(1+x)$, $\dfrac{1}{1-x}$ and $\arctan x$ the polynomial moves away from the function outside the green band as the degree grows: the series only works on its interval of convergence.
- $\arctan x$ is a smooth function on all real numbers, yet its series still diverges outside $|x| \le 1$. The reason is invisible on the real axis; it sits at the points $x = \pm i$ in the complex plane.