Tutorials › AP Calculus › Bounding Sine and Cosine Approximation Errors

Taylor Series and Error Bounds · Tutorial 891 of 999

Bounding Sine and Cosine Approximation Errors

Use derivative bounds or alternating remainders to estimate sine and cosine Taylor errors, and check which hypotheses make each estimate valid.

Advanced 10 min read

What You'll Learn

  • Identify the first omitted term in sine and cosine Maclaurin polynomials.
  • Apply the Lagrange remainder bound using the bounded derivatives of sine and cosine.
  • Check whether omitted alternating-series terms decrease in magnitude.
  • Compare Lagrange and alternating-series error estimates.
  • Use an error bound to place the function value in a guaranteed interval.

Why Bound Trigonometric Approximation Errors?

A Taylor polynomial can give a convenient approximation to \(\sin x\) or \(\cos x\), but an approximation is more useful when we know how far it may be from the true value. An error bound gives a guaranteed maximum discrepancy without requiring the exact function value.

For sine and cosine, two useful approaches are the Lagrange remainder theorem and the alternating-series estimate. The Lagrange bound uses a bound on a derivative over the interval between the center and the input. The alternating-series bound uses the sizes of the omitted terms, and it requires those terms to decrease.

The Sine and Cosine Taylor Polynomials

The Maclaurin series for sine and cosine are centered at \(0\). Their Taylor polynomials contain only odd powers for sine and only even powers for cosine:

$$ \sin x=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\cdots $$
$$ \cos x=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\cdots $$

If we keep the sine terms through \(x^{2m+1}\), the polynomial is

$$ S_m(x)=\sum_{k=0}^{m}(-1)^k\frac{x^{2k+1}}{(2k+1)!}. $$

If we keep the cosine terms through \(x^{2m}\), the polynomial is

$$ C_m(x)=\sum_{k=0}^{m}(-1)^k\frac{x^{2k}}{(2k)!}. $$

The first omitted term is not always the same thing as the Lagrange bound. For example, after \(S_m\), the first omitted series term has magnitude \(\frac{|x|^{2m+3}}{(2m+3)!}\), while the general Lagrange bound for a polynomial of degree \(2m+1\) uses the power \(2m+2\).

The Lagrange Remainder Bound

Theorem: If \(f\) has continuous derivatives through order \(n+1\) on the interval between \(0\) and \(x\), its degree-\(n\) Maclaurin polynomial \(P_n\) satisfies \[ f(x)-P_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}x^{n+1} \] for some \(\xi\) between \(0\) and \(x\). Thus, if \(|f^{(n+1)}(t)|\le M\) throughout that interval, then \[ |f(x)-P_n(x)|\le \frac{M|x|^{n+1}}{(n+1)!}. \]

The derivatives of sine and cosine cycle among \(\sin\), \(\cos\), \(-\sin\), and \(-\cos\). Since their absolute values are at most \(1\) for every real input, we may take \(M=1\) for either function and any derivative order. In particular, for sine or cosine,

$$ |f(x)-P_n(x)|\le \frac{|x|^{n+1}}{(n+1)!}. $$

This estimate applies on any finite interval between \(0\) and \(x\), including when \(x\) is negative. It can be valid even when the magnitudes of the omitted series terms do not decrease.

The Alternating-Series Remainder Bound

A different estimate can be sharper when the omitted terms alternate in sign and decrease in magnitude. For a fixed positive input, the sine and cosine series alternate. To use the alternating-series estimate on the tail after a chosen polynomial, the magnitudes of the omitted terms must be nonincreasing from the first omitted term onward and must tend to \(0\). The estimate then says that the absolute error is at most the magnitude of the first omitted term.

The term-size checks are straightforward. For sine, the ratio of the magnitude of the term with index \(k+1\) to the term with index \(k\) is

$$ \frac{|x|^{2k+3}/(2k+3)!}{|x|^{2k+1}/(2k+1)!} = \frac{|x|^2}{(2k+2)(2k+3)}. $$

For cosine, the corresponding ratio is

$$ \frac{|x|^{2k+2}/(2k+2)!}{|x|^{2k}/(2k)!} = \frac{|x|^2}{(2k+1)(2k+2)}. $$

