Let's take Melody's picture idea a little further. Imagine you have the following function, f(x), which is comprised of a sequence of straight lines (this is an arbitrary function I made up off the top of my head - it isn't specially chosen):

The gradient, df(x)/dx, of this function is easily plotted:

The integral of df(x)/dx with respect to x from, say x = 1 to x = 7, is just the area under the curve. It is easy to calculate because df(x)/dx is just constructed from a number of constants (i.e. horizontal straight lines). We can see that the area under df(x)/dx from x = 1 to x = 7 is 9.
Using the plot of f(x) we can also see this is the same as the difference between f(7) and f(1). i.e. f(7) - f(1) = 9
You can change the values of the gradients of the various sections of f(x) as much as you like and you will always find the area under the corresponding graph of df(x)/dx will equal f(x2) - f(x1). Try it!
Now a general curve can be thought of as an infinite number of (infinitely small) straight line segments, so the same result applies to "curvy" curves as well!
.