## Riemann sums

Let \(f(x)\) be defined for \(a\leq x\leq b\) (Figure 1). Assume at pleasure \(n-1\) points between \(a\) and \(b\) \[a=x_{0}<x_{1}<x_{2}<\cdots<x_{n}=b,\] thus dividing the interval \(I=[a,b]\) into \(n\) subintervals: \[[a,x_{1}],[x_{1},x_{2}],\cdots,[x_{n-1},b].\] In each of these subintervals, take a value of \(x=x_{k}^{*}\) where \(x_{k-1}\leq x_{k}^{*}\leq x_{k}\), and form the sum \[S_{n}=f(x_{1}^{*})(x_{1}-x_{0})+f(x_{2}^{*})(x_{2}-x_{1})+\cdots+f(x_{n}^{*})(x_{n}-x_{n-1})\tag{8.1.1}\] This sum is called a **Riemann sum** for \(f\) on the interval \([a,b]\), after German mathematician George Friedrich Bernhard Riemann (1826–1866). Now let’s see what the geometrical interpretation of \(S_{n}\) is. First suppose \(f(x)\geq0\) for all \(x\in[a,b]\). In this case

\(f(x_{1}^{*})(x_{1}-x_{0})=\) the area of the rectangle \(AP_{1}R_{1}M_{1},\)

\(f(x_{2}^{*})(x_{2}-x_{1})=\) the area of the rectangle \(M_{1}P_{2}R_{2}M_{2},\)

\(\vdots\)

\(f(x_{n-1}^{*})(x_{n-1}-x_{n-2})=\) the area of the rectangle \(M_{n-2}P_{n-1}R_{n-1}M_{n-1}\),

\(f(x_{n}^{*})(x_{n}-x_{n-1})=\) the area of the rectangle \(M_{n-1}P_{n}R_{n}B\).

Thus \(S_{n}\) represents the total area of all rectangles in Figure 1, and approximates the area of the region that lies between the curve \(y=f(x)\) and the \(x\)-axis between \(x=a\) and \(x=b\).

If \(f(x)\) takes both positive and negative values on \([a,b]\), then \(S_{n}\) is an approximation for the **net signed area**; that is, the area below the curve \(y=f(x)\) and above the \(x\)-axis minus the area above the curve \(y=f(x)\) and below the \(x\)-axis from \(x=a\) to \(x=b\), as suggested in Figure 2.

The Riemann sum is often shortened as \[S_{n}=\sum_{k=1}^{n}f(x_{k}^{*})(x_{k}-x_{k-1}),\] where \(\Sigma\) (sigma), Greek form of the letter \(S\), stands for the word “summation.” The whole expression indicates that the sum is to be taken of all terms obtained from \(f(x_{k}^{*})(x_{k}-x_{k-1})\) by giving to \(k\) in succession the values of \(1,2,3,\dots,n\).

By introducing the symbol \[\Delta_{k}x=x_{k}-x_{k-1},\] we can shorten it further and write: \[S_{n}=\sum_{k=1}^{n}f(x_{k}^{*})\Delta_{k}x.\tag{8.1.2}\] Please note that here \(\Delta_{k}\) is not a factor, but denotes the difference (here the length of the \(k\)-th subinterval).

- Some books, write \(\Delta x_{k}\) instead of \(\Delta_{k}x\).

#### Read about some specific types of Riemann sums

#### Hide the speci

## Some Specific Types of Riemann Sums

- If the sample point in each subinterval \(x_{k}^{*}\) is the left endpoint of the subinterval; that is, if \(x_{k}^{*}=x_{k-1}\) for all \(k\), then \(S_{n}\) is called a
**left Riemann sum**(see Figure 3).

- If the sample point in each interval \(x_{k}^{*}\) is the right endpoint of the subinterval; that is, if \(x_{k}^{*}=x_{k}\) for all \(k\), then \(S_{n}\) is called a
**right Riemann sum**(see Figure 4).

- If the sample point in each interval \(x_{k}^{*}\) is the midpoint of the subinterval; that is, if \(x_{k}^{*}=(x_{k}+x_{k-1})/2\) for all \(k\), then \(S_{n}\) is called a
**middle Riemann sum**(see Figure 5).

- If the sample point in each interval \(x_{k}^{*}\) is chosen such that \(f(x_{k}^{*})\) is the maximum value of \(f\) on the subinterval \([x_{k-1},x_{k}]\) for all \(k\), then \(S_{n}\) is called an
**upper Riemann sum**(see Figure 6).

- If the sample point in each interval \(x_{k}^{*}\) is chosen such that \(f(x_{k}^{*})\) is the minimum value of \(f\) on the subinterval \([x_{k-1},x_{k}]\) for all \(k\), then \(S_{n}\) is called a
**lower Riemann sum**(see Figure 7).

