# Calculus: Integrals I

## Left Riemann Sums

The previous sections covered the derivative, which gives the instantaneous rate of change of a function. These next few sections focus on the integral, which measures the area between a function and the $x$-axis over a particular region.

The area under a curve can be interesting for all kinds of reasons. One reason might be sheer mathematical curiosity, an all too common virtue in today's society. We can measure the area of circles and trapezoids, but what about more unusual curvy shapes? Another reason might be practical - the area under the curve provides valuable information. Engineers, physicists, medical scientists, and even business people often need to figure out precisely this kind of information. A third reason might be compulsion - students must learn about integrals whether they like it or not. In any event, we're studying this stuff, so deal with it.

The area under a function ("curve") between two values $a$ and $b$ is called the definite integral of a function from $a$ to $b$ and is expressed using the following notation:

$$\displaystyle\int\limits_{a}^{b}f(x) \, dx$$

The squiggly $\int$ symbol is the integral sign. The specially placed values $a$ and $b$ denote that the integral is to be evaluated in the region $[a,b]$. Don't worry about the $dx$ just yet. The expression as a whole evaluates to the exact area under the function $f(x)$.

So, how does one compute the definite integral of a function over a particular region? The first approach, which is the topic of this section, is to approximate the area using rectangles. The area of a rectangle is easy to calculate, so if we can fit a bunch of rectangles under the curve, we'll be able to come up with an estimate of the area by summing up the areas of all the rectangles. While this is not a precise answer, it is simple to understand and simple (if tedious) to calculate. See the following picture for a visualization of this approach:

The left Riemann sum approximates the area under a curve by summing up the area of rectangles placed under the curve. A particular left Riemann sum uses $N$ rectangles, where $N$ is some integer no less than 1. Rectangles are evenly spaced and are all identical in width. This width is simply the length of the interval, $b-a$, divided by the total number of rectangles, $N$. Hence the width is $\dfrac{b-a}{N}$. This width is also commonly written as $\Delta x$ for short. Each rectangle is anchored to the function by its top left corner, hence the term left Riemann sum. The area of each rectangle is then the value of the function in the top left corner of the rectangle (length) times $\Delta x$ (width). In order to express the sum of all these rectangle areas, we use the summation notation covered in the previous section. Putting it all together gives us the following approximation:

$$\displaystyle\int\limits_{a}^{b} f(x) \, dx \approx \sum\limits_{i=0}^{N-1} f(a+\Delta x \cdot i) \Delta x$$

The more rectangles that are used, the closer the approximation becomes, and the more costly the approximation becomes to compute. Look at the following pictures. The blue regions are the rectangles in the sum, and the red region is the difference between the approximation and the true area. As intuition would expect, the magnitude of this error decreases as the number of rectangles increases.

## Problems

1. Estimate $\displaystyle\int\limits_{0}^{2} 4x + 5 \, dx$   where   $N=4$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{2-0}{4} \\ \Delta x = \dfrac{1}{2} \\$

Step 2: Calculate the sum:

