Choose a Maclaurin Degree for a Required Decimal Accuracy
A worked explanation of choose a maclaurin degree for a required decimal accuracy, including the key limitation and a checkable example.
You Need an Error Bound to Choose a Maclaurin Degree for a Required Decimal Accuracy
You have a function, a target x, and a demand for, say, three correct decimal places. Without an error bound you are guessing, either you waste time computing too many terms or you stop too early and publish a wrong digit. The Lagrange remainder gives you a single inequality that tells you both how many terms to keep and how many decimals your result deserves.
To choose a maclaurin degree for a required decimal accuracy you solve the inequality |R_n(x)| < half the last decimal place. For three decimals that half is 0.0005. For two decimals it is 0.005. The number n that satisfies the bound is the smallest integer you can use, and the bound itself is the largest possible error, so you round the polynomial value to the place where that error disappears. The bound does double duty: it picks the polynomial and it sets the sensible output precision. No bound, no decision.
A Worked Example
Take f(x) = e^x, x = 0.5, and a required accuracy of 0.0005 (three decimal places). The (n+1)th derivative of e^x is e^x itself, so on the interval [0, 0.5] the maximum of |f^(n+1)(t)| is e^0.5 ≈ 1.6487. Taylor's inequality gives |R_n(0.5)| ≤ 1.6487 * (0.5)^(n+1) / (n+1)!.
Test n = 3: (0.5)^4 = 0.0625, divided by 4! = 24 gives 0.002604, times 1.6487 gives 0.00429, too big. n = 4: (0.5)^5 = 0.03125, divided by 5! = 120 gives 0.0002604, times 1.6487 gives 0.000429. That is less than 0.0005, so degree 4 works.
The Maclaurin polynomial of degree 4 for e^0.5 is 1 + 0.5 + 0.5^2/2 + 0.5^3/6 + 0.5^4/24 = 1 + 0.5 + 0.125 + 0.020833 + 0.002604 = 1.64844. The true value is about 1.64872. The error bound is 0.00043, so the true value lies between 1.64801 and 1.64887. Rounding the polynomial value 1.64844 to three decimal places gives 1.648, but the bound says the third decimal could be off by 0.00044, so 1.648 is not safe. You must round to the digit justified by the bound. The bound 0.00043 is less than 0.0005, so three decimal places are safe, and the sensible rounded output is 1.649 (since 1.64844 rounds to 1.648, but the true value could be as high as 1.64887, which rounds to 1.649). The correct rounded result is 1.649.
Calculation Steps
You repeat the inequality test for each candidate n. Start with n = 0 and increase until the bound drops below your threshold. For e^x at x = 0.5 you found n = 4 works. The computation itself is arithmetic: compute (0.5)^(n+1), divide by (n+1)!, multiply by the derivative bound 1.6487, compare to 0.0005. The factorial grows fast, 5! = 120, 6! = 720, so the bound plummets after n = 3.
A rounding calculator would show you the polynomial terms and the error bound side by side, but the logic is the same: the bound tells you the polynomial degree, and the bound also tells you that rounding to three decimal places is honest. If the bound were 0.0009, you could only guarantee two decimal places and would need a higher degree.
Why the Method Works
For alternating Maclaurin series such as sin x or cos x, the error bound is simpler. The alternating series error bound says |R_n(x)| is no larger than the absolute value of the first omitted term, provided the terms decrease in magnitude and approach zero. For sin x at x = 0.5, the series terms are x - x^3/3! + x^5/5! - ... . To get accuracy 0.0005, find the smallest n such that the next term is under 0.0005. The term after the polynomial of degree n is x^(n+2)/(n+2)! (since sin x has only odd powers). For n = 3 (polynomial degree 3, using terms up to x^3), the next term is x^5/5! = 0.5^5/120 = 0.03125/120 = 0.0002604, which is under 0.0005. So degree 3 suffices, and the error bound is 0.00026. The polynomial value is 0.5 - 0.020833 = 0.479167. The true sin 0.5 ≈ 0.479425. Rounding 0.479167 to three decimal places gives 0.479, but the bound says the error is at most 0.00026, so the true value is between 0.47891 and 0.47943. The safe rounded output is 0.479.
This bound is exact, the actual error is never larger than that term, but it applies only when the terms are decreasing and tending to zero. For sin x this holds for all x, but for other alternating series like ln(1+x) you must check the condition at your x before using the shortcut.
Failure Case: When the Lagrange Bound Cannot Determine a Degree
The Lagrange bound fails when the (n+1)th derivative is unbounded on the interval between 0 and x. Consider f(x) = ln(1+x) at x = 0.9. The derivatives are f'(x) = 1/(1+x), f''(x) = -1/(1+x)^2, f'''(x) = 2/(1+x)^3, and so on. On [0, 0.9], each derivative is bounded, the absolute maximum occurs at t = 0, where 1/(1+0) = 1, 1/(1+0)^2 = 1, etc. But try x = -0.9. The interval from 0 to -0.9 includes values where 1+x approaches 0, and the derivatives blow up. For x = -0.9, the interval [0, -0.9] includes t = -0.9, where 1 + t = 0.1, so f^(n+1)(t) = ±n! / (1+t)^(n+1). The maximum on that interval is infinite because the function is not differentiable at t = -1. The Lagrange bound becomes infinite, and you cannot select a degree. You must use the alternating series error bound instead, ln(1+x) is alternating for x in (-1, 0], but even that requires that the terms decrease, which they do only for |x| < 1 and with the right sign pattern. Near x = -1, the series converges slowly and the bound is useless for practical accuracy.
Sensible Output Precision: The Error Bound Decides, Not Your Screen
A calculator shows 1.648438 for e^0.5. That is six decimal places. You do not get to keep all six. The error bound of 0.00043 says the fourth decimal is noise. The correct output is 1.649 rounded to three decimal places, not 1.6484 or 1.64844. The error bound determines the precision.
For sin 0.5, the polynomial gives 0.479167. The alternating series bound of 0.00026 means the error is at most 0.00026, so three decimal places are safe, giving 0.479. If the bound were 0.00004, you could justify four decimal places. The number of digits you report must match the bound, not the length of the polynomial output.
The same rule applies for any Maclaurin polynomial. Compute the error bound first. Then round the polynomial value to the place where the bound is less than five units of that place. For a bound of 0.004, round to two decimals. For 0.00004, round to four. The bound sets the sensible output precision; the polynomial degree is chosen to make that bound small enough.
The Most Common Mistake in Choosing a Maclaurin Degree
The single thing that most often goes wrong is this: a student computes the polynomial, gets a value like 1.64844, and reports 1.6484 as if all four decimals are correct. They never computed the error bound. The error bound might be 0.00043, which means the fourth decimal is noise. Reporting it as 1.6484 is dishonest. The bound must be computed first, then the rounding is determined. Without the bound, you are inventing precision. That is the failure case that this whole method avoids.
Common Questions
How do I find the bound M for the Lagrange remainder?
M is the maximum value of the absolute (n+1)th derivative on the closed interval from 0 to x. For e^x, M = e^|x|. For sin x or cos x, M = 1 (since sine and cosine are bounded by 1). For ln(1+x) with x positive, M = n! / (1+0)^(n+1) = n!. For x negative, the function and its derivatives are unbounded near -1, so the Lagrange bound fails.
Do I always need to use the Lagrange remainder, or can I use the alternating series bound?
Use the alternating series bound only if the series is alternating, the terms decrease in magnitude, and the limit of the terms is zero. For sin x, cos x, and ln(1+x) for x in (-1, 0], the bound applies and is simpler. For e^x, 1/(1-x), sinh x, and cosh x, the series does not alternate, so you must use the Lagrange bound.
What if the Lagrange bound gives a value just barely above my threshold?
Increase the degree by one and test again. The bound drops fast as n increases because of the factorial in the denominator. If the bound is 0.0006 for n = 4 and you need 0.0005, try n = 5. The bound will almost certainly fall below the threshold. Do not round the bound, the inequality must be strict.
Can the Lagrange bound overestimate the error, and does that matter?
Yes, the Lagrange bound often overestimates the true error, sometimes by a factor of ten or more, because M is a worst-case bound across the whole interval. The true error may be much smaller. That is fine: the bound is a guarantee. If the bound is below your threshold, the true error is definitely below it, so you are safe. If the bound is above the threshold, the true error may still be below it, but you cannot assume that, you must either increase the degree or use a tighter bound.
What does sensible output precision mean exactly?
It means you round the polynomial value to the decimal place where the error bound is less than half of that place's value. For three decimal places, the bound must be under 0.0005. If the bound is 0.0004, round to three decimals. If the bound is 0.004, round to two decimals. Do not report more digits than the bound justifies.
What happens if I choose too low a degree?
Your output will be wrong in the last digit you report. For example, if you use degree 3 for e^0.5, the bound is 0.0043, so you can only guarantee two decimal places. If you report 1.648, the third decimal is unreliable. The error bound tells you exactly when you are safe, so never guess.
What about functions like arctan x or (1+x)^p?
Both have Maclaurin series with known radii. For arctan x, the series alternates for |x| ≤ 1, and the alternating series bound applies if the terms decrease. For (1+x)^p, the series is not alternating for all p (it alternates only when p is not a positive integer and x is positive). Use the Lagrange bound there, but note that the derivatives involve falling powers and may be messy to bound. The same method works: find M, set up the inequality, solve for n.