Lagrange Error Bound Calculator
The Lagrange error bound calculator will help you determine the Lagrange error bound, the largest possible error arising from using the Taylor series to approximate a function. And what's more, this article will show you:
- What the Lagrange error bound is;
- How it relates to the Taylor remainder theorem;
- The Lagrange error bound formula; and
- A worked-out example of how to calculate the Lagrange error bound.
π Looking for other calculators on number series? Why not give our harmonic series calculator a try?
How to use the Lagrange error bound calculator
The Lagrange error bound calculator is easy to use! Simply enter your Taylor series problem's values into their corresponding fields:
- Enter the number of terms from the Taylor series (also known as the resulting Taylor polynomial's degree) into
n. - Enter the xx-value at which you're evaluating the error, into
x. - Enter the polynomial's center in the field labelled
a. - Enter the maximum value of the (n+1)(n+1)-th derivative of the function you're approximating, f(x)f(x), into the field labelled
M.
The Lagrange error bound, emaxβemaxβ, will be presented at the bottom of the calculator.
Now, if you find yourself asking questions such as "What is the Taylor series?" or "What is the Lagrange error bound?", then read on!
What is the Lagrange error bound?
The Lagrange error bound is the upper bound on the error that results from approximating a function using the Taylor series. Using more terms from the series reduces the error, but it's rarely zero, and it's hard to calculate directly. The error bound tells us what the largest possible error is. The Lagrange error bound formula is derived from the Taylor remainder theorem.
π‘ The Lagrange error bound can be seen as a margin of error for the Taylor series approximation. If you want to learn more about that topic, head over to our margin of error calculator.
A short introduction to the Taylor series
If we have some function ff, then we can perfectly replicate it using an infinite sum of terms, each expressed using a higher-order derivative of ff. This endless sum is called the Taylor series.
Let's clarify the above with a mathematical definition β any function ff can be replicated by this infinitely long summation:
where:
- f(n)f(n) is the nn-th derivative of the function ff; and
- aa is any point of our choosing, as long as f(x)f(x) is infinitely differentiable at aa.
Below, you can see the Taylor series in action, as it approximates f(x)=exf(x)=ex with more and more terms, i.e., as the value of nn becomes higher and higher:

Isn't that amazing? With only a 5th-degree polynomial, we can already approximate exex to a high degree of accuracy.
However, we now see a problem: the Taylor series' definition is only true if we use an infinite number of terms. If we stop anywhere short of infinity β and as mortals, we must β then we'd only have approximated f(x)f(x) with the Taylor polynomial, Pnβ(x)Pnβ(x):
Because Pnβ(x)Pnβ(x) is just an approximation of f(x)f(x), there will be a remainder, Rnβ(x)Rnβ(x):
What is the value of Rnβ(x)Rnβ(x)? We can't know for sure because there are countless terms to calculate. We do know that the more terms we include from the series (i.e., the higher the polynomial's degree, nn), the better we approximate f(x)f(x) with Pnβ(x)Pnβ(x), and the smaller that error will become.
Lucky for us, there is an upper bound on Rnβ(x)Rnβ(x), a worst-case-scenario estimate of the error. It's called the Lagrange error bound, and this calculator and text is all about finding it.
π‘ Errors aren't desirable, but measuring them is the first step to fixing them! Try our relative error calculator to get started.
How do I calculate the Lagrange error bound?
The Lagrange error bound formula is as follows:
where:
- emaxβemaxβ β Lagrange error bound;
- xx β Where we're determining the error between f(x)f(x) and Pnβ(x)Pnβ(x);
- aa β Where the polynomial is centered;
- nn β Number of terms from the Taylor series we're including, and thus the degree of the resulting polynomial; and
- MM β Largest value of βf(n+1)(z)ββ£β£βf(n+1)(z)β£β£β for all zz between aa and xx:
Using emaxβemaxβ, we can place a bound on RnβRnβ:
which simply states that Rnβ(x)Rnβ(x) cannot be larger in magnitude than emaxβemaxβ, thereby providing an upper bound on any error that might result from the approximation of f(x)f(x).
That's enough formulae β let's look at an example of the Lagrange error bound and how it's calculated.
Calculating the Lagrange error bound: an example
Let's find the error bound for the function sin(x)sin(x) at Ο/3Ο/3 when approximated by a 4th-order Taylor polynomial centered around Ο/6Ο/6.
Right off the bat, we have some values ready to be plugged into our Lagrange error bound formula:
- f(x)=sin(x)f(x)=sin(x);
- x=Ο/3x=Ο/3;
- n=4n=4; and
- a=Ο/6a=Ο/6.
The hardest part will be determining MM, the largest value of the (n+1)=5(n+1)=5th differential of f(x)f(x) within our interval [a,x]=[Ο/6,Ο/3][a,x]=[Ο/6,Ο/3]. Let's find it.
The higher-order differentials of sin(x)sin(x) are given below:
Order | Differential |
|---|---|
1 | cos(x)cos(x) |
2 | βsin(x)βsin(x) |
3 | βcos(x)βcos(x) |
4 | sin(x)sin(x) |
5 | cos(x)cos(x) |
Great! f(5)(x)=cos(x)f(5)(x)=cos(x). Now we need to know what the biggest value of cos(x)cos(x) can be at any point in the range [Ο/6,Ο/3][Ο/6,Ο/3]. We could use some fancy mathematics for this, but we can also reason that
- cos(0)=1cos(0)=1;
- cos(Ο/2)=0cos(Ο/2)=0; and
- cos(x)cos(x) is strictly descending over the range 0β€xβ€Ο/20β€xβ€Ο/2.
So, the largest value of cos(x)cos(x) in our range of [Ο/6,Ο/3][Ο/6,Ο/3] should be closer to x=0x=0, and therefore M=cos(Ο/6)M=cos(Ο/6).
Now, we have everything we need to determine emaxβemaxβ:
Thanks to this result, we know that our error cannot be greater than 0.000284. Let's see if that's true:
The Lagrange error bound is correct! And what's more, if we took the same steps for other values of nn, we can see how the error bound decreases as we approximate f(x)f(x) better:
nn | emaxβemaxβ | Rnβ(x)Rnβ(x) |
|---|---|---|
11 | 0.1187120.118712 | 0.0874240.087424 |
22 | 0.0207190.020719 | 0.0188850.018885 |
33 | 0.0027120.002712 | 0.0018330.001833 |
44 | 0.0002840.000284 | 0.0002670.000267 |
55 | 2.478505β 10β52.478505β 10β5 | 1.608669β 10β51.608669β 10β5 |
66 | 1.853917β 10β61.853917β 10β6 | 1.777034β 10β61.777034β 10β6 |
77 | 1.213386β 10β71.213386β 10β7 | 7.688356β 10β87.688356β 10β8 |
88 | 7.059195β 10β97.059195β 10β9 | 6.828675β 10β96.828675β 10β9 |
99 | 3.696186β 10β103.696186β 10β10 | 2.305197β 10β102.305197β 10β10 |
1010 | 1.759380β 10β111.759380β 10β11 | 1.712037β 10β111.712037β 10β11 |
And there you have it. We've shown you how to calculate the Lagrange error bound β now it's your turn!
FAQs
- What is the Lagrange error bound?
- The Lagrange error bound is the upper bound on the error that results from approximating a function using the Taylor series. Using more terms from the series reduces the error, but it's rarely zero, and it's hard to calculate directly. The error bound tells us what the largest possible error is. The Lagrange error bound formula is derived from the Taylor remainder theorem.
- What is the Lagrange error bound for f(x) = 1/(1-x) at x=0.1 with a 2nd-order Maclaurin series?
- The Lagrange error bound is 0.0015. We can calculate it with the following steps: Find the values for a, x, and n: a = 0 (since we're using the Maclaurin series); x = 0; and n = 2. Find the largest value of the (n+1)th derivative of f anywhere between a and x. For us, this is 9 β you can do the math to see why. Plug these values into the Lagrange error bound formula.
- What is the Taylor remainder?
- The Taylor remainder is the difference between the Taylor series approximation of a function and the actual function itself. Because the Taylor series is infinitely long, we cannot calculate it conclusively, and it will always remain an approximation of the original function. However, we can put an upper limit on the Taylor remainder, which is called the Lagrange error bound.
- What is M in the Lagrange error bound?
- M represents the largest magnitude value that the (n+1)th derivative of the function f can take on between points a and x when you're approximating the value of f at x with an nth degree Taylor polynomial centered at a.
Related calculators
Remainder
Use the remainder calculator to find the quotient and remainder of division.
Math
Slope
Calculate the slope of a line from two given points using the slope calculator. Discover the slope formula and learn how to find a slope with two points.
Math
Average
Calculate the average (mean) with our user-friendly tool. Discover how to find averages or perform quick calculations effortlessly.
Math
Circumference
Use this free circumference calculator to find the area, circumference and diameter of a circle.
Math