# General Algorithms for Estimating Approximation Errors from Taylor Series

A Taylor Series provides a (local) approximation for a function around a certain point - this approximation is constructed using sums of this function's derivatives. Like all approximation methods, there is always an "error" associated with the approximation - for reference, please see below (https://brilliant.org/wiki/taylor-series-error-bounds/):

In the formula on the last line, we see that in order to calculate the error for a given "N-Term" Taylor Expansion, we need to calculate the derivative of the "N+1 -th" term and evaluate this "N+1 -th" term at some point "z".

• But it remains unclear to me how to identify this point "z"?

I have heard that "z" is supposed to be the maximum value the "N+1 -th" derivative can reach.

• This has always lead me to believe that perhaps we can calculate "z" using an optimization algorithm? E.g. Find MAX "z" for n+1_derivative(function "f")?

It seems like this problem (i.e. finding some point "z" to calculate approximation error) is not just unique to Taylor Series. For instance, in Simpson's Method used to approximate the integral of functions, a similar problem presents itself with regards to finding out the approximation error (https://en.wikipedia.org/wiki/Simpson%27s_rule):

It remains unclear to me how the point "Xi" is identified, so that we can evaluate the approximation error in Simpson's Method.

• Are there any general methods for identifying the point "Xi"? Can we also frame this problem (i.e. Identifying "Xi") as an optimization problem?

With modern computers, I feel that it shouldn't be too difficult to take the functions in both of these problems (e.g. n+1-th derivative of the original function) and "code" them in some programming language - and then use an optimization algorithm (e.g. Gradient Descent) to try and identify these points "z" and "Xi" ... however, I don't think all this would have been possible for complicated and multivariate functions when these methods (i.e. Taylor Series and Simpson's Method) were first created hundreds of years prior to the discovery of electricity, let alone computers.

• Is there a general method for identifying these points "z" and "Xi"?
• Not to sound pedantic, but can the problem of identifying points "z" and "Xi" be treated like an optimization problem and solved using modern computers?

Thank You!

Let us consider, for instance, the problem of proving that the Taylor series of the sine function centered at $$0$$ converges to $$\sin(x)$$ for every $$x\in\Bbb R$$. So, you take some $$x\in\Bbb R\setminus\{0\}$$ (if $$x=0$$, it's trivial) and some $$\varepsilon>0$$, and your goal is to prove that there is some $$N\in\Bbb N$$ such that$$n\geqslant N\implies\left|\sin(x)-\sum_{k=0}^n\frac{(-1)^k}{(2k+1)!}x^k\right|<\varepsilon.$$Is is known that, as you wrote,$$\sin(x)-\sum_{k=0}^n\frac{(-1)^k}{(2k+1)!}x^{2k+1}=\frac{\sin^{(2n+3)}(z)}{(2n+3)!}x^{2n+3},$$for some $$z$$ between $$0$$ and $$x$$. I don't know the value of $$z$$, but I know that $$\bigl|\sin^{(2k+3)}(z)\bigr|\leqslant1$$. Therefore,$$\left|\sin(x)-\sum_{k=0}^n\frac{(-1)^k}{(2k+1)!}x^k\right|=\left|\frac{\sin^{(2n+3)}(z)}{(2n+3)!}x^{2n+3}\right|\leqslant\frac{|x|^{2n+3}}{(2n+3)!}.$$Since $$\lim_{n\to\infty}\frac{|x|^{2n+3}}{(2n+3)!}=0$$, you do indeed have $$\frac{|x|^{2n+3}}{(2n+3)!}<\varepsilon$$ if $$n$$ is large enough.
As you can see, I had no need to know the exact value of $$z$$ in order to prove the convergence of this Taylor series.