10 PRINT "INTEGRATION: GAUSSIAN QUADRATURE"
20 PRINT
30 REM - ENTER FUNCTION HERE (deffnc(x)="function")
35 DEF FNC(X)=X[3
39 REM - ABCISSAS AND WEIGHT FACTORS FOR 20-POINT GUASSIAN INTEGRATION
40 DATA .076526521,.15275339,.22778585,.14917299,.37370609
50 DATA .14209611,.510867,.13168864,.63605368,.11819453
60 DATA .74633191,.10193012,.83911697,.083276742,.91223443
70 DATA .062672048,.96397193,.04060143,.9931286,.017614007
80 PRINT "INTEGRATION LIMITS (lower,UPPER)";
90 INPUT X,Y
100 PRINT "NUMBER OF INTERVALS";
110 INPUT N
120 S=(Y-X)/N/2
130 T=X+S
140 R=0
149 REM - COMPUTE INTEGRAL FOR EACH SUBINTERVAL
150 FOR I=1 TO N
160 P=0
169 REM - COMPUTE SUMMATION FACTOR FOR EACH SUBINTERVAL
170 FOR J=1 TO 10
180 READ A,B
190 P=P+B*(FNC(S*A+T)+FNC(T-S*A))
200 NEXT J
210 RESTORE
220 R=R+P*S
230 T=T+2*S
240 NEXT I
250 PRINT "INTEGRAL =";R
260 PRINT
270 PRINT "CHANGE DATA AND RECOMPUTE?"
280 PRINT "(0=NO, 1=NEW INTEGRATION LIMITS, 2=NEW NO OF INTERVALS)";
290 INPUT S
300 IF S=1 THEN 80
310 IF S=2 THEN 100
320 END
