Introduction to Integrals

An integral of a function f on an interval [a,b] means the area under the graph of f between a and b. In the below picture, it is the area of the green part.

Integrating f means calculating the integral of f. Also, "integral from a to b" means "integral on [a,b]". The notation abf(x) dx means the integral of f from a to b. (I'll explain later why there's dx after the function being integrated.)

For example, 022x dx represents an area under the line y=2x. It looks like this:

Because this is a triangle with base 2 and height 4, we can use the triangle area formula (TODO) to get 022x dx=242=4. In practice, we usually don't use area formulas to calculate integrals, but quite the opposite; once we have a good way to calculate integrals, we can use that to calculate areas that we otherwise couldn't calculate.

So far we haven't defined what exactly area means, and it hasn't bothered us too much. But for doing integrals, defining what exactly we mean with the "area" under a graph is worth the effort, so soon we'll define the integral properly. We'll also discuss whether all functions can be integrated.

Partition

Let's split the interval [a,b] into finitely many smaller parts. In the below picture, we have 6 parts.

This kind of splitting is called a partition of the interval [a,b]. The partition numbers don't need to split the partition into equally sized parts; the sizes may differ, like they do in the above picture.

As a special case, the interval [a,b] can be split into just one part, [a,b] itself, and that's also a valid partition.

Upper sums and lower sums

Let's calculate the maximum value of f on each part of our partition and draw that with a line above the interval. Doing this for all parts looks like this:

Now we see rectangles and notice that integralfirst rectangle area+second rectangle area++last rectangle areaupper sum. The sum on the right is called the upper sum because the rectangles go above the graph.

The widths of rectangles are distances between the partition numbers and the heights are maximum values of the function on intervals between the partition numbers. For example, if two partition numbers next to each other are p and q, like in the picture, then the corresponding rectangle area is upper sum rectangle area=(qp)(maximum of f on [p,q]). With this, we can write the upper sum without relying on area. Also, this works when f gets negative values, even though negative areas don't make sense.

In the picture, the above inequality would also work with < instead of , but this isn't always the case. For any function whose graph is a horizontal line, the integral will be equal to the upper sum.

If we had used minimums instead, it looks like this:

These rectangles are different than the ones for upper sum. The difference is that now we use minimums instead of maximums, so the rectangle area above the red line in the picture is lower sum rectangle area=(qp)(minimum of f on [p,q]). Because all rectangles of the lower sum are below the graph, we have integralfirst rectangle area+second rectangle area++last rectangle arealower sum. By putting the results together, we get lower sumintegralupper sum. Next we'll use this to calculate integrals, and later we'll use this to define what exactly integrals are.

Also, this is where the notation abf(x) dx came from; it's intended to remind about summing rectangle areas. The integral sign is a stretched S for Sum, dx denotes the width of a rectangle, and f(x) is the corresponding height. Then f(x) dx is a rectangle area, and abf(x) dx as a whole means summing those rectangle areas.

TODO: verify the "stretched S" thing from wikipedia

Example: Integral of 3

We calculate 243 dx. Let f(x)=3. Based on the below picture, the integral should be the rectangle area (42)3=6.

We choose the partition 2,3,4. The maximum of f on any interval is 3, so we get upper sum=(32)3+(43)3=13+13=6. The minimum of f on any interval is also 3, so the lower sum is 6 as well. Because lower sumintegralupper sum, we have 6243 dx6, which means that 243 dx=6.

We can also do this using a partition of just two numbers, 2 and 4. Then we get just one rectangle area calculation. upper sum=(42)3=6 The rest goes similarly as with the 2,3,4 partition.

Example: Integral of 2x

In the beginning of this page we used a triangle area to calculate 022x dx. Let's calculate that again with upper and lower sums.

Let f(x)=2x. We partition the interval [0,2] into 5 equally sized parts. Because each part has length 25 (that is, interval length 2 divided into 5 equal pieces), the first two numbers of the partition will be 0 and 25. The number after those will be 25+25=45. By continuing like this, we see that the partition we want is 05, 25, 45, 65, 85, 105. The upper sum looks like this:

