Lab 11: Review of Algebra for Riemann Sums

The following material should be read prior to attending lab. You are responsible for preparing for lab so that you don't slow down your group.

Now that you have had some experience working with sums and estimating areas of regions in the first quadrant of the Cartesian plane, we are going to expand your knowledge and prepare you to deal with an arbitrary number of rectangles, n. In this lab we will focus on improving the algebra skills needed to calculate a Riemann Sum.

Given a continuous function f(x) over the interval [a, b], we subdivide the interval [a, b] into a partition of n subintervals. A Riemann Sum of f(x) over the interval [a, b] is a sum of the form $\sum\limits_{i \, = \, 1}^{n}{f(x_{i}^{*})\Delta x_{i} } $, where $x_i^*$ is a point in the i th subinterval and $\Delta x_i$ is the width of the i th subinterval. In order to ease our calculations in calculus, we subdivide the interval [a, b] into n equal subintervals and $x_i^*$ is usually the left-hand endpoint, the right-hand endpoint, or the midpoint of the i th subinterval.

If we partition [a, b] into n equal subintervals, then we use the notation $\Delta x$ instead of $\Delta x_i$. We have that $\Delta x = \frac{b \; - \; a}{n}$. In our partition, the i th subinterval will be the interval $[x_{i \, - \, 1}, x_i]$, with $i = 1, 2, \, . . ., \, n$. With careful inspection, you see that we get the following formulas.

Left-hand endpoint of i th subinterval $x_{i \, - \, 1} = a + (i - 1)\Delta x$
Right-hand endpoint of i th subinterval $ x_{i} = a + i\Delta x$
Midpoint of i th subinterval $\frac{x_{i \, - \, 1} \; + \; x_{i} }{2} = \frac{2a \; + \; (2i \; - \; 1)\Delta x}{2}$

Example 11.1:

Let's return to our example from Lab 10 and use the function $f(x) = \frac{1}{2}x^2$ over the interval [0, 4].

(a) We will use n equal subintervals and the left-hand endpoints to compute the Riemann Sum. Thus, the formula for our Riemann Sum will be $\sum\limits_{i \, = \, 1}^{n}{f(x_{i \, - \, 1})\Delta x}$. We first need to find a formula for $\Delta x$ and then plug the left-hand endpoint formula into the function, f(x). The hard part is simplifying the sum until we get a closed form in terms of the variable n.

$\Delta x = \dfrac{b \, - \, a}{n} = \dfrac{4 \, - \, 0}{n} = \dfrac{4}{n}, \; x_{i \, - \, 1} = 0 + (i \, - \, 1) \cdot \dfrac{4}{n}$

$\sum\limits_{i \, = \, 1}^{n}{f(x_{i \, - \, 1}) \Delta x }$ $=$$ \sum\limits_{i \, = \, 1}^{n}{\left[\frac{1}{2}\left(0 + (i - 1)\frac{4}{n}\right)^{2}\right] \cdot \frac{4}{n}} $ We plug $x_{i \, - \, 1}$ into the function and $\Delta x$ into the summation formula.
$=$ $ \sum\limits_{i \, = \, 1}^{n}{\frac{1}{2}\left((i - 1)\frac{4}{n}\right)^{2} \cdot \frac{4}{n}} $We simplify and get rid of the 0.
$=$$ \sum\limits_{i \, = \, 1}^{n}{\frac{2}{n}(i - 1)^{2}\left(\frac{4}{n}\right)^{2} } $ We multiply $\frac{1}{2}$ by $\frac{4}{n}$ to give us $\frac{2}{n}$. And we need to square each term of $x_{i \, - \, 1}$.
$=$$\sum\limits_{i \, = \, 1}^{n}{\frac{2}{n} \cdot \frac{16}{n^{2} }(i^{2} - 2i + 1)} $ We square the quantities and combine all terms with n.
$=$$\sum\limits_{i \, = \, 1}^{n}{\frac{32}{n^{3} }\left( i^{2} - 2i + 1 \right)} $
$=$$\frac{32}{n^{3} }\sum\limits_{i \, = \, 1}^{n}{\left( i^{2} - 2i + 1 \right)} $We always move anything with an n in it in front of the summation sign.
$=$$\frac{32}{n^{3} }\left[ \sum\limits_{i \, = \, 1}^{n}{i^{2} } - 2\sum\limits_{i \, = \, 1}^{n}{i} + \sum\limits_{i \, = \, 1}^{n}{1} \right]$ We split the sum into three sums and move all coefficients in front of the summation sign.
$=$$\frac{32}{n^{3} }\left[ \frac{2n^{3} \; + \; 3n^{2} \; + \; n}{6} - 2 \cdot \frac{n^{2} \; + \; n}{2} + n \cdot 1 \right]$We replace the sums with the formulas from Lab 10.
$=$$ \frac{32}{n^{3} }\left[ \frac{1}{3}n^{3} + \frac{1}{2}n^{2} + \frac{1}{6}n - n^{2} - n + n \right] $
$=$$ \frac{32}{n^{3} }\left[ \frac{1}{3}n^{3} - \frac{1}{2}n^{2} + \frac{1}{6}n \right] $
$=$$ \frac{32}{3} - \frac{16}{n} + \frac{16}{3n^{2} }$ We simplify algebraically and combine all like terms.

