Simpson Rules: 1 Composite Simpson's 1/3 Rule
Simpson Rules: 1 Composite Simpson's 1/3 Rule
Simpson Rules: 1 Composite Simpson's 1/3 Rule
∫ 0.8
(0.2 + 25x − 200x2 + 675x3 − 900x4 + 400x5 )dx = 1.640533
0
∑
n−1 ∑
n−2
f (x0 ) + 4 f (xi ) + 2 f (xj ) + f (xn )
i=1,3,5 j=2,4,6
I = (b − a) ∗
3n
s1=[]; sum1=0
for i in range(1,n,2):
s1.append(y[i])
sum1=np.sum(s1)
s2=[]; sum2=0
for j in range(2,n-1,2):
s2.append(y[j])
sum2=np.sum(s2)
I=(b-a)*(y[0]+4*sum1+2*sum2+y[-1])/(3*n)