Simpson[a0_,b0_,m0_]:=
Module[{},
a=N[a0];
b=N[b0];
m=N[m0];
h=(b-a)/(2 m);
k=1;
SumEven=0;
For[k=1,km-1,k++,
SumEven=SumEven+f[a+2*h*k];];
k=1;
SumOdd=0;
For[k=1,km,k++,
SumOdd=SumOdd+f[a+h (2 k-1)];];
Return[h/3 (f[a]+f[b]+2* SumEven+4 *SumOdd)];];
f[x_]:=
Simpson[-3,4,100]
1.15089×106

Download Filenya Disini