RSS

simpsons1/3

%simpsons1/3
syms x
fx =x^2+x+2;
a = 0;
b = 2;
fy = int(fx,x);
fya = subs(fy,x,a);
fyb = subs(fy,x,b);
ha = fyb-fya
fxa = subs(fx,x,a);
fxb = subs(fx,x,b);
c = (a+b)/2;
fxc = subs(fx,x,c);
hk = (b-a)/6*(fxa+fxb+4*fxc)
ea = abs((ha-hk)/ha)
%boleh juga hk = h/3 *(fxa+fxb+4*fxc)

0 komentar:

Posting Komentar