Kod: |
In[1]:=
f[x_]=N[7 Cos[2x] / (3x^2+3x+4)]; Chop[N[Integrate[f[x],{x,-5,5}]]] int[m_] := Module[ {h,s}, h=10/(2m); Return[h/3*( f[-5]+f[5]+ 2Sum[f[-5+2k h],{k,1,m-1}]+ 4Sum[f[-5+(2k-1) h],{k,1,m}] )]; ]; Table[{2m,Chop[int[m]]},{m,2,20}] // TableForm Out[2]= 0.440843 Out[3]//TableForm= 4 3.44094 6 3.15407 8 -0.901064 10 0.975361 12 0.185162 14 0.499876 16 0.434125 18 0.426083 20 0.455297 22 0.429517 24 0.447448 26 0.436871 28 0.442615 30 0.439888 32 0.4411 34 0.440687 36 0.440802 38 0.440825 40 0.440791 |
output generated using printer-friendly topic mod. Vremenska zona: GMT + 01:00.