Approximating sin13 with Taylor Series using TI84 (n=150)

Click For Summary

Homework Help Overview

The discussion revolves around approximating the sine of 13 using the Taylor series expansion on a TI-84 calculator, specifically with a high number of terms (n=150). Participants are exploring the challenges of implementing this approximation due to the limitations of the calculator, particularly concerning factorial calculations.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss the use of the Taylor series formula for sine and the implications of using a large number of terms. There are questions about how to handle potential overflow errors when calculating factorials for high values of n. Some suggest using Horner's scheme for polynomial evaluation as a possible approach.

Discussion Status

The discussion is ongoing, with participants sharing insights and experiences related to programming the TI-84. Some have successfully implemented their code and noted that their results align closely with the calculator's output for sin(13). However, there are still questions about specific coding techniques and the effectiveness of different approaches.

Contextual Notes

Participants are working under the constraints of the calculator's capabilities, particularly regarding handling large factorials and the need for efficient programming techniques. There is also a consideration of whether the angle is in radians or degrees, which affects the Taylor series terms used.

kakashi1027
Messages
8
Reaction score
0

Homework Statement


approximate sin13 by using the Taylor series using the TI84.
Add for n=150


Homework Equations


the infinite sums for sinx is ((-1)^n)(x^(2n+1)/(2n+1)!)



The Attempt at a Solution


I'm new to programming so i don't have any idea on where to start.
I was thinking about using the For(n,0) command, but I have no idea on how to bypass the overflow error since at n=150, it is 301!, which I'm pretty sure the calc won't do.
 
Physics news on Phys.org
I assume that is 13 radians, since 13° should only take a few terms of the Taylor series for sin(13°).

The Taylor Polynomial you need to use is a 301 degree polynomial with 150 non-zero terms.

Use Horner's scheme (see http://en.wikipedia.org/wiki/Horner_scheme" ) to evaluate the polynomial starting at the highest degree term in a "nested" fashion. There will be no need to use an exponential (except for (-1)n) and no need to use the factorial function.

As an example of this, consider the Polynomial: [tex]P(x)=4+3x-7x^2+7x^3-5x^4+9x^5-2x^6[/tex]

Factor x5out of the two highest degree terms: [tex]P(x)=4+3x-7x^2+7x^3-5x^4+x^5(9-2x)[/tex]

Now factor x4 out of the last two "trems": [tex]P(x)=4+3x-7x^2+7x^3+x^4(-5+x(9-2x))[/tex]

Continuing: [tex]P(x)=4+3x-7x^2+x^3(7+x(-5+x(9-2x)))[/tex]

etc, until you get: [tex]P(x)=4+x(3+x(-7+x(7+x(-5+x(9-2x)))))[/tex]

Now, to see how this works: Try to calculate P(5) without a calculator. Not too easy with the standard form of P(x)

[tex]P(5)=4+3(5)-7(5)^2+7(5)^3-5(5)^4+9(5)^5-2(5)^6[/tex]

Now try this (from the inside out): [tex]P(5)=4+5(3+5(-7+5(7+5(-5+5(9-2\cdot5)))))[/tex]

9-2(5)=-1, then -5+5(-1)=-10, then 7+5(-10)=-43, then -7+5(-43)=-7-215=-222, (well that is a bit much), then 3+5(-222)=3-1110=-1107, then 4+5(-1107)=4-5535=-5531

Look at the 4 highest degree terms of the Taylor Polynomial you want to evaluate:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^2}{294\cdot295}\left(1\,+\,\frac{(-1)^{148}\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)^{149}\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)^{150}\,x^2}{300\cdot301}\right)\right)\right)[/tex]

Of course x=13.

Programming my not be all that easy if you haven't done any.
 
Last edited by a moderator:
SammyS said:
..
Look at the 4 highest degree terms of the Taylor Polynomial you want to evaluate:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

There is a error in the next line:

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^2}{294\cdot295}\left(1\,+\,\frac{(-1)^{148}\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)^{149}\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)^{150}\,x^2}{300\cdot301}\right)\right)\right)[/tex]
Starting with: [tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\,+\,\frac{(-1)^{150}\,x^{301}}{301!}[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\,+\,\frac{(-1)^{148}\,x^{297}}{297!}\,+\,\frac{(-1)^{149}\,x^{299}}{299!}\left(1\,+\,\frac{(-1)\,x^2}{(300)(301)}\right)[/tex]

[tex]\sin(x)\approx \dots\,+\,\frac{(-1)^{147}\,x^{295}}{295!}\left(1\,+\,\frac{(-1)\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)\,x^2}{300\cdot301}\right)\right)\right)[/tex]

Getting the degree 1 term is a little tricky.

[tex]\sin(x)\approx x\,\left(1+\,\frac{(-1)\,x^{2}}{2\cdot3}\left(\dots\,\left(1\,+\,\frac{(-1)\,x^2}{296\cdot297}\left(1\,+\,\frac{(-1)\,x^2}{298\cdot299}\left(1\,+\,\frac{(-1)\,x^2}{300\cdot301}\right)\right)\right)\dots\right)\right)[/tex]

But I have been having trouble getting calculator program to give good results.

Note added in edit:

I got it to work!

The result agrees with the calculator's value of sin(13) to the 8th decimal place.
 
Last edited:
hi, thanks for the responce!
what was your code that you used on the calculator? did you use the for loop?
 
Yes, I used a "For loop".

I have a TI-86, which is an older model than a TI-84. The manual's description of the "For loop" made me skeptical of its ability to count down, so used For(I,0,N-1) , then computed N-I → J, and used J as my index.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
1
Views
3K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K