## Limit of the Riemann Sums as \(n\to\infty\)

As shown in Figure 8, if the number of subintervals \(n\) increases such that the subintervals lengths (*or* widths) get smaller and the rectangles become thinner, then the Riemann sum \(S_{n}\) will be a better approximation to the net area between the curve \(y=f(x)\) and the \(x\)-axis.

n=11 | n=20 | n=40 |

*Figure 8. As the number of subintervals $n$ increases, $S_n$ becomes a better approximation to the net area that lie between the curve $y = f(x)$ and the x-axis.
*

Now let the number of subintervals \(n\) increase indefinitely \((n\to\infty)\), while the width of the widest subinterval approaches zero. If the sum (8.1.1) (or (8.1.2)) approaches a number which is independent of the choice of the \(x_{k}\)’s and of the \(x_{k}^{*}\)’s, its limit is called the definite integral of \(f(x)\) between \(a\) and \(b\) and is denoted by \({\int_{a}^{b}f(x)}dx\).

**Definition 1.**The limit of the sum (8.1.2) provided that the number of subintervals \(n\) tends to infinity and at the same time the length of each subinterval approaches zero is called the definite integral of \(f(x)\) from \(a\) to \(b\) and is denoted by \({\displaystyle {\int_{a}^{b}f(x)}dx}.\) If this limit exists, the function is called integrable on the interval \([a,b]\). \[\int_{a}^{b}f(x)dx=\lim_{\max\Delta_{k}x\to0}\sum_{k=1}^{n}f(x_{k}^{*})\Delta_{k}x.\]

We note that

- The use of the word “integral” and of the symbol \(\int\) suggests a connection with the indefinite integrals in the previous Chapter. This connection will be shown in Section on the Fundamental Theorem of Calculus.

- The symbol \(\int\) is a modified form of \(S\) (that stands for summation).

- We call \(a\) the
**lower limit**and \(b\) the**upper limit**of integration (or of the internal), and the function \(f(x)\) the**integrand**.

- If the integral \(\int_{a}^{b}f(x)dx\) exists, \(f(x)\) is called
**integrable**between \(a\) and \(b\).

- If \(f\) is continuous on the interval \((a,b)\) then \(\int_{a}^{b}f(x)dx\) exists. The proof of this theorem is beyond the scope of an elementary course.

#### The variable of integration is a dummy variable

#### Hide the explanation about the dummy variable

The letter \(k\) chosen for the summation index in the Riemann sum \(S_{n}=\sum_{k=1}^{n}f(x_{k}^{*})\Delta_{k}x\) is a dummy variable; that is, it can be replaced by any other letter such as \(i\) without affecting the value of the sum (provided, of course, it is replaced in each place where \(k\) occurs) \[S_{n}=\sum_{k=1}^{n}f(x_{k}^{*})\Delta_{k}x=\sum_{i=1}^{n}f(x_{i}^{*})\Delta_{i}x.\] Similarly, the letter \(x\) chosen for the variable of integration in \(\int_{a}^{b}f(x)dx\) is a dummy variable, which disappears in the final result. In other words, it can be replaced by any other letter that we wish without affecting the integral; thus \[\int_{a}^{b}f(x)dx=\int_{a}^{b}f(u)du.\] For example, if \[\int_{1}^{2}f(x)dx=32,\] then \[\int_{1}^{2}f(u)du=32.\] Therefore, instead of \(\int_{a}^{b}f(x)dx\), sometimes we may simply write \[\int_{a}^{b}f.\] Unlike the case of the definite integral, the variable of integration in an indefinite integral is not a dummy variable because it appears in the final result. For example, \[\int xdx=\frac{1}{2}x^{2}+C_{1},\quad\int udu=\frac{1}{2}u^{2}+C_{2}\] and in this sense \[\int xdx\neq\int udu.\]

In the previous discussion, we assumed \(a<b\). However, if we omit this condition and assume \(b<a\), we can still retain our definition of integral; the only change is that we have to number the subdivision points from the right side, which make the differences \(\Delta_{k}x\) negative. We are thus led to the relation \[\int_{b}^{a}f(x)dx=-\int_{a}^{b}f(x)dx.\] In conformity, we define \[\int_{a}^{a}f(x)dx=0.\]

**Definition 2.**

\[\int_{\color{red} a}^{\color{blue} b}f(x)dx=-\int_{\color{blue} b}^{\color{red} a}f(x)dx. \tag{ $a$ and $b$ interchanged} \] and \[\int_{a}^{a}f(x)dx=0. \tag{same upper and lower limits} \]

$\displaystyle{\int_a^b f(x)dx} = $ area above the $x$-axis $-$ area below the $x$-axis (when $a<b$)