$\displaystyle\int\limits_{0}^{2} 4x + 5 \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(0+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{0}^{2} 4x + 5 \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{3} f(0+i\cdot\Delta x) \\ \displaystyle\int\limits_{0}^{2} 4x + 5 \, dx \approx \dfrac{1}{2} \left( (4(0) + 5) + \left(4\dfrac{1}{2} + 5\right) + (4(1) + 5) + \left( 4\dfrac{3}{2} + 5 \right) \right) \\ \displaystyle\int\limits_{0}^{2} 4x + 5 \, dx \approx \dfrac{1}{2} \left( 5 + 7 + 9 + 11 \right) \\ \displaystyle\int\limits_{0}^{2} 4x + 5 \, dx \approx 16$

2. Estimate $\displaystyle\int\limits_{-1}^{1} x^2 \, dx$   where   $N=5$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{1-(-1)}{5} \\ \Delta x = \dfrac{2}{5} \\$

Step 2: Calculate the sum:

$\displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \displaystyle\sum\limits_{i=1}^{N} f(-1+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \Delta x \displaystyle\sum\limits_{i=1}^{5} f(-1+i\cdot\Delta x) \\ \displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \dfrac{2}{5} \left(\left(\dfrac{-3}{5}\right)^2+ \left(\dfrac{-1}{5}\right)^2 + \left(\dfrac{1}{5}\right)^2 + \left(\dfrac{3}{5}\right)^2 + 1^2 \right) \\ \displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \dfrac{2}{5} \left( \dfrac{9}{25} + \dfrac{1}{25} + \dfrac{1}{25} + \dfrac{9}{25} + 1 \right) \\ \displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \dfrac{2}{5} \left( \dfrac{45}{25} \right) \\ \displaystyle\int\limits_{-1}^{1} x^2 \, dx \approx \dfrac{90}{125} \\$

3. Estimate $\displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx$   where   $N=4$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{\pi-0}{4} \\ \Delta x = \dfrac{\pi}{4} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(0+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \displaystyle\Delta x \sum\limits_{i=0}^{3} f(0+i\cdot\Delta x) \\ \displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \dfrac{\pi}{4} \left(\sin(0) + \sin\left(\dfrac{\pi}{4}\right) + \sin\left(\dfrac{\pi}{2}\right) + \sin\left(\dfrac{3\pi}{4}\right) \right) \\ \displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \dfrac{\pi}{4} \left( 0 + \dfrac{\sqrt{2}}{2} + 1 + \dfrac{\sqrt{2}}{2} \right) \\ \displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \dfrac{\pi}{4} \left( 1 + \sqrt{2} \right) \\ \displaystyle\int\limits_{0}^{\pi} \sin(x) \, dx \approx \dfrac{\pi + \pi\sqrt{2}}{4} \\$

4. Estimate $\displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta$   where   $N=8$

Step 1: Calculate $\Delta \theta$

$\Delta \theta = \dfrac{b - a}{N} \\ \Delta \theta = \dfrac{2\pi - 0}{8} \\ \Delta \theta = \dfrac{\pi}{4} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \displaystyle\sum\limits_{i=0}^{N-1} f(0+i\cdot\Delta \theta) \, \Delta \theta \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \Delta \theta \displaystyle\sum\limits_{i=0}^{7} f(0+i\cdot\Delta \theta) \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \dfrac{\pi}{4} \left( \cos(2\cdot0) + \cos\left(2\dfrac{\pi}{4}\right) + \cos\left(2\dfrac{\pi}{2}\right) + \cos\left(2\dfrac{3\pi}{4}\right) + \\ \cos(2\pi) + \cos\left(2\dfrac{5\pi}{4}\right) + \cos\left(2\dfrac{3\pi}{2}\right) + \cos\left(2\dfrac{7\pi}{4}\right) \right) \\ \phantom{0} \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \dfrac{\pi}{4} \left( \cos(0) + \cos\left(\dfrac{\pi}{2}\right) + \cos\left(\pi\right) + \cos\left(\dfrac{3\pi}{2}\right) + \\ \cos(2\pi) + \cos\left(\dfrac{\pi}{2}\right) + \cos\left(\pi\right) + \cos\left(\dfrac{3\pi}{2}\right) \right) \\ \phantom{0} \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \dfrac{\pi}{4} ( 1 + 0 - 1 + 0 + 1 + 0 - 1 + 0 ) \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx \dfrac{\pi}{4} ( 0 ) \\ \displaystyle\int\limits_{0}^{2\pi} \cos(2\theta) \, d\theta \approx 0$

5. Estimate $\displaystyle\int\limits_{-2}^{2} x^3 + 2x\, dx$   where   $N=7$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{2-(-2)}{7} \\ \Delta x = \dfrac{4}{7} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(-2+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{6} f(-2+i\cdot\Delta x) \\ \displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \dfrac{4}{7} \left( \left( (-2)^3 + 2(-2) \right) + \left( \left(\dfrac{-10}{7}\right)^3 + 2\dfrac{-10}{7} \right) + \left( \left(\dfrac{-6}{7}\right)^3 + 2\dfrac{-6}{7} \right) + \\ \left( \left(\dfrac{-2}{7}\right)^3 + 2\dfrac{-2}{7} \right) + \left( \left(\dfrac{2}{7}\right)^3 + 2\dfrac{2}{7} \right) + \left( \left(\dfrac{6}{7}\right)^3 + 2\dfrac{6}{7} \right) + \\ \left( \left(\dfrac{10}{7}\right)^3 + 2\dfrac{10}{7} \right) \right) \\ \displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \dfrac{4}{7} \left( \left( -8 - 4 \right) + \left( \dfrac{-1000}{343} + \dfrac{-20}{7} \right) + \left( \dfrac{-216}{343} + \dfrac{-12}{7} \right) + \\ \left( \dfrac{-8}{343} + \dfrac{-4}{7} \right) + \left( \dfrac{8}{343} + \dfrac{4}{7} \right) + \left( \dfrac{216}{343} + \dfrac{12}{7} \right) + \\ \left( \dfrac{1000}{343} + \dfrac{20}{7} \right) \right) \\$

Rather than calculate this all out, observe that there's a great deal of symmetry here. Notice that all but the first term can be negated by another term:

$\displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \dfrac{4}{7} \left( \left( -12 \right) - \left( \dfrac{1000}{343} + \dfrac{20}{7} \right) - \left( \dfrac{216}{343} + \dfrac{12}{7} \right) - \\ \left( \dfrac{8}{343} + \dfrac{4}{7} \right) + \left( \dfrac{8}{343} + \dfrac{4}{7} \right) + \left( \dfrac{216}{343} + \dfrac{12}{7} \right) + \\ \left( \dfrac{1000}{343} + \dfrac{20}{7} \right) \right) \\ \displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \dfrac{4}{7} ( -12 ) \\ \displaystyle\int\limits_{-2}^{2} x^3 + 2x \, dx \approx \dfrac{-48}{7}$

6. Estimate $\displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx$   where   $N = 5$

A calculator may be of service for this problem.

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{2-1}{5} \\ \Delta x = \dfrac{1}{5} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(1+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{4} f(1+i\cdot\Delta x) \\ \displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx \approx \dfrac{1}{5} \left( \dfrac{2}{1} + \dfrac{2}{1+1/5} + \dfrac{2}{1+2/5} + \dfrac{2}{1+3/5} + \dfrac{2}{1+4/5} \right) \\ \displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx \approx \dfrac{1}{5} \left( \dfrac{1879}{504} \right) \\ \displaystyle\int\limits_{1}^{2} \dfrac{2}{x} \, dx \approx \dfrac{1879}{1260} \\$

7. Estimate $\displaystyle\int_{-4}^{-1} 3x^4 + 7x + 2 \, dx$   where   $N=6$

A calculator may be of service for this problem.

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{-1-(-4)}{6} \\ \Delta x = \dfrac{3}{6} \\ \Delta x = \dfrac{1}{2} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(-4+i\cdot\Delta x) \, \Delta x \\ \displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{5} f(-4+i\cdot\Delta x) \\ \displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \dfrac{1}{2} \left( \left( 3(-4)^4 + 7(-4) + 2 \right) + \left( 3\left(\dfrac{-7}{2}\right)^4 + 7\left(\dfrac{-7}{2}\right) + 2 \right) + \\ \left( 3(-3)^4 + 7(-3) + 2 \right) + \left( 3\left(\dfrac{-5}{2}\right)^4 + 7\left(\dfrac{-5}{2}\right) + 2 \right) + \\ \left( 3(-2)^4 + 7(-2) + 2 \right) + \left( 3\left(\dfrac{-3}{2}\right)^4 + 7\left(\dfrac{-3}{2}\right) + 2 \right) \right) \\ \displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \dfrac{1}{2} \left( \left( 768 - 28 + 2 \right) + \left( \dfrac{7203}{16}-\dfrac{49}{2} + 2 \right) + \left( 243 - 21 + 2 \right) + \\ \left( \dfrac{1875}{16} - \dfrac{35}{2} + 2 \right) + \left( 48 - 14 + 2 \right) + \left( \dfrac{243}{16} - \dfrac{21}{2} + 2 \right) \right) \\ \displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \dfrac{1}{2} \left( \dfrac{24609}{16} \right) \\ \displaystyle\int\limits_{-4}^{-1} 3x^4 + 7x + 2 \, dx \approx \dfrac{24609}{32} \\$

8. Estimate $\displaystyle\int\limits_{0}^{8} 2^{x} \, dx$   where   $N=4$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{8 - 0}{4} \\ \Delta x = 2 \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{0}^{8} 2^x \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(0+i\cdot \Delta x) \, \Delta x \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{3} f(0+i\cdot \Delta x) \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx 2 \left( 2^0 + 2^2 + 2^4 + 2^6 \right) \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx \left( 2^1 + 2^3 + 2^5 + 2^7 \right) \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx 170 \\$

9. Estimate $\displaystyle\int\limits_{0}^{8} 2^{x} \, dx$   where   $N=8$

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{8 - 0}{8} \\ \Delta x = 1 \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{0}^{8} 2^x \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} f(0 + i \cdot \Delta x) \, \Delta x \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx \Delta x \displaystyle\sum\limits_{i=0}^{7} f(0 + i \cdot \Delta x) \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx 1 \left( 2^0 + 2^1 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 \right) \\ \displaystyle\int\limits_{0}^{8} 2^x \, dx \approx 255 \\$

10. Estimate $\displaystyle\int\limits_{a}^{b} C \, dx$   where   $N=N_{0} \geq 1$.

Based on what you know about geometry, what is the exact solution? Does the left Riemann sum produce an exact result?

Step 1: Calculate $\Delta x$

$\Delta x = \dfrac{b - a}{N} \\ \Delta x = \dfrac{b - a}{N_{0}} \\$

Step 2: Calculate sum:

$\displaystyle\int\limits_{a}^{b} C \, dx \approx \displaystyle\sum\limits_{i=0}^{N-1} C \, \Delta x \\ \displaystyle\int\limits_{a}^{b} C \, dx \approx \Delta x C \displaystyle\sum\limits_{i=0}^{N_0-1} 1 \\ \displaystyle\int\limits_{a}^{b} C \, dx \approx \dfrac{b-a}{N_0} C \left( N_{0} \right) \\ \displaystyle\int\limits_{a}^{b} C \, dx \approx C(b - a) \\$

The graph is a rectangle, and geometry tells us that the area of a rectangle is $\text{width}*\text{height}$. Here, the height of the rectangle is $C$ and the width is $b-a$. We can see that the result of the Riemann sum is exact:

$\displaystyle\int\limits_{a}^{b} C \, dx = \displaystyle\sum\limits_{i=0}^{N_0-1} C \, \Delta x = C(b-a) \\$

This shouldn't be surprising. The left Riemann sum uses little rectangles to estimate the area under a curve. In this case, however, the curve being split up is itself a rectangle.