Because f is increasing, it gets its maximum value on any closed interval at the right end point of the interval, and those are used as the upper sum rectangle heights. For example, the height of the first rectangle is the maximum of f on [0,2/5], which is f(2/5). By doing this for all rectangles, we get upper sum=25f(25)+25f(45)+25f(65)+25f(85)+25f(105)=25225+25245+25265+25285+252105=4.8. Note that there's no f(0) in the upper sum, because there's no rectangle with height f(0). For the lower sum, there is a "flat" rectangle with height f(0)=0, but there's no rectangle with height f(10/5).

Now we get lower sum=25f(0)+25f(25)+25f(45)+25f(65)+25f(85)=0+25225+25245+25265+25285=3.2. Because lower sumintegralupper sum, we have 3.2022x dx4.8. In this case, the integral happens to be the average of the lower and upper sums, but usually that doesn't work (TODO).

These calculations tell something about the integral, but we still don't know what exactly it is. Next we experiment with different partitions and figure out what works best.

Instead of partitioning the interval [0,2] into 5 equally sized parts, we now partition it into n equally sized parts. The width of each rectangle will be 2/n instead of 2/5, because 2 is the length of the interval. The interval starts at 0, so the first two partition numbers will be 0 and 2/n. Then we have 2/n+2/n=4/n, next 4/n+2/n=6/n, and so on, so the partition is 0n, 2n, 4n, , 2nn. The last number is 2, and I have written it as 2n/n to match how other partition numbers look. With this partition, we get upper sum=2nf(2n)+2nf(4n)+2nf(6n)++2nf(2nn)=2n(22n+24n+26n++22nn)=2n2(2n+4n+6n++2nn)=4n2+4++2nn=4n2(1+2++n)n. With the sum formula 1+2++n=n(n+1)/2, we get upper sum=4n2n(n+1)2n=4n(n+1)=4+4n, so we must have integral4+4n. Because this works for all positive integers, it also works when we take a limit (TODO), and we get integrallimn(upper sum)=limn(4+4n)=4. Just like before, the lower sum is otherwise the same as the upper sum except that it also has 2nf(0n)=2n20n=0, which doesn't affect anything, and it doesn't have the last added number of the upper sum, which is 2nf(2nn)=2nf(2)=2n4=8n. This means that we can conveniently get the lower sum by subtracting that last number from the upper sum: lower sum=upper sum8n=4+4n8n=4+48n=44n Now we get integrallimn(lower sum)=limn(44n)=4. By putting everything together, we finally get 4022x dx4 which shows that 022x dx=4.

Example: Integral of x2

We calculate 02x2 dx. Unlike in the previous examples, we can't just calculate the area in the graph without an integral, because we don't have a formula for the area under a parabola. We finally have a reason for working with integrals.

Let f(x)=x2. Just like in the previous example, we partition the interval [0,2] into n equally sized parts 0n, 2n, 4n, , 2nn. The upper and lower sums look like this for n=8:

Because f is increasing on the interval [0,2], we get upper sum=2nf(2n)+2nf(4n)+2nf(6n)++2nf(2nn)=2n((2n)2+(4n)2+(6n)2++(2nn)2)=2n(21)2+(22)2++(2n)2n2=2n22(12+22++n2)n2. With the sum of squares formula, we get upper sum=2n22n(n+1)(2n+1)6n2=166(n+1)(n+1/2)n2=83(nn+1n)(nn+1/2n)=83(1+1n)(1+1/2n), so integrallimn(upper sum)=83(1+0)(1+0)=83. Again, we have an increasing function f with f(0)=0, so lower sum=upper sum2nf(2nn)=upper sum2n22=upper sum8n, and limn(lower sum)=limn(upper sum)limn8n=830=83. We now get 8302x2 dx83, so we must have 02x2 dx=83.