It is enough to check that the ratio from the first omitted term to the next is at most \(1\). Subsequent denominators grow, so all later ratios are then at most \(1\) as well. The terms also tend to \(0\), since the factorial denominator eventually grows faster than the fixed power of \(|x|\).

Alternating-series estimate for these polynomials: After \(S_m(x)\), check \[ \frac{|x|^2}{(2m+4)(2m+5)}\le 1. \] If the condition holds, then \[ |\sin x-S_m(x)|\le \frac{|x|^{2m+3}}{(2m+3)!}. \] After \(C_m(x)\), check \[ \frac{|x|^2}{(2m+3)(2m+4)}\le 1. \] If the condition holds, then \[ |\cos x-C_m(x)|\le \frac{|x|^{2m+2}}{(2m+2)!}. \]

For negative \(x\), the same absolute error estimates hold: sine is odd, cosine is even, and the magnitudes of the series terms depend on \(|x|\). At \(x=0\), both errors are \(0\).

Why the Alternating Bound Works

Here is a justification of the alternating-series estimate. Suppose the tail begins with \(a_j-a_{j+1}+a_{j+2}-\cdots\), where the numbers \(a_j,a_{j+1},\ldots\) are nonnegative, nonincreasing, and tend to \(0\). Consider finite partial sums of this tail. An odd-length partial sum can be grouped as

$$ (a_j-a_{j+1})+(a_{j+2}-a_{j+3})+\cdots+a_{j+2r}\ge 0. $$

The same sum can be written as

$$ a_j-(a_{j+1}-a_{j+2})-\cdots-(a_{j+2r-1}-a_{j+2r})\le a_j. $$

Each difference in parentheses is nonnegative because the magnitudes decrease. Thus every odd-length partial sum is between \(0\) and \(a_j\). For an even-length partial sum, grouping adjacent terms gives

$$ (a_j-a_{j+1})+(a_{j+2}-a_{j+3})+\cdots+(a_{j+2r}-a_{j+2r+1})\ge 0, $$

and rewriting it as \(a_j\) minus nonnegative differences and the final \(a_{j+2r+1}\) shows it is at most \(a_j\). Therefore every finite partial sum of the tail lies between \(0\) and \(a_j\). Taking the limit gives the same bounds for the infinite tail. The tail has the sign of its first term, and its magnitude is at most \(a_j\), the first omitted magnitude. This is why the condition that the magnitudes decrease matters.

Worked Example: Bounding a Sine Approximation

Worked Example: Bounding a Sine Approximation

Approximate \(\sin(0.5)\) with the degree-three Maclaurin polynomial and find an error bound using both methods.

The polynomial is

$$ S_1(0.5)=0.5-\frac{(0.5)^3}{3!} =\frac12-\frac{1}{48} =\frac{23}{48}. $$

For the alternating estimate, the first omitted term has magnitude

$$ \frac{(0.5)^5}{5!} =\frac{1/32}{120} =\frac{1}{3840}. $$

The ratio of this term to the next sine-term magnitude is \[ \frac{(0.5)^2}{6\cdot 7}=\frac{1}{168}<1. \] All subsequent ratios are smaller, so the omitted magnitudes decrease. Therefore \[ \left|\sin(0.5)-\frac{23}{48}\right|\le\frac{1}{3840}. \] Because the next omitted term is positive, the value lies in \[ \frac{23}{48}-\frac{1}{3840} =\frac{613}{1280} \le \sin(0.5)\le\frac{23}{48}. \]

The Lagrange bound for degree \(3\) is \[ \left|\sin(0.5)-S_1(0.5)\right| \le\frac{(0.5)^4}{4!} =\frac{1/16}{24} =\frac{1}{384}. \] This is valid because the fourth derivative of sine has absolute value at most \(1\) between \(0\) and \(0.5\). The alternating bound, \(1/3840\), is sharper here. As a check on the arithmetic, \(23/48=1840/3840\), and subtracting \(1/3840\) gives \(1839/3840=613/1280\).

Worked Example: Bounding a Cosine Approximation

Worked Example: Bounding a Cosine Approximation

Use the degree-two Maclaurin polynomial to approximate \(\cos(1)\), and find an error bound using both methods.

The polynomial and its value are

$$ C_1(1)=1-\frac{1^2}{2!}=\frac12. $$

