# Riemann sums and integral approximation

If you have a hard time understanding the seeming magic way of calculating areas using integrals, you are not alone. Not until integration was justified by the analogy to sums of infinitesimally narrow segments, so-called Riemann sums, did the majority of mathematicians start accepting the method.

## Intro

Bernhard Riemann used to be an anxious boy, suffering from a severe lack of self confidence. He repeatedly experienced nervous breakdowns, and despised public speaking. Fame was nothing he craved at all.

He did not let this timidity take charge of his life though and managed to become a praised professor and lecturer.

His true passion for the job lied not in the lecturing part though, but in solving mathematical problems. This also turned out to be what put him under the big spotlight.

Massive attention was rightfully given to him after presenting the first ever rigorous formulation of the integral, based on the concept of the Riemann sum.

## Concept

How can you approximate the area under a curve?

Chances are you thought about cutting up the area in a bunch of rectangles, or maybe into trapezoids. It might seem like a 'basic' method, but it's very robust!

By summing up the areas of the rectangles, you'll end up with an approximation of the area. This sum is called - you guessed it - a Riemann sum.

## Math

Riemann sums is a way of approximating the integral:

by dividing up the interval into smaller pieces of width . Then, we can approximate the integral by summing up the rectangles with width and height

If a function happens to be continuous on the closed interval , then this approximation will be exactly equal to the integral when we take the limit,

## Riemann sums

So you've got a funny-looking piece of plastic, looking a bit like a parabola.

Now you want to know how much it weighs. All of a sudden, a voice from above says that the bit of plastic weighs grams per cm. So it all comes down to computing the area of the plastic, really.

### Ok, but how?

First, you'll find a function which describes the shape of the piece of plastic. Now imagine taking a sword and chopping up the piece of plastic into tiny rectangles, like so:

Then you can approximate the area by adding up the areas of the rectangles. And this, my friends, is a Riemann sum.

The approximation of the area is a Riemann sum

Since you're a bit clumsy, each rectangle isn't necessarily as wide. But you can still approximate the area with all of those rectangles. As for the height, you can pick any value between the rectangle's edges and use . I mean, the width of each rectangle is already quite small, so who cares about which you pick? Put formally, you'd approximate the area with an expression like this:

where is between and , and is the width. Here and is the smallest and largest on the interval we are approximating.

As the width of all rectangles decreases, your approximation gets better and better. By taking the limit as the width goes to - you get an integral. This is, by and large, the definition of an integral. In this case, your integral comes out to be:

The weight of the bit of plastic is thus:

and just like that, we're done!

## Upper and lower sums

You're being given a ride to school by your mom. Let's say you'd like to know the braking distance as the car stops in front of a red light. Questions about braking distances come up all the time on the driver's licence test, so this might actually be of some practical importance.

You don't want to get bogged down in the rules of physics, trying to construct some formula for the velocity. Instead, you use a hands-on approach.

Here's the idea. Cast an eye on the speedometer every seconds. Since you're super human, you're able to remember all these velocities. To approximate the distance traveled in those seconds, multiply speed with time. Then add up all of those distances.

But you can approximate the distance in two ways, as shown in the pics.

This approximation, made up by the bars above the graph, is called an upper sum. To compute the distance over the first interval, you use the higher velocity. Mathematicians say the smallest upper sum is called the infimum of the upper sum.

Here's the lower sum. To compute the distance over the first interval, you use the smaller velocity. This is called the supremum of the lower sum, meaning the largest lower sum.

The actual distance is somewhere in between the upper sum and the lower sum.

After having a cup of coffee, you're more alert. Now you can remember the speed and perform all "speed times time" multiplications for smaller time intervals, every seconds. Then the difference between the upper sum and the lower sum decreases. If you can't have the supremum of some upper sum be equal to the infimum of a lower sum, the function isn't integrable.

The idea of upper sums and lower sums extends to graphs which assume both positive and negative values. If the function corresponds to the velocity, and the value is negative, it means you're moving backwards.

Here's the lower sum:

And analogously, here's the upper sum:

## The Cauchy integral criterion

If is a monotonically decreasing function, then we have:

Say that we want to approximate the area under the curve for such a function between two integers and . We could split the interval into sub-intervals of width , whereafter we construct an upper sum on the interval by always considering the left point of each sub-interval, and a lower sum by taking the right points.

Since the right point of one interval is the left point of the next one, the only two bars that will not be included in both sums are then the first one in the upper sum and the last one in the lower.

Now the actual area, obtained by integrating , can be encapsulated by the two sums according to this inequality:

Although not immediately obvious, this implies the following:

In words, we can squeeze a sum of monotonically decreasing terms in between two integrals. This concept is employed to determine convergence of a series in the Cauchy integral test.

### The Cauchy integral test for series

The Cauchy integral test

Let be a monotonically decreasing function, and let be an integer. Then the series:

converges if:

converges, and:

diverges if:

diverges.

### Example 1

Prove that the series below diverge:

To find out if the series diverge, we squeeze the series between two integrals:

Next we study our integral:

We then find that:

Therefore, the function diverge.

### Example 2

Show that the series below converge.

We close the function in, using integrals:

Next we evaluate the integrals:

Doing so, we find the following:

which proves that the series must converge.

As we saw in both examples, the convergence or divergence of the integrals determine if the series converge or diverge.