The Lagrange Error Bound for Maclaurin Polynomials
How accurate is your Maclaurin polynomial? Use the Lagrange error bound and the alternating series bound to find the error and how many terms you need.
Error Bounds for Maclaurin Polynomials
You have a Maclaurin polynomial and need to know how far off it is from the real function, and how many terms to add to hit a target accuracy. The Lagrange error bound gives you that answer in one inequality: |R_n(x)| ≤ M|x|^(n+1)/(n+1)!, where M is the maximum of the (n+1)th derivative on the interval between 0 and x. You choose n so that this bound falls below your tolerance.
Two worked examples follow: bounding the error for sin(0.8) and finding how many terms of e^2 you need for error under 0.001. The guide covers the Lagrange remainder, the alternating series error bound as a shortcut when the series alternates, and how to read the error output on a calculator without guessing.
The Remainder Rₙ(x)
The Maclaurin polynomial T_n(x) is a finite truncation of the infinite series. The difference between the true function value f(x) and the polynomial is the remainder R_n(x) = f(x) − T_n(x). For a function that is (n+1) times differentiable, the Lagrange form of the remainder says there exists some c between 0 and x such that R_n(x) = f^(n+1)(c) x^(n+1) / (n+1)!. You do not know c, only that it lies in the interval. That is why the bound uses a maximum M instead of the exact value.
The remainder is not a guess, it is an exact expression. Its size depends on the (n+1)th derivative evaluated at an unknown point c. To turn it into a usable bound, you replace f^(n+1)(c) with the largest possible value of that derivative on the whole interval. That step is what makes the bound safe but often loose.
Lagrange Error Bound
Taylor's inequality (Stewart §11.11) states that if |f^(n+1)(t)| ≤ M for all t between a and x, then |R_n(x)| ≤ M |x−a|^(n+1) / (n+1)!. For a Maclaurin series, a = 0, so the bound becomes |R_n(x)| ≤ M |x|^(n+1) / (n+1)!. The variable M is the maximum absolute value of the (n+1)th derivative on the closed interval from 0 to x.
To apply it you need to find M. For sin x and cos x, all derivatives are bounded by 1, so M = 1 for any x. For e^x, the (n+1)th derivative is e^x, which grows with x; on the interval [0, x] with x > 0, the maximum is e^x, so M = e^x. For ln(1+x) or 1/(1−x), M depends on n and x because the derivatives contain factors of the form 1/(1+c)^(n+1).
Example 1: sin(0.8) with 3 Terms
The Maclaurin series for sin x is x − x³/3! + x⁵/5! − x⁷/7! + … . The third-degree Maclaurin polynomial T_3(x) uses terms up to x³: T_3(x) = x − x³/6. For x = 0.8, T_3(0.8) = 0.8 − 0.512/6 = 0.8 − 0.08533 = 0.71467. The true sin(0.8) is about 0.71736, so the actual error is about 0.00269.
Now apply the Lagrange error bound. The fourth derivative of sin x is sin x (pattern: sin, cos, −sin, −cos, sin). Its maximum on [0, 0.8] is at most 1. So M = 1, n = 3, and the bound is |R_3(0.8)| ≤ 1 · (0.8)⁴ / 4! = 0.4096 / 24 = 0.01707. That is about six times the real error, but it is a valid upper bound. If you needed error under 0.02, this bound tells you 3 terms are enough. If you needed 0.001, you would need more terms.
Alternating Series Error Bound
If the Maclaurin series is an alternating series, terms alternate in sign, absolute values decrease, and the limit of terms is zero, then the error after truncating at the nth term is bounded by the magnitude of the first omitted term. This is the alternating series error bound. It is much simpler than the Lagrange bound because you do not need to find M.
The series for sin x, cos x, arctan x, and ln(1+x) for positive x are alternating. For example, using sin x as above: after the term x³/3!, the next term is x⁵/5! = 0.8⁵/120 = 0.32768/120 = 0.00273. The alternating series error bound says |R_3(0.8)| ≤ 0.00273, which is extremely close to the true error of 0.00269. Compare this to the Lagrange bound of 0.01707, the alternating bound is tighter by a factor of six.
Use the alternating bound whenever the series is alternating and the terms are decreasing. If the series is not alternating (like e^x or 1/(1−x)), you must use the Lagrange bound.
How Many Terms for a Given Accuracy
To answer the question “how many terms maclaurin series do I need?”, you set the error bound less than your target tolerance and solve for n. Because n appears in a factorial, you cannot solve directly, you test values of n until the bound drops below the threshold.
Example 2: e² with Error Under 0.001
The Maclaurin series for e^x is Σ x^n / n!. For x = 2, the remainder after n terms (using the Maclaurin polynomial of degree n) is bounded by M · 2^(n+1) / (n+1)!, where M = e^2 ≈ 7.389 because the derivative is e^x and the maximum on [0, 2] is e². So the bound is 7.389 · 2^(n+1) / (n+1)!.
Test n = 5: bound = 7.389 · 2⁶ / 6! = 7.389 · 64 / 720 = 472.9 / 720 ≈ 0.657. Too high. n = 7: bound = 7.389 · 2⁸ / 8! = 7.389 · 256 / 40320 = 1892 / 40320 ≈ 0.0469. Still above 0.001. n = 9: bound = 7.389 · 2¹⁰ / 10! = 7.389 · 1024 / 3,628,800 = 7568 / 3,628,800 ≈ 0.00209. Almost there. n = 10: bound = 7.389 · 2¹¹ / 11! = 7.389 · 2048 / 39,916,800 = 15140 / 39,916,800 ≈ 0.000379. That is under 0.001. So you need 10 terms (the Maclaurin polynomial of degree 10) to guarantee error under 0.001 for e².
The alternating series bound would have been simpler here, but e^x does not alternate. The Lagrange bound is your only option. Note that the bound is conservative: the true error with 10 terms is much smaller than 0.000379, but the bound guarantees the worst case.
What to Do When the Bound Is Too Large
If testing n = 20 still gives a bound above your tolerance, two things may be wrong. Either x is too far from zero, the Maclaurin series converges slowly far from the center, or the function has a limited radius of convergence. For ln(1+x) at x = 0.9, the series converges but terms shrink slowly; you might need 30 terms for 0.001 accuracy. For 1/(1−x) at x = 0.9, the geometric series needs about 20 terms to get error under 0.001. If x is outside the radius of convergence, x = 2 for 1/(1−x), no number of terms suffices because the series diverges.
Reading the Calculator's Error Output
When you use a Maclaurin series calculator, it typically shows the approximation value, the individual terms, the cumulative sum, and a plot. The error it reports is usually the difference between the true function value (computed by the calculator's built-in function) and the series sum for the number of terms you selected. That is the actual error, not a bound. It tells you exactly how wrong the polynomial is at that specific x.
The Lagrange error bound is always larger than the actual error. If the calculator shows an actual error of 0.0001 and your Lagrange bound says 0.005, the bound is working correctly, it is a worst-case guarantee. The alternating series error bound is often much closer to the actual error, sometimes off by only a few percent.
If the calculator shows an error larger than your Lagrange bound, something is wrong: either you chose the wrong M, you used the wrong n, or the function is not (n+1) times differentiable on the interval. For example, using the Maclaurin series for ln(1+x) at x = 1 gives a convergent alternating series, but the Lagrange bound requires bounding the derivative (1+c)^(−n−1) on [0,1], which is infinite at c = −1, the bound fails because the function is not analytic at x = −1. The calculator will still give a finite error, but the Lagrange bound does not apply cleanly.
Common Questions
What is the difference between the Lagrange remainder and the alternating series error bound?
The Lagrange remainder is an exact expression for the error, R_n(x) = f^(n+1)(c) x^(n+1)/(n+1)!, which you bound using the maximum of the derivative. The alternating series error bound says the error is at most the first omitted term, but only if the series is alternating, terms decrease in absolute value, and the limit of terms is zero. Use Lagrange for any series; use the alternating bound when it applies because it is simpler and often tighter.
How do I find M in the Lagrange error bound?
M is the maximum absolute value of the (n+1)th derivative on the closed interval from 0 to x. For sin and cos, M = 1. For e^x, M = e^x if x > 0, or 1 if x < 0. For ln(1+x), the (n+1)th derivative is ± n!/(1+x)^(n+1), so its maximum on [0, x] with x > 0 is n!/(1)^(n+1) = n!, but that gives a useless bound; instead bound |1/(1+c)|^(n+1) ≤ 1 for c ≥ 0, so M = n!. For x negative, the interval includes values near −1, where the derivative blows up, and the Lagrange bound may not be finite.
Why does the Lagrange error bound sometimes overestimate the error by a factor of 100?
Because you replaced the unknown derivative value f^(n+1)(c) with its maximum possible magnitude on the whole interval. The true c may be near 0 where the derivative is small, but the bound assumes the worst-case c. The factor can be huge, especially for functions like e^x where the derivative grows rapidly. The bound is safe, not tight.
Can I use the alternating series error bound for e^x?
No. The Maclaurin series for e^x has all positive terms, it is not alternating. The alternating series error bound requires alternating signs. For e^x, use the Lagrange error bound.
How many terms of the Maclaurin series for sin x do I need for error under 10^−6 at x = 1?
Use the alternating series error bound. The first omitted term after the nth degree polynomial is the next term in the series. For sin 1, the series is 1 − 1/6 + 1/120 − 1/5040 + 1/362880 − … . The term 1/362880 ≈ 2.76×10^−6, so the error after including terms up to 1/5040 (degree 7) is bounded by 2.76×10^−6, which is above 10^−6. The next term is 1/39,916,800 ≈ 2.51×10^−8, so including terms up to 1/362880 (degree 9) gives error under 10^−6. You need 5 nonzero terms (degree 9).
What does it mean if my calculator shows a larger error than the Lagrange bound I computed?
You made a mistake. The Lagrange bound, when correctly applied, is always an upper bound on the absolute error. Check that you used the correct n, the correct M, and that x lies within the interval where the bound applies. If you used the wrong derivative order (n vs n+1), the bound can be wrong.
Can I use the Lagrange error bound for x outside the radius of convergence?
No. The Lagrange remainder formula assumes the function is (n+1) times differentiable on the interval, but if x is outside the radius of convergence, the Maclaurin series does not converge to the function, and the remainder does not tend to zero as n increases. The bound may still give a finite number, but it is meaningless, adding more terms will not reduce the error.