function trp = trapezoidRuleUniformGrid(f,a,b,h) % I have implemented theorem(2.18),,,algorith 2.5 page 70 epperson book sum = 0.5*(f(a)+f(b)) ; n = (b-a)/h ; for i = 1 : n-1 x = a + i * h ; sum = sum + f(x) ; end trp = h * sum ;