⬤
⬤
Examples -
Read Me -
Tools
|
sin(0.02) - 0.02 | = -0.0196509341567 … | [1] | ||
How many terms of Maclaurin series do I need | ||||
to calculate sin(x)-x at x=0.02 with the same result? | ||||
First term: | ||||
sin(0) - 0 | = 0.0 | [2] | ||
Plus second term: | ||||
ans + (cos(0) - 1) * 0.02 | = 0.0 | [3] | ||
Plus third term: | ||||
ans + ( - sin(0)) / 2 * 0.02**2 | = 0.0 | [4] | ||
Plus fourth term: | ||||
ans - cos(0) / fact(3) * 0.02**3 | = -0.00000133333333333 … | [5] | ||
Odd terms have sin(0) therefore they can be skipped. | ||||
Plus sixth term: | ||||
ans + cos(0) / fact(5) * 0.02**5 | = -0.00000133330666667 … | [6] | ||
Plus eighth term: | ||||
ans - cos(0) / fact(7) * 0.02**7 | = -0.00000133330666692 … | [7] | ||
Eight terms! So with eight terms, what is the error? | ||||
[1] - [7] | = -0.019649600850 … | [8] | ||
Of course much of this error is the 10th term: | ||||
cos(0) / fact(9) * 0.02**9 | = 1.41093474427E-21 … | [9] | ||