Areas and Riemann sums

The second big idea of calculus is the integral. It starts with a simple question: what is the area of a region with a curved side?

We know the area of a rectangle: width times height. For a curved region, we cut it into thin rectangles and add their areas. With more and thinner rectangles, the estimate gets better. The exact area is a limit.

The area problem

Let $f(x)\ge 0$ on $[a,b]$. We want the area of the region under the graph of $f$, above the $x$-axis, between $x=a$ and $x=b$. We call it the area under the curve.

Our first example is the area under $y=x^2$ from $0$ to $1$.

Estimating with rectangles

Example 1: Estimate the area under the curve

$y=x^2$, from $x=0$ to $x=1$,

with four rectangles. Use (a) left endpoints, (b) right endpoints, and (c) midpoints for the heights.

Solution:

Cut $[0,1]$ into $4$ equal pieces. Each has width $\Delta x=\dfrac{1}{4}$. The cut points are $0$, $\tfrac{1}{4}$, $\tfrac{1}{2}$, $\tfrac{3}{4}$, $1$.

1xy
(a) Left endpoints
1xy
(b) Right endpoints
1xy
(c) Midpoints

(a) The heights are the values of $x^2$ at the left endpoints $0$, $\tfrac{1}{4}$, $\tfrac{1}{2}$, $\tfrac{3}{4}$:

$\begin{align*}&L_4\\&=\dfrac{1}{4}\left(0+\dfrac{1}{16}+\dfrac{4}{16}+\dfrac{9}{16}\right)\\&=\dfrac{1}{4}\cdot\dfrac{14}{16}\\&=0.21875\end{align*}$

(b) Right endpoints $\tfrac{1}{4}$, $\tfrac{1}{2}$, $\tfrac{3}{4}$, $1$:

$\begin{align*}&R_4\\&=\dfrac{1}{4}\left(\dfrac{1}{16}+\dfrac{4}{16}+\dfrac{9}{16}+\dfrac{16}{16}\right)\\&=\dfrac{1}{4}\cdot\dfrac{30}{16}\\&=0.46875\end{align*}$

(c) Midpoints $\tfrac{1}{8}$, $\tfrac{3}{8}$, $\tfrac{5}{8}$, $\tfrac{7}{8}$:

$\begin{align*}&M_4\\&=\dfrac{1}{4}\left(\dfrac{1}{64}+\dfrac{9}{64}+\dfrac{25}{64}+\dfrac{49}{64}\right)\\&=\dfrac{1}{4}\cdot\dfrac{84}{64}\\&=0.328125\end{align*}$

The left rectangles fit under the curve, so $L_4$ is too small. The right rectangles stick out, so $R_4$ is too big. The true area is between them:

$0.21875<A<0.46875$

With more rectangles, the estimates get closer together. Here they are for $n$ rectangles:

$n$$L_n$$R_n$
$4$$0.218750$$0.468750$
$10$$0.285000$$0.385000$
$100$$0.328350$$0.338350$
$1000$$0.332834$$0.333834$

Both columns seem to approach

$\dfrac{1}{3}\approx 0.333333$.

We will prove it below.

Sigma notation

Sums with many terms are long to write. Sigma notation writes them in a short form. The Greek capital letter sigma, $\Sigma$, means "add up":

$\displaystyle\sum_{i=1}^{n}a_i=a_1+a_2+a_3+\cdots+a_n$

The letter $i$ is called the index. It starts at the number below $\Sigma$ and goes up by $1$ to the number above it. For example,

$\displaystyle\sum_{i=1}^{4}i^2=1+4+9+16=30$.

Two sum formulas are useful. For any positive integer $n$,

$\displaystyle\sum_{i=1}^{n}i=\dfrac{n(n+1)}{2}$

$\displaystyle\sum_{i=1}^{n}i^2=\dfrac{n(n+1)(2n+1)}{6}$

Check the second one for $n=4$:

$\dfrac{4\cdot 5\cdot 9}{6}=30$

The exact area as a limit

Example 2: Find the exact area under the curve

$y=x^2$, from $x=0$ to $x=1$.

Solution:

Use $n$ rectangles with right endpoints. Each has width $\dfrac{1}{n}$, and the right endpoints are

$x_i=\dfrac{i}{n}$   for $i=1,2,\ldots,n$.

So the sum of the areas is

$\begin{align*}&R_n\\&=\sum_{i=1}^{n}\left(\dfrac{i}{n}\right)^2\cdot\dfrac{1}{n}\\&=\dfrac{1}{n^3}\sum_{i=1}^{n}i^2\end{align*}$

Now use the formula for the sum of squares:

$\begin{align*}&R_n\\&=\dfrac{1}{n^3}\cdot\dfrac{n(n+1)(2n+1)}{6}\\&=\dfrac{(n+1)(2n+1)}{6n^2}\end{align*}$

Let $n\to\infty$. The numerator and denominator both have degree $2$, so the limit is the ratio of the leading coefficients (see limits at infinity):

$\displaystyle A=\lim_{n\to\infty}\dfrac{2n^2+3n+1}{6n^2}=\dfrac{2}{6}=\dfrac{1}{3}$

The exact area is $\dfrac{1}{3}$.

Riemann sums

Here is the same idea for any function $f$ on any interval $[a,b]$. Cut $[a,b]$ into $n$ pieces of equal width

$\Delta x=\dfrac{b-a}{n}$.

The total area of the rectangles is called a Riemann sum:

$\displaystyle\sum_{i=1}^{n}f(x_i^*)\,\Delta x$

It is named after the German mathematician Bernhard Riemann.

Suppose $f$ is continuous, and $f(x)\ge 0$ on $[a,b]$. Then the area under the curve is the limit

$\displaystyle A=\lim_{n\to\infty}\sum_{i=1}^{n}f(x_i^*)\,\Delta x$.

The limit is the same for any choice of sample points.

Distance from velocity

If a car moves at a constant velocity, then distance $=$ velocity $\times$ time. If the velocity changes, we can cut the time into short pieces. In each piece, the velocity is nearly constant. This is the same idea as the rectangles.

Example 3: A car starts from rest. Its velocity is read every $2$ seconds:

$t$ (s)$v$ (m/s)
$0$$0$
$2$$6$
$4$$10$
$6$$13$
$8$$15$
$10$$16$

Estimate the distance it travels in $10$ seconds. Use left endpoints, then right endpoints.

Solution:

Each time piece is $\Delta t=2$ s long.

Left endpoints (the velocity at the start of each piece):

$2(0+6+10+13+15)=88$ m

Right endpoints (the velocity at the end of each piece):

$2(6+10+13+15+16)=120$ m

The car speeds up the whole time. So the left estimate is too small, and the right estimate is too big. The distance is between $88$ m and $120$ m.

The distance traveled is the area under the velocity graph. Areas, distances, and many other totals all come from the same kind of limit. In the next section, this limit gets a name: the definite integral.

Summary