CHAPTER 8 PROJECT

CHAPTER 8 PROJECT How Calculators Calculate

634

The sine function is used in many scientific applications, so a calculator/computer must be able to evaluate it with lightning-fast speed.

While we know how to find the exact value of the sine function for many numbers, such as \(0,\) \(\dfrac{\pi }{6}, \dfrac{\pi }{2},\) and so on, we have no methodology for finding the exact value of \(\sin 3\) (which should be close to \(\sin \pi )\) or \(\sin 1.5\) (which should be close to \(\sin \dfrac{\pi }{2}).\) Since the sine function can be evaluated at any real number, we first use some of its properties to restrict its domain to something more manageable.

  1. Explain why we can evaluate \(\sin x\) for any \(x\) using only the interval \(\left[ -\dfrac{\pi }{2},\dfrac{\pi }{2}\right]\). (We could restrict that domain further, but this will work for now. See Problem 6 below.)
  2. Use the Maclaurin expansion for \(\sin x\) to find an approximation for \(\sin \dfrac{1}{2}\) correct to within \(10^{-5}.\) Compare your approximation to the one your calculator/computer provides. How many terms of the series do you need to obtain this accuracy?
  3. Find an approximation for \(\sin \dfrac{3}{2}\) correct to within \(10^{-5}.\) How many terms of the series do you need to obtain this accuracy?
  4. Explain why the approximation in Problem 3 requires more terms than that of Problem 2.
  5. Represent \(\sin x\) as a Taylor expansion about \(\dfrac{\pi }{4}.\)
  6. Explain why we can evaluate \(\sin x\) for any \(x\) using only the interval \(\left[ 0,\dfrac{\pi }{2}\right]\).
  7. Use the result of Problem 5 to find an approximation for \(\sin \dfrac{1}{2}\) correct to within \(10^{-5}.\) Compare the result with the values your calculator/computer supplies for \(\sin \dfrac{1}{2},\) as well as with the result from the Maclaurin approximation obtained in Problem 2. How many terms of the series do you need for the approximation?
  8. Use the Taylor expansion to find an approximation for \(\sin \dfrac{3}{2}\) correct to within \(10^{-5}.\) Compare the result with the value your calculator/computer supplies for \(\sin \dfrac{3}{2},\) as well as with the result from the Maclaurin approximation obtained in Problem 3. How many terms of the series do you need for the approximation?

    The answers to Problems 3 and 8 reveal why Maclaurin series or Taylor series are not used to approximate the value of most functions. But often the methods used are similar. For example, a Chebyshev polynomial approximation to the sine function on the interval \(\left[ -\dfrac{\pi }{2},\dfrac{\pi }{2}\right]\) still has the form of a Maclaurin series, but it was designed to converge more uniformly than the Maclaurin series, so that it can be expected to give answers near \(\dfrac{\pi }{2}\) that are roughly as accurate as those near zero.

    Chebyshev polynomials are commonly found in mathematical libraries for calculators/computers. For example, the widely used Gnu Compiler Collection* uses Chebyshev polynomials to evaluate trigonometric functions. The Chebyshev polynomial approximation of degree 7 for the sine function is \[ \begin{eqnarray*} S_{7}(x) &=& 0.9999966013x-0.1666482357x^{3} \nonumber\\ && +\, 0.008306286146x^{5} - 0.1836274858\times 10^{-3}x^{7} \qquad \tag{1} \end{eqnarray*} \]

    635

    \(*\)For more information on the Gnu Compiler Collection (GCC), go to https://www.gnu.org/software/gcc/

    The Chebyshev polynomials are designed to remain close to a function across an entire closed interval. They seek to keep the approximation within a specified distance of the function being approximated at every point of that interval. If \(S_{n}\) is a Chebyshev approximation of degree \(n\) to the sine function on \(\left[ -\dfrac{\pi }{2},\dfrac{\pi }{2}\right] ,\) then the error estimate in using \(S_{n}(x)\) is given by \[ \begin{equation*} \hspace{-1.5pc}\max\limits_{-\pi /2\,\leq \,x\,\leq \,\pi /2}\left\vert \sin x-S_{n}(x) \right\vert \leq \dfrac{\left( \dfrac{\pi }{2}\right) ^{n+1}}{ 2^{n}(n+1) !} \hspace{1.5pc} \tag{2} \end{equation*} \]

    Like most error estimates of this type, it gives an upper bound to the error.

  9. Use the Chebyshev polynomial approximation in (1) for \(x=\dfrac{1}{2}\) and \(x=\dfrac{3}{2}\). Compare the results with the values your calculator/computer supplies for \(\sin \dfrac{1}{2}\) and \(\sin \dfrac{3}{2},\) as well as with the results from the Maclaurin approximations and the Taylor series approximations obtained in Problems 2, 3, 7, and 8.
  10. Define \(E_{7}(x) =\vert \sin x-S_{7}(x) \vert\). Use graphing technology to graph \(E_{7}\) on \(\left[ -\dfrac{\pi }{2},\dfrac{\pi }{2}\right].\)
  11. Find the local maximum and local minimum values of \(E_{7}\) on \(\left[ -\dfrac{\pi }{2},\dfrac{\pi }{2}\right].\) Compare these numbers with the error estimate in equation (2), and discuss the characteristics of the error.
  12. Which approximation for the sine function would be preferable: the Maclaurin approximation, the Taylor approximation, or the Chebyshev approximation? Why?