Lagrange´s error term

Up a level : Power Series
Previous page : A second take on Taylor series
Next page : The exponential function again

Now let us have a look at that strange integral at the end of the series expansion we got at the end of the previous page.

\displaystyle \begin{array}{l}f(x)=f(0)+{f}'(0)x+\frac{{{f}''(0)}}{2}{{x}^{2}}+\ldots +\frac{{{{f}^{{(n)}}}(0)}}{{n!}}{{x}^{n}}+\ldots \\\quad \quad \quad +\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{{{f}^{{(n+1)}}}(x)dx\ldots }}dx}}\end{array} 

We call the integral the error term or rest term written Rk(x). Say we have that, in the interval from 0 to x, we have

N \le {f^{(k + 1)}}(x) \le M

for some values N and M, and that the (k+1)th derivative is continuous. That means that

\displaystyle \int\limits_{0}^{x}{{\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{N{{{(dx)}}^{{k+1}}}}}}}}}\text{ }\!\!~\!\!\text{ }\le \int\limits_{0}^{x}{{\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{{{f}^{{(k+1)}}}(x){{{(dx)}}^{{k+1}}}}}}}}}\le \int\limits_{0}^{x}{{\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{M{{{(dx)}}^{{k+1}}}}}}}}}

or in other words that

\displaystyle \frac{N}{{(k+1)!}}{{x}^{{k+1}}}\le \int\limits_{0}^{x}{{\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{{{f}^{{(k+1)}}}(x){{{(dx)}}^{{k+1}}}}}}}}}\le \frac{M}{{(k+1)!}}{{x}^{{k+1}}}\text{ }

This means that there must exist a value between N and M, say P, such that that

\displaystyle \frac{P}{{(k+1)!}}{{x}^{{k+1}}}=\int\limits_{0}^{x}{{\int\limits_{0}^{x}{{\ldots \int\limits_{0}^{x}{{{{f}^{{(k+1)}}}(x){{{(dx)}}^{{k+1}}}}}}}}}

and since the function where continuous, and varying between N and M, then there must exist a value c between 0 and x such that

P = {f^{(k + 1)}}(c)

Putting it together we have that

{R_k}(x) = \frac{{{f^{(k + 1)}}(c)}}{{(k + 1)!}}{x^{k + 1}}

for some value c in 0 to x. This is called the Lagrange form of the error term.

An upper bound of the error

We mostly use this to find an upper bound (a value we will not exceed) for the error. What we do is to find the maximum value of the (k+1)th derivative in the interval (i.e., M) or at least some value that we know will be bigger than the maximum. Then we know that

{R_k}(x) \leqslant \frac{M}{{(k + 1)!}}{x^{k + 1}}

An example

Say we want to use the series expansion

{e^x} = 1 + x + \frac{{{x^2}}}{{2!}} + \frac{{{x^3}}}{{3!}} + ...

The rest term will now be

{R_k}(x) \leqslant \frac{{{e^c}}}{{(k + 1)!}}{x^{k + 1}}

Say we will use 10 terms, and x is between -2 and 2, what would the maximum error not exceed? The exponential function is biggest at the upper end of the interval, and so is x11. So we get

{R_{10}}(2) \leqslant \frac{{{e^2}}}{{11!}}{2^{11}} \approx 0.00038

When comparing this to the actual error we find that the actual error is about 6 times smaller. The above will thus give us a guaranteed upper bound of the error, but the error is usually much smaller.

So how many terms do we need to have an error not exceeding say 10-10 when x is between –1 and 1? We get that

{R_k}(1) \leqslant \frac{{{e^1}}}{{(k + 1)!}}{1^{k + 1}} \leqslant {10^{ - 10}}

or

\frac{e}{{{{10}^{ - 10}}}} = e \cdot {10^{10}} \leqslant (k + 1)!

With a bit of testing, we find that k=13.

Up a level : Power Series
Previous page : A second take on Taylor series
Next page : The exponential function againLast modified: Dec 28, 2023 @ 13:53