The answer to that question is basically the fundamental theorem of calculus.
To show enough to make this plausible, imagine you break the interval [a,b] into pieces. Call the pieces [a,x1], [x1,x2], [x2,x3] ... [xN-1,xN], [xN,b].
Assume they are equally large intervals and that xi+1-xi=h. Now...