Simpson
Simpson
1
Q. Approximate the integral ∫0 1+1x x using Simpson’s rule with n = 2.
Return[approxintegral];;
1
f[x_] := ; N[simpson[0, 1, 2, f]]
1+x
Out[2]= 0.694444
1
Q. Approximate the integral ∫0 1+1x x using composite Simpson’s rule with n = 4,6,8.
1 1
In[6]:= actualvalue = x
0 1+x
Out[6]= Log[2]
In[7]:= N[actualvalue]
Out[7]= 0.693147