# 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 in the end of the series expansion we got in the end of the previous page.

$\begin{gathered} f(x) = f(0) + f'(0)x + \frac{{f''(0)}}{{2!}}{x^2} + ... + \frac{{{f^k}(0)}}{{k!}}{x^k} + \hfill \\ \quad \quad \quad + \int\limits_0^x {\int\limits_0^x {...\int\limits_0^x {{f^{(k + 1)}}(x){{(dx)}^{k + 1}}} } } \hfill \\ \end{gathered}$

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 \leqslant {f^{(k + 1)}}(x) \leqslant M$

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

$\int\limits_0^x {\int\limits_0^x {...\int\limits_0^x {N{{(dx)}^{k + 1}}} } } \leqslant \int\limits_0^x {\int\limits_0^x {...\int\limits_0^x {{f^{(k + 1)}}(x){{(dx)}^{k + 1}}} } } \leqslant \int\limits_0^x {\int\limits_0^x {...\int\limits_0^x {M{{(dx)}^{k + 1}}} } }$

or in other words that

$\frac{N}{{(k + 1)!}}{x^{k + 1}} \leqslant \int\limits_0^x {\int\limits_0^x {...\int\limits_0^x {{f^{(k + 1)}}(x){{(dx)}^{k + 1}}} } } \leqslant \frac{M}{{(k + 1)!}}{x^{k + 1}}$

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

$\frac{P}{{(k + 1)!}}{x^{k + 1}} = \int\limits_0^x {\int\limits_0^x {...\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)$

The above might be best illustrated by a figure:

This is actually an application of the so called mean value theorem.

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 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 use 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: Mar 13, 2019 @ 20:03