The detailed explanation given in this example just illustrates one way to do the algebraic manipulations—there are many other correct algebraic methods that will yield the same closed form.


(b) Now let's tackle the same problem with n equal subintervals and the right-hand endpoints. The formula for the Riemann Sum is $\sum\limits_{i \, = \, 1}^{n}{f(x_{i})\Delta x}$. So, now we need to find a formula for $\Delta x$ and substitute the right-hand endpoint formula into the function and then simplify the sum until we get a closed form in terms of n.

$\Delta x = \dfrac{b \; - \; a}{n} = \dfrac{4 \; - \; 0}{n} = \dfrac{4}{n}, \; x_{i} = 0 + i \cdot \dfrac{4}{n}$

$\sum\limits_{i \, = \, 1}^{n}{f(x_{i})\Delta x } $ $=$$\sum\limits_{i \, = \, 1}^{n}{\left[ \frac{1}{2}\left( 0 + i \cdot \frac{4}{n} \right)^{2} \right] \cdot \frac{4}{n}} $We plug $x_i$ into the function and $\Delta x$ into the summation formula.
$=$$\sum\limits_{i \, = \, 1}^{n}{\frac{1}{2}\left( i \cdot \frac{4}{n} \right)^{2} \cdot \frac{4}{n}} $
$=$$\sum\limits_{i \, = \, 1}^{n}{\frac{2}{n} \cdot i^{2} \cdot \left( \frac{4}{n} \right)^{2} } $ We multiply $\frac{1}{2}$ by $\frac{4}{n}$ to give us $\frac{2}{n}$. And we need to square each term of x.
$=$ $ \sum\limits_{i \, = \, 1}^{n}{\frac{2}{n} \cdot \frac{16}{n^{2} } \cdot i^{2} } $ We square the quantities and combine all terms with n.
$=$$ \sum\limits_{i \, = \, 1}^{n}{\frac{32}{n^{3} } \cdot i^{2} } $
$=$$ \frac{32}{n^{3} }\left[ \sum\limits_{i \, = \, 1}^{n}{i^{2} } \right] $ We always move anything with an n in it in front of the summation sign.
$=$$ \frac{32}{n^{3} }\left[ \frac{2n^{3} \; + \; 3n^{2} \; + \; n}{6} \right] $ We replace the sums with the formulas from Lab 10.
$=$$\frac{32}{n^{3} }\left[ \frac{1}{3}n^{3} + \frac{1}{2}n^{2} + \frac{1}{6}n \right]$
$=$$\frac{32}{3} + \frac{16}{n} + \frac{16}{3n^{2} }$ We simplify algebraically and combine all like terms.

If you compare your answers from parts (a) and (b), you will notice that they are very similar. Since we are using rectangles, both right-hand and left-hand, you may notice that some of these rectangles are the same in both cases. If you look at the absolute value of the difference between these sums, you get

$|\text{Right-hand sum } - \text{ Left-hand sum}| = |f(b) - f(a)| \cdot \Delta x$.