Ifflx)and its first four derivatives are continuours on/a,b/, the en b f(rdx-o (b-a) NC(3) 2880 Where Ma is an upper bound on f(4(x on la, b] note that iff(lx)is a cubic polynomial, then f4(x)=0 and so Simposn's rule is exact. This is somewhat surprising because The rule is based on the integration of a guadratic interpolant
If f(x) and its first four derivatives are continuours on [a,b], then 4 5 (3) 2880 ( ) ( ) M b a f x dx Q b a NC − − Where M4 is an upper bound on |f(4)(x)| on [a,b] Note that if f(x) is a cubic polynomial, then f (4)(x)=0 and so Simposn's rule is exact. This is somewhat surprising because The rule is based on the integration of a quadratic interpolant
d+2 f(x)dx=OCm)+cmf(d+(n b where c is a small constant and d= m-1 if m is even m if m is even If/+(x)≤Ma d+2 f(x)dx-ONc(m<c b-a
2 ( 1) ( ) 1 ( ) ( ) + + − − = + d d NC m m b a m b a f x dx Q c f where cm is a small constant, and − = if is even 1 if is even m m m m d 2 ( ) 1 1 ( ) + + − − − d NC m m d b a m b a f x dx Q c M 1 ( 1) If ( ) + + d d f x M
function error Ncerror(a, b, m, M ifm==2.d=1:c=-1/12 elseif m==3. d=3: C=-1/90 elseif n==4.d=3:c=-3/80: elseif m==5,d=5;c=-8/945; elseif n=6.d=5:c=-275/12096 elseif m=7,d=7;c=-9/1400 elseif m=8,d=7;c=-8183/518400; elseif n=9.d=9:c=-2368467775 elseif n=10.d=9:c=-173/14620 d=11:c=-1346350/326918592 end h=(b-a)/(m-) error=abs(c*M*h(d+2))
function error = NCerror(a,b,m,M) if m==2, d=1; c = -1/12; elseif m==3, d=3; c = -1/90; elseif m==4, d=3; c = -3/80; elseif m==5, d=5; c = -8/945; elseif m==6, d=5; c = -275/12096; elseif m==7, d=7; c = -9/1400; elseif m==8, d=7; c = -8183/518400; elseif m==9, d=9; c = -2368/467775; elseif m==10, d=9; c = -173/14620; else d=11; c = -1346350/326918592; end; h = (b-a)/(m-1); error = abs(c*M*h^(d+2));