Ask your own question, for FREE!
Mathematics 18 Online
OpenStudy (bibby):

(c) Since π/4 = arctan, you can find the value of π/4 using your expansion. How many terms of the expansion would you have to add in order to obtain π correct to four decimal places?

OpenStudy (bibby):

I got the Maclaurin series for arctan(x) = \[\sum_{n=0}^{\inf} \dfrac{ (-1^n)x^{2n+1} }{ 2n+1 }\] Since it's alternating, when should the approximation end?

OpenStudy (bibby):

\[x-\frac{ x^3 }{3 } + \frac{ x^5 }{5 } -\frac{ x^7 }{7 } + ...\] how far does this go?

OpenStudy (bibby):

lol, no. I mean if it's alternating you cut off right before the one you don't want to include, right? would that be x^1001/1001?

OpenStudy (anonymous):

What do you mean by how far does this go?

OpenStudy (bibby):

the expansion. For approximation

OpenStudy (bibby):

.0001 whoops. Just how much terms I'd have to add up to get an accuracy of .0001

OpenStudy (anonymous):

Couldn't we find out what the decimal approximation of pi over four is and then add enough terms of the series to become within .0001 of that value.

OpenStudy (bibby):

oooh I mean arctan 1

OpenStudy (anonymous):

Right, so arctan(1) = pi/4

OpenStudy (anonymous):

So we can write out a few terms for arctan(x) using the series you noted above and plug in 1 for x.

OpenStudy (bibby):

exactly. \[1 - \frac{ 1 }{ 3 } + \frac{ 1 }{ 5 } - \frac{ 1 }{ 7 } +\frac{ 1 }{ 9 } - \frac{ 1 }{ 11 }+...\] and then what?

OpenStudy (anonymous):

We know \[\pi/4 = 0.78539...\] Find the value of n where the absolute value of the difference between the nth partial sum of the series and pi/4 is less than or equal to .0001

OpenStudy (bibby):

I'm admittedly struggling with taking the next step...

OpenStudy (anonymous):

It's okay. What we want to do is start calculating each partial sum, like so,\[1-\frac{ 1 }{ 3 } = \frac{ 2 }{ 3}\approx.66666\]\[1-\frac{ 1 }{ 3 } + \frac{ 1 }{ 5 } = \frac{ 2 }{ 3}\ + \frac{ 1 }{ 5}\approx.66666 + .2 = .86666\] \[1-\frac{ 1 }{ 3 } + \frac{ 1 }{ 5 } = \frac{ 13 }{ 15}\ - \frac{ 1 }{ 7}\approx.86666 - .14285 = .72389\] Observe that the more terms we add, the closer we get to the actual value of pi/4. Once we calculate enough terms, some absolute difference of that nth partial sum and the actual value of pi/4 will be less than or equal to .0001

OpenStudy (bibby):

Could I create a program to automate this and see how close I get?

OpenStudy (anonymous):

Wow. That's a great question. I'm sure we could. Do you know how to code in c?

OpenStudy (bibby):

I'll use c++ gimme a few minutes. Terribly sorry I'm so slow lol

OpenStudy (anonymous):

Great. I'm interested in seeing how accurate you can get it.

OpenStudy (bibby):

I immediately regret this suggestion ... double sum = 0; for(int i=1;i<8;i+=2) { sum += ((pow((-1),i))/(2*i+1)); } ...

OpenStudy (bibby):

is not working

OpenStudy (anonymous):

I was going to use some if statements to dictate when to add or subtract.

OpenStudy (bibby):

I was trying something like using a counter "if(counter%2!=0)" but that would not work at all lol

OpenStudy (anonymous):

Right that is what i'm trying lol

OpenStudy (anonymous):

Mine works Wanna see?

OpenStudy (anonymous):

It's in c though. Not too different.

OpenStudy (bibby):

I'll manage with the syntax and whatnot

OpenStudy (anonymous):

//pi over 4 approx #include<stdio.h> #include<stdlib.h> #include<math.h.> #define PI_OVER_FOUR 0.78539816339744830961566084581988 int main(){ int ans, i; double sum = 0, error = 0; printf("How many sums would you like to calculate?\n"); scanf("%d",&ans); for (i = 0; i < ans; i++){ if (i%2 == 0) sum += 1/(double)(2*i + 1); else sum -= 1/(double)(2*i + 1); } printf("We calculated %lf\n",sum); printf("Our error is %lf\n", fabs(sum - PI_OVER_FOUR)); return 0; }

OpenStudy (bibby):

I think I've stolen your code well enough. This is what I get when I input 8. 0.754268 Our error is 0.0311302

OpenStudy (anonymous):

Yes. Apparently, we have to sum a LOT of numbers to get close the error bound.

OpenStudy (bibby):

There's an identity we can use that makes it a lot easier to approximate \[π/4=4\arctan \frac{ 1 }{ 5 }−\arctan \frac{ 1 }{ 239 }\]

OpenStudy (anonymous):

Hmmm. What identity is this?

OpenStudy (bibby):

The euler-machin one IIRC

OpenStudy (anonymous):

That's pretty interesting. I have to go. Do you understand the ideas here?

OpenStudy (bibby):

Yep. Sorry for holding onto you for so damn long. I feel terrible. I'll get some buddies to medal you appropriately. thanks for stepping me through this!

OpenStudy (anonymous):

It's not a problem. This was really fun. We should talk again. Good luck on any exams you may have.

OpenStudy (bibby):

PM me if you'd like. The feeling's mutual :)

OpenStudy (anonymous):

Great, see ya!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!