a=1;b=2;f[x_]:=1.0/x;ip=Integrate[f[x],{x,a,b}]

it[n_]:=(h=(b-a)/n;s=0;For[i=0,i≤n,i++,s+=f[a+i*h]*If[i==0||i==n,1,2]];
s*h/2);
is[n_]:=(h=(b-a)/n;s=0;For[i=0,i≤n,i++,s+=f[a+i*h]*If[i==0||i==n,1,2+2*Mod[i,2]]];
s*h/3);

it[4]

is[4]

tt=Table[{n,it[n]-ip},{n,2,100,2}];
ts=Table[{n,is[n]-ip},{n,2,100,2}];
ListLogLogPlot[{tt,ts}]

Fit[Log[tt],{1,x},x]

Fit[Log[ts],{1,x},x]