The first omitted cosine term has magnitude \[ \frac{1^4}{4!}=\frac{1}{24}. \] The ratio from this omitted term to the next is \[ \frac{1^2}{5\cdot 6}=\frac{1}{30}<1, \] and later ratios are smaller. The alternating estimate applies, so \[ \left|\cos(1)-\frac12\right|\le\frac{1}{24}. \] The next omitted term is positive, which gives \[ \frac12\le\cos(1)\le\frac12+\frac{1}{24}=\frac{13}{24}. \]

For the Lagrange bound, \(n=2\) and \(M=1\), so \[ \left|\cos(1)-C_1(1)\right| \le\frac{1^3}{3!}=\frac16. \] The derivative condition holds throughout \([0,1]\). The Lagrange estimate is valid but three times as large as the alternating estimate: \(1/6=4/24\), while the latter is \(1/24\). The interval endpoints also check directly: \(13/24-1/2=1/24\).

Worked Example: When the Alternating Estimate Does Not Apply

Worked Example: When the Alternating Estimate Does Not Apply

Consider approximating \(\cos(5)\) by the degree-zero polynomial \(C_0(5)=1\). The first two omitted term magnitudes are

$$ \frac{5^2}{2!}=\frac{25}{2} \qquad\text{and}\qquad \frac{5^4}{4!}=\frac{625}{24}. $$

The second is larger, since \(625/24>300/24=25/2\). Equivalently, their ratio is \(25/(3\cdot4)=25/12>1\). The omitted terms do not decrease from the start, so the alternating-series estimate cannot be used to claim that the error is at most \(25/2\).

The Lagrange bound still applies. For \(f(x)=\cos x\), the first derivative is \(-\sin x\), whose absolute value is at most \(1\) on \([0,5]\). Thus \(M=1\), \(n=0\), and \[ |\cos(5)-1|\le \frac{1\cdot 5^1}{1!}=5. \] This bound is valid even though it is not especially sharp. It illustrates why checking the hypotheses is essential: the Lagrange bound needs a derivative bound, while the alternating bound needs decreasing omitted terms.

Choosing and Checking an Error Bound

For a given input and polynomial, first identify the degree of the polynomial and the interval between \(0\) and the input. Then apply the Lagrange estimate using \(|f^{(n+1)}|\le1\), or check the ratio of consecutive omitted term magnitudes before using the alternating estimate. Both bounds are guarantees only when their respective conditions are met.

1
Identify the polynomial and first omitted term.
For sine and cosine, keep track of the fact that one of the two power parities is absent.
2
Check the Lagrange hypotheses.
Use the interval between \(0\) and \(x\); sine and cosine derivatives have absolute value at most \(1\) there.
3
Check the alternating-term condition.
Compare the first omitted magnitude with the next one. If the ratio is at most \(1\), later ratios are also at most \(1\).
4
Choose a valid estimate.
If both apply, compare their numerical bounds. The smaller valid bound gives a tighter guaranteed error.

A Common Mistake

A frequent error is to use the first omitted term as an error bound merely because the series alternates. Alternation by itself is not enough. In the \(\cos(5)\) example, the first omitted magnitude is \(25/2\), but the next is \(625/24\), which is larger. The alternating-series estimate has not been justified, so it is not valid to cite it as the reason the error is bounded by \(25/2\), even if that numerical bound happens to exceed the actual error.

The correction is to check the omitted-term ratios or use a different valid method. For \(\cos(5)\), the derivative bound gives \(|\cos(5)-1|\le5\). In other problems, the alternating estimate may be much sharper, as it was for \(\sin(0.5)\) and \(\cos(1)\).

Check Your Understanding

For each question, identify the relevant polynomial, verify the conditions for the proposed estimate, and show the main numerical steps.

  1. For the degree-three sine polynomial at \(x=1\), what is the first omitted term magnitude, and does the alternating-series estimate apply?
  2. For the degree-two cosine polynomial at \(x=2\), calculate the Lagrange error bound.
  3. After \(C_1(x)\), write the ratio of the next cosine-term magnitude to the first omitted magnitude.
  4. Why does a bound on \(|f^{(n+1)}|\) allow the Lagrange remainder to be bounded?
  5. What condition must be checked before using the first omitted term to bound an alternating-series error?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon