# Lab 1.pdf - In[3:=*Julian Velandia 126 Lab 1*Problem 1*a...

• Lab Report
• 2

This preview shows pages 1–2. Sign up to view the full content.

In[3]:= (* Julian Velandia 126 Lab 1 *) (* Problem 1 *) (* a *) s [ x _ , k _] : = Sum [(- 1 ) ^n * x^ ( 2 n + 1 ) / (( 2 n + 1 )!) , { n, 0, k }] In[4]:= s [ Pi, 11 ] Out[4]= π - π 3 6 + π 5 120 - π 7 5040 + π 9 362 880 - π 11 39 916 800 + π 13 6 227 020 800 - π 15 1 307 674 368 000 + π 17 355 687 428 096 000 - π 19 121 645 100 408 832 000 + π 21 51 090 942 171 709 440 000 - π 23 25 852 016 738 884 976 640 000 In[5]:= N [ s [ Pi, 11 ] , 10 ] Out[5]= - 1.706186195 × 10 - 13 (* b *) Plot [{ Sin [ x ] , s [ x, 0 ] , s [ x, 1 ] , s [ x, 2 ] , s [ x, 3 ] , s [ x, 4 ] , s [ x, 5 ]} , { x, - 4, 4 }] - 4 - 2 2 4 - 4 - 2 2 4 In[28]:= (* c *) R [ x _ , k _] : = Abs [ Sin [ x ] - s [ x, k ]] In[29]:= N [ R [ 4.10578, 34 ] , 10 ] Out[29]= 2.55351 × 10 - 15 (* d *) In[30]:= For [ k = 0, R [ 1.327, k ] ≥ 10^ (- 12 ) , k ++ , m = k + 1 ] ; m Out[30]= 7 (* Problem 2 *) (* a *) For [ k = 1, Sum [ 2 / n, { n, 1, k }] < 5, k ++ , m = k + 1 ] ; m 7 Printed by Wolfram Mathematica Student Edition

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Summer '07
• Mikulevicius

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern