Calculators, Power Series and Chebyshev Polynomials: Unterschied zwischen den Versionen
(→Conclusion --- The point of the story) |
(→Using Chebyshev polynomials) |
||
Zeile 110: | Zeile 110: | ||
From the way we developed it, it is reasonable that this series will represent <math>\sin x\,</math> for values of | From the way we developed it, it is reasonable that this series will represent <math>\sin x\,</math> for values of | ||
− | <math>x\,</math> at and near 0 (say for <math>|x|<1</math>, as for all the earlier examples), so it is surprising to know that it | + | <math>x\,</math> at and near 0 (say for <math>|x|<1\,</math>, as for all the earlier examples), so it is surprising to know that it |
can be shown that the series represents <math>\sin x\,</math> for ''all'' values of <math>x\,</math>. Then partial sums of the | can be shown that the series represents <math>\sin x\,</math> for ''all'' values of <math>x\,</math>. Then partial sums of the | ||
series, obtained by stopping after some finite number of terms, should give polynomial functions that can be used to find | series, obtained by stopping after some finite number of terms, should give polynomial functions that can be used to find | ||
Zeile 121: | Zeile 121: | ||
<math> S_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}. </math> | <math> S_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}. </math> | ||
− | The cubic polynomial <math>S_3(x)</math> and the quintic polynomial <math>S_5(x)</math> are plotted below, along with <math>\sin | + | The cubic polynomial <math>S_3(x)\,</math> and the quintic polynomial <math>S_5(x)\,</math> are plotted below, along with <math>\sin |
x\,</math>, all for <math>-2\le x\le 2</math>. It can be seen that these are both very good approximations for <math>-1\le | x\,</math>, all for <math>-2\le x\le 2</math>. It can be seen that these are both very good approximations for <math>-1\le | ||
− | x\le1</math>, say, but not so good near <math>x=\pm2</math>. The quintic <math>S_5</math> is much better than the cubic | + | x\le1</math>, say, but not so good near <math>x=\pm2</math>. The quintic <math>S_5\,</math> is much better than the cubic |
− | <math>S_3</math> in these regions, as might be expected, but can we do better than <math>S_3</math> with some other cubic | + | <math>S_3\,</math> in these regions, as might be expected, but can we do better than <math>S_3\,</math> with some other cubic |
polynomial function? | polynomial function? | ||
− | When <math>x=1</math>, for example, the error in using the cubic is | + | When <math>x=1\,</math>, for example, the error in using the cubic is |
− | <math> \sin1-(1-\frac16) \approx 0.0081. </math> | + | <math> \sin1-\left(1-\frac16\right) \approx 0.0081. </math> |
We will construct a cubic polynomial function <math>F\,</math> whose values differ from those of <math>\sin x\,</math> by less | We will construct a cubic polynomial function <math>F\,</math> whose values differ from those of <math>\sin x\,</math> by less | ||
− | than 0.001 for <math>|x|\le1</math>. The curve <math>y=F(x)</math> has been included in the graph below for <math>|x|\le2</math>, | + | than 0.001 for <math>|x|\le1\,</math>. The curve <math>y=F(x)\,</math> has been included in the graph below for <math>|x|\le2\,</math>, |
− | and it is clear from the graph that this curve is closer to that of <math>y=\sin x</math> than <math>y=S_3(x)</math> is, even | + | and it is clear from the graph that this curve is closer to that of <math>y=\sin x\,</math> than <math>y=S_3(x)\,</math> is, even |
near <math>x=\pm2</math>. | near <math>x=\pm2</math>. | ||
Zeile 142: | Zeile 142: | ||
for integer <math>k\ge0</math>. By properties of the cosine, they all have domain <math>[-1,1]</math> and their range is also in | for integer <math>k\ge0</math>. By properties of the cosine, they all have domain <math>[-1,1]</math> and their range is also in | ||
− | <math>[-1,1]</math>. Putting <math>k=0</math> and <math>k=1</math> gives | + | <math>[-1,1]</math>. Putting <math>k=0\,</math> and <math>k=1\,</math> gives |
<math> T_0(x)=1, \qquad T_1(x)=x, </math> | <math> T_0(x)=1, \qquad T_1(x)=x, </math> | ||
Zeile 149: | Zeile 149: | ||
the case, recall that | the case, recall that | ||
− | <math> \cos(k+1)\theta=\cos(k\theta+\theta)=\cos k\theta\cos\theta-\sin k\theta\sin\theta, </math> | + | <math> \cos (k+1)\theta = \cos(k\theta+\theta) = \cos k\theta\cos\theta-\sin k\theta\sin\theta, \ </math> |
− | <math> \cos(k-1)\theta=\cos(k\theta-\theta)=\cos k\theta\cos\theta+\sin k\theta\sin\theta, </math> | + | <math> \cos (k-1)\theta = \cos(k\theta-\theta) = \cos k\theta\cos\theta+\sin k\theta\sin\theta, \ </math> |
from which, after adding these, | from which, after adding these, | ||
− | <math> \cos(k+1)\theta=2\cos\theta\cos k\theta-\cos(k-1)\theta. </math> | + | <math> \cos (k+1) \theta=2\cos\theta\cos k\theta-\cos(k-1)\theta. \ </math> |
Therefore, | Therefore, | ||
Zeile 163: | Zeile 163: | ||
Now put <math>k=1,\ 2,\ 3,\ \ldots</math> and obtain | Now put <math>k=1,\ 2,\ 3,\ \ldots</math> and obtain | ||
− | <math> T_2(x)=2x^2-1, </math> | + | <math> T_2(x)=2x^2-1, \ </math> |
<math> T_3(x)=4x^3-3x, \qquad\qquad (5) </math> | <math> T_3(x)=4x^3-3x, \qquad\qquad (5) </math> | ||
− | <math> T_4(x)=8x^4-8x^2+1, </math> | + | <math> T_4(x)=8x^4-8x^2+1, \ </math> |
<math> T_5(x)=16x^5-20x^3+5x, \qquad\qquad (6) </math> | <math> T_5(x)=16x^5-20x^3+5x, \qquad\qquad (6) </math> | ||
Zeile 175: | Zeile 175: | ||
Returning to our problem of approximating <math>\sin x\,</math> for <math>|x|\le1</math> with error less than 0.001, we notice | Returning to our problem of approximating <math>\sin x\,</math> for <math>|x|\le1</math> with error less than 0.001, we notice | ||
− | first that the quintic <math>S_5</math> has that property. In fact, | + | first that the quintic <math>S_5\,</math> has that property. In fact, |
<math> \left|\sin1-S_5(1)\right|=\left|\sin1-\left(1-\frac16+\frac1{120}\right)\right| | <math> \left|\sin1-S_5(1)\right|=\left|\sin1-\left(1-\frac16+\frac1{120}\right)\right| | ||
Zeile 196: | Zeile 196: | ||
=\frac{169}{192}T_1(x)-\frac5{128}T_3(x)+\frac1{1920}T_5(x). </math> | =\frac{169}{192}T_1(x)-\frac5{128}T_3(x)+\frac1{1920}T_5(x). </math> | ||
− | Since <math>|T_5(x)|\le1</math> when <math>|x|\le1</math>, omitting the term <math>\ | + | Since <math>|T_5(x)|\le1</math> when <math>|x|\le1</math>, omitting the term <math>\frac1{1920}T_5(x)</math> will admit a |
− | further error of at most <math>\ | + | further error of at most <math>\frac1{1920}<0.0006</math> which, using (7), gives a total error less than 0.0008, still within |
our bound of 0.001. Now, | our bound of 0.001. Now, | ||
Zeile 211: | Zeile 211: | ||
are closer to values of <math>\sin x\,</math>, for <math>|x|\le2</math>, than are values of the cubic function | are closer to values of <math>\sin x\,</math>, for <math>|x|\le2</math>, than are values of the cubic function | ||
− | <math>x-\ | + | <math>x-\frac16x^3</math>, which is obtained from the power series representation of <math>\sin x\,</math>. |
===Conclusion --- The point of the story=== | ===Conclusion --- The point of the story=== |
Version vom 28. Juni 2010, 09:42 Uhr
Originating author: Graeme Cohen
Inhaltsverzeichnis |
Introduction --- Functions on a calculator
Of all the familiar functions, such as trigonometric, exponential and logarithmic functions, surely the simplest to evaluate are polynomial functions. One purpose of this note is to introduce the concept of a power series, which can be thought of in the first place as a polynomial function of infinite degree. In particular, we will deduce a series for and will see how to improve on the the most straightforward way of approximating its values. This simplest way uses the polynomials obtained by truncating the power series. The improvement will involve Chebyshev polynomials, which are used in many ways for a similar purpose and in many other applications, as well. When a calculator gives values of trigonometric or exponential or logarithmic functions it is doing so by evaluating polynomial functions that are sufficiently good approximations. So we have the second purpose of this note: the realization that although the mathematics here would have been known to Felix Klein at the beginning of the 20th century, new applications are always arising and the one described here, to finding values of functions on a calculator, would clearly not have been known to him. (We point out that, for trigonometric functions, the CORDIC algorithm is in fact often the preferred method of evaluation---the subject of another article here, perhaps.)
In the spirit of Felix Klein, there will be some reliance on a graphical approach.
Manipulations with geometric series
The geometric series is the simplest power series. The sum of the series exists when . In fact,
The general form of a power series is
so the geometric series above is a power series in which all the coefficients , , , , are equal to 1. In this case, since the series converges to when , we say that the function , where
has the series expansion , or that is represented by this series. We are interested initially to show some other functions that can be represented by power series.
Many such functions may be obtained directly from the result in (1). For example, by replacing by , we immediately have a series representation for the function :
We can differentiate both sides of (1) to give a series representation of the function :
We can also integrate both sides of (1). Multiply through by (for convenience), then write for and integrate with respect to from 0 to , where :
so
So this gives a series representation of the function , . In the same way, from (2),
Much of what we have done here (and will do later) requires justification, but we can leave that to the textbooks.
A series for the sine function
We will show next how to find a power series representation for the sine function.
In general terms, we can write
Put , and immediately we have . Differentiate both sides of (4):
Again put , giving . Keep differentiating and putting :
so ,
so ,
so ,
so .
In this way, we can find a formula for all the coefficients , , , , namely,
for , 1, 2, . (The coefficients of even index and those of odd index are specified separately.)
Thus
This is the power series representation that we were after.
Using Chebyshev polynomials
From the way we developed it, it is reasonable that this series will represent for values of at and near 0 (say for , as for all the earlier examples), so it is surprising to know that it can be shown that the series represents for all values of . Then partial sums of the series, obtained by stopping after some finite number of terms, should give polynomial functions that can be used to find approximate values of the sine function, such as you find in tables of trigonometric functions or as output on a calculator.
For example, write
The cubic polynomial and the quintic polynomial are plotted below, along with , all for . It can be seen that these are both very good approximations for , say, but not so good near . The quintic is much better than the cubic in these regions, as might be expected, but can we do better than with some other cubic polynomial function?
When , for example, the error in using the cubic is
We will construct a cubic polynomial function whose values differ from those of by less than 0.001 for . The curve has been included in the graph below for , and it is clear from the graph that this curve is closer to that of than is, even near .
We will use Chebyshev polynomials to construct . These are used extensively in approximation problems, as we are doing here. They are the functions given by
for integer . By properties of the cosine, they all have domain and their range is also in . Putting and gives
but it is not immediately apparent that the are indeed polynomials for . To see that this is the case, recall that
from which, after adding these,
Therefore,
Now put and obtain
and so on, clearly obtaining a polynomial each time. As polynomials, we no longer need to think of their domains as restricted to .
Returning to our problem of approximating for with error less than 0.001, we notice first that the quintic has that property. In fact,
and the theory of alternating infinite series shows that throughout our interval, as certainly seems reasonable from the figure. We next express in terms of Chebyshev polynomials. Using (5) and (6), we have
so
Since when , omitting the term will admit a further error of at most which, using (7), gives a total error less than 0.0008, still within our bound of 0.001. Now,
and the cubic function we end with is the function we called .
We have thus shown, partly through a graphical justification, that values of the cubic function , where
are closer to values of , for , than are values of the cubic function , which is obtained from the power series representation of .
Conclusion --- The point of the story
The effectiveness of Chebyshev polynomials for such a purpose arises from properties of the cosine function. They tell us in particular that for all integers and for , we have . Pafnuty Lvovich Chebyshev was Russian; he introduced these polynomials in a paper in 1854. His surname is often given alternatively as Tchebycheff, and this is why the polynomials are denoted with 's.
The procedure above is called economization of power series. As mentioned in the Introduction, there are other methods of speeding up the calculation of values of the trigonometric functions, such as the Cordic algorithm for the sine function, but economization is considered to be essential for slowly converging series such as that for established in (3), above. Perhaps the point of this story is that, very often, the obvious approach is not necessarily best.