# num_int - B Using Numerical Integration to Approximate A...

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

Using Numerical Integration to Approximate Z B A f ( x ) dx The following programs for the TI-83 and TI-85/86 compute three different approximations of the integral. Program Input: * A, the lower limit of integration B, the upper limit of integration N, the number of segments of equal length into which [ A, B ] is divided (except for Simpson’s Rule; see footnote **) f ( x ) , the function being integrated. Program Output: a list of three numbers: MP , TR and SI , where MP = the approximation using the Midpoint Rule; TR = the approximation using the Trapezoidal Rule; SI = the approximation using Simpson’s Rule. The Program Itself: for the TI-83 PROGRAM: NUMINT :Prompt A,B,N :(B-A)/N H :0 S :0 T :For(I,1,N,1) :S + Y 1 (A+I*H) S :T + Y 1 (A+(I-.5)*H) T :End :H*T U :H*(S+.5*(Y 1 (A)-Y 1 (B))) V :Disp U :Disp V :Disp (2*U+V)/3 :Stop for the TI-85/86 PROGRAM: NUMINT :InpSt ‘‘enter function’’,STRING :St>Eq (STRING,Y 1 ) :prompt A,B,N :(B-A)/N H :0 S :0 T :For(I,1,N,1) :evalF(Y 1 ,x,A+I*H) F :S + F S :evalF(Y 1 ,x,A+(I-.5)*H) G :T + G T :End :H*T U :evalF(Y 1 ,x,A) C :evalF(Y 1 ,x,B) D :H*(S+.5*(C-D)) V :(2*U+V)/3 W :Disp U :Disp V :Disp W :Stop Comments: 1. After entering the program, it is essential to test it for typographical errors by calculating some special cases (try R 1 0 x n dx for n = 1 , 2 , 3).

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ 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