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

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: P(x)=4+3x-7x^2+7x^3-5x^4+9x^5-2x^6

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

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

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

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

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

P(5)=4+3(5)-7(5)^2+7(5)^3-5(5)^4+9(5)^5-2(5)^6

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

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:

\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!}

\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)

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:

\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!}

There is a error in the next line:

\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)
Starting with: \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!}

\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)

\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)

Getting the degree 1 term is a little tricky.

\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)

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.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...

Similar threads

Replies
5
Views
3K
Replies
11
Views
3K
Replies
6
Views
4K
Replies
2
Views
2K
Replies
2
Views
1K
Replies
1
Views
1K
Back
Top