Limits and integration

A hand adds a wooden cube to a staircase-shaped stack of blocks.
Photo by Imagine Buddy on Unsplash.

When we introduced integration, we imagined adding infinitely many infinitesimal contributions to find a total. That picture helped us reason about accumulation, and antiderivatives gave us a practical way to calculate it. How can we make the connection between those two ideas precise?

Limits let us begin with ordinary, finite sums and follow what happens as the pieces become smaller. By keeping track of how much our sums can overestimate or underestimate the total, we can turn those approximations into an exact answer and explain why integration and differentiation fit together.

By the end of this lesson, you should be able to:

  • Construct lower and upper sums and use their limits to evaluate integrals.
  • Determine whether a bounded function is integrable by comparing its lower and upper sums.
  • Explain how the Mean Value Theorem, lower and upper sums, and the Squeeze Theorem work together to prove the Fundamental Theorem of Calculus.

When we first introduced integration, we imagined dividing a region into infinitely many infinitesimal strips and adding their areas. Limits give us a way to make that reasoning precise using ordinary real numbers: we can work with finitely many rectangles, then study their totals as the rectangles become narrower.

Let's try this with \( \displaystyle \int_0^1x\dd{x} \). The region under \( y=x \) is a triangle with base and height both equal to \( 1 \), so we already know its area is . How can we recover that answer by adding finite rectangles and taking a limit?

Start by dividing \( [0,1] \) into four equal pieces. On each piece, we can draw one rectangle that fits below the line and another that reaches above it, as shown here.

The green rectangles fit inside the triangle; the red outlines enclose it. The first green rectangle has height \( 0 \).

Each rectangle has width . Because \( y=x \) is increasing, the smaller height on each piece occurs at its , while the larger height occurs at its other endpoint.

For example, on the piece from \( \displaystyle \frac14 \) to \( \displaystyle \frac12 \), the green rectangle has height \( \displaystyle \frac14 \), so its area is . The rectangle outlined in red has height \( \displaystyle \frac12 \), giving it area .

Adding the four green areas gives a lower bound, which we'll call \( s_4 \); adding the four red-outlined areas gives an upper bound, \( S_4 \):

\(\displaystyle s_4\)\(\displaystyle =\qty(0+\frac14+\frac24+\frac34)\frac14\)\(\displaystyle =\)\(\displaystyle ,\)\(\displaystyle S_4\)\(\displaystyle =\qty(\frac14+\frac24+\frac34+\frac44)\frac14\)\(\displaystyle =\)\(\displaystyle .\)

If \( A \) is the triangle's area, the rectangles tell us that \( s_4\le A\le S_4 \). The area of the triangle is at least the green total and at most the red-outlined total, so we have a range that we can try to narrow.

What happens if we use more rectangles? Increase the number of pieces below and watch the space between the two staircases. Each narrower piece covers a smaller change in height along the line.

The green rectangles fit inside the triangle; the red outlines enclose it. The first green rectangle has height \( 0 \).

Number of pieces:

The picture suggests that both totals are closing in on the same area. To follow this as far as we like, let \( n \) be any positive integer and divide \( [0,1] \) into \( n \) equal pieces. Their common width is , and the dividing inputs are

\[0,\quad\frac1n,\quad\frac2n,\quad\ldots,\quad\frac nn=1.\]

Since the function is \( f(x)=x \), these inputs also give the rectangle heights. The upper sum uses the heights at the right ends of the pieces:

\(\displaystyle S_n\)\(\displaystyle =\qty(\frac1n+\frac2n+\cdots+\frac nn)\frac1n\)\(\displaystyle =\frac{1+2+\cdots+n}{\)\(\displaystyle }.\)

One factor of \( n \) in the denominator comes from the heights, and the other comes from the widths. For the lower sum, the heights begin at \( 0 \) and end at . Adding those contributions gives

\[s_n=\frac{0+1+2+\cdots+(n-1)}{n^2}.\]

Compare the two numerators. They share every term from \( 1 \) through \( n-1 \), so subtracting leaves \( S_n-s_n= \). Taking the limit shows what happens to this gap:

\(\displaystyle \limit{n\to\infty}(S_n-s_n)=\limit{n\to\infty}\frac1n=\)\(\displaystyle .\)

The bounds are getting closer together, but what number do they approach? To calculate either limit, we need a way to add \( 1+2+\cdots+n \). There's a useful trick: write the same sum in both directions and add the matching terms.

For instance, with six terms,

\[\begin{aligned}S&=1+2+3+4+5+6,\\S&=6+5+4+3+2+1.\end{aligned}\]

Each pair adds to , and there are pairs. These pairs add up to \( 2S \), so \( S= \).

We can use the same idea for the sum in our rectangle formula. With \( n \) terms, the two rows become

\[\begin{aligned}S&=1+2+\cdots+(n-1)+n,\\S&=n+(n-1)+\cdots+2+1.\end{aligned}\]

As before, pair the first terms in the two rows, then the second terms, and so on. Each pair adds to , and there are \( n \) pairs. Dividing their combined total by \( 2 \) gives

\[1+2+\cdots+n=\frac{n(n+1)}2.\]

We now have a formula for the numerator of our upper sum. Substituting it lets us simplify the total area of the rectangles:

\[\begin{aligned}S_n&=\frac{1+2+\cdots+n}{n^2}\\&=\frac{\qty(\frac{n(n+1)}2)}{n^2}\\&=\frac{n+1}{2n}\\&=\frac12+\frac1{2n}.\end{aligned}\]

To find the lower sum, we can use the gap we found earlier: subtracting \( \displaystyle \frac1n \) from the upper sum gives

\[\begin{aligned}s_n&=\frac12+\frac1{2n}-\frac1n\\&=\frac12-\frac1{2n}.\end{aligned}\]

We can now calculate both limits:

\(\displaystyle \limit{n\to\infty}s_n\)\(\displaystyle =\limit{n\to\infty}\qty(\frac12-\frac1{2n})\)\(\displaystyle =\)\(\displaystyle ,\)\(\displaystyle \limit{n\to\infty}S_n\)\(\displaystyle =\limit{n\to\infty}\qty(\frac12+\frac1{2n})\)\(\displaystyle =\)\(\displaystyle .\)

The triangle's area lies between these bounds for every \( n \):

\[\frac12-\frac1{2n}\le A\le\frac12+\frac1{2n}.\]

Since both bounds approach the same number, the gives \( \displaystyle A=\frac12 \). As we take more and more pieces, both bounds get as close to \( \displaystyle \frac12 \) as we like, leaving the fixed area \( A \) squeezed between them.

We've recovered the area we expected, and the calculation also explains how to turn our picture of infinitesimal strips into a limit. Every sum we formed used finitely many rectangles with positive widths; as those widths approached zero, the lower and upper totals approached the same area.

\[\int_0^1x\dd{x}=\limit{n\to\infty}s_n=\limit{n\to\infty}S_n=\frac12.\]

Upper and lower sums

We can make an accumulated total precise by trapping it between two finite sums. To build these sums, divide the interval into pieces and choose the smallest function value on each piece for one rectangle and the largest for the other. Adding the smaller contributions gives a lower bound on the total, while adding the larger ones gives an upper bound.

For \( f(x)=x \) in Explore, the smallest height on each piece was at its left end and the largest was at its right end. For a curve that rises and falls, though, either height can occur inside the piece, so we need to look at the whole piece when choosing our bounds.

Each lower rectangle has height \( m_i \), and each upper rectangle has height \( M_i \), with the pieces numbered from left to right. In the middle piece, the largest height occurs inside the interval.

To describe the pieces, set \( x_0=a \) and \( x_n=b \), then choose intermediate dividing points in order:

\[a=x_0<x_1<x_2<\cdots<x_n=b.\]

These points form a partition of \( [a,b] \) into \( n \) intervals, from \( [x_0,x_1] \) through \( [x_{n-1},x_n] \). Each interval has its own width: for example, \( \Delta x_1=x_1-x_0 \) and \( \Delta x_2=x_2-x_1 \). If \( f \) is continuous, the Extreme Value Theorem guarantees a smallest and largest value on each closed piece.

Each height is multiplied by the width of its own piece, so the pieces can have different widths. We can also add dividing points wherever we want a closer fit. When we split a piece, its smaller parts may have higher minimum values or lower maximum values. The lower sum can therefore increase and the upper sum can decrease, bringing our bounds closer together; either sum may also stay the same.

For example, divide \( [0,1] \) at \( \displaystyle \frac14 \) and use \( f(x)=x^2 \). Since the function is increasing, its largest heights on the two pieces occur at their right endpoints. The upper sum is

\[\begin{aligned}S_2&=\qty(\frac14)^2\cdot\frac14+1^2\cdot\frac34\\&=\frac{49}{64}.\end{aligned}\]

Notice that the second rectangle is three times as wide as the first, so its height is multiplied by a correspondingly larger width.

The difference \( S_n-s_n \) measures how much room remains between the two bounds. In Explore, that difference was \( \displaystyle \frac1n \), so both bounds closed in on \( \displaystyle \frac12 \). This gives us a way to describe exactly when the finite sums determine one accumulated total.

Integrability

The upper and lower sums give us a range for the accumulated total. If we can make the gap between them as small as we like by choosing a suitable partition, those bounds determine a single number. This gives us a way to define the integral.

For example, if we want the two bounds to be within \( 0.001 \), we must be able to choose pieces that make their gap smaller than \( 0.001 \). If we then ask for an even smaller gap, we must be able to find a partition that meets that request as well. Being able to do this for any positive amount is what lets the bounds determine one accumulated total.

For an integrable function, the lower and upper sums approach the same integral however we choose the dividing points, provided the width of the widest piece approaches \( 0 \). The pieces can have different widths, as long as all of them become small. Adding more dividing points in one part of the interval while leaving a wide piece elsewhere can still leave a gap between our bounds.

Equal pieces give us a convenient way to ensure this. With \( n \) equal pieces, each width is \( \displaystyle \frac{b-a}n \) and approaches \( 0 \) as \( n\to\infty \). For an integrable function, we can therefore write

\[\limit{n\to\infty}s_n=\int_a^b f(x)\dd{x}=\limit{n\to\infty}S_n.\]

Continuity therefore guarantees that the lower and upper sums approach a common total as every piece shrinks. The rectangle picture makes this easy to visualize for positive functions, and the same construction works for signed contributions: a negative height contributes a negative number to the sum. Multiplying by positive widths preserves the ordering of the lower and upper heights.

So a jump can still allow the lower and upper sums to approach the same total. What would keep them apart? Consider the Dirichlet function (pronounced “dee-ree-KLAY”):

\[D(x)=\begin{cases}1,&x\text{ rational},\\0,&x\text{ irrational}.\end{cases}\]

The blue guide marks height \( 1 \) for rational inputs, and the orange guide marks height \( 0 \) for irrational inputs. Both types of input occur in every interval, however small. An exact picture would need to distinguish infinitely many interspersed points, so the shaded bands and dots are a visual approximation of where those values lie.

Every interval of positive length contains both rational and irrational inputs. On every piece of \( [0,1] \), the smallest value is therefore \( 0 \) and the largest is \( 1 \). Every lower sum is \( 0 \), while every upper sum is \( 1 \), however finely we divide the interval. The gap stays equal to \( 1 \), so this function is not integrable in the sense we've defined.

A function can also approach a height without ever reaching it. This can happen even along a straight line if the domain leaves out its endpoints.

For any bounded function, we use these same two bounds on each piece: the greatest lower bound gives the lower height, and the least upper bound gives the upper height. When a minimum and maximum exist, the bounds equal those values, so this construction includes the continuous functions we started with.

We can also choose each rectangle's height from any point in its piece. The resulting total is called a Riemann sum (pronounced “REE-mahn”). It lies between the lower and upper sums, so for an integrable function it approaches the same integral as every piece shrinks, whatever points we choose. This is why the same integral is also called the Riemann integral.

Calculating with finite sums

Now that we know what the sums approach, let's look at how to calculate them. If we divide \( [a,b] \) into \( n \) equal pieces, each width is \( \displaystyle \frac{b-a}{n} \). Once we have found the heights, we can add them first and multiply by that common width on the right, in the same position as \( \dd{x} \) in the integral.

We can also read the representation backward. The factor outside the brackets gives the width, and the terms inside show which function values we are adding.

To calculate a limit of rectangle totals, we often need to simplify a finite sum first. As in Explore, we can use dots to show that a pattern continues through the terms in the middle. To work with the sum, we need to know both how that pattern continues and where it stops. In

\[3+5+7+\cdots+(2n+1),\]

the terms increase by \( 2 \). They are one more than the doubled inputs \( 1,2,\ldots,n \), so there are \( n \) terms. For example, when \( n=4 \) the total is \( 3+5+7+9 \), or \( 24 \). The final expression \( 2n+1 \) describes the last term, not the number of terms.

For \( 2^2+3^2+\cdots+(n+1)^2 \), the squared bases run from \( 2 \) through \( n+1 \). There are again \( n \) terms, even though the first base isn't \( 1 \).

Once we know which terms are being added, we can use familiar algebra to simplify the sum. For example, a factor shared by every term can be taken outside:

\[3\cdot1^2+3\cdot2^2+\cdots+3n^2=3(1^2+2^2+\cdots+n^2).\]

We can also group similar terms together. If every contribution includes an added \( 3 \), that part occurs once per term, giving \( 3n \) altogether. When we regroup a total this way, we need to count the constant terms as well as follow the changing ones.

We derived the first identity by pairing in Explore. The square and cube identities let us do the same kind of calculation for higher powers. Together, these formulas turn long finite totals into expressions whose limits we can calculate.

When we want an actual value from a polynomial sum, the finite-sum identities let us simplify before taking the limit. Keep track of the width as well as the rectangle height: each can contribute a power of \( n \) to the denominator.

The same reasoning works when part of the graph lies below the axis. For \( f(x)=x-1 \) on \( [0,2] \), the rectangles on the first half contribute negative amounts, while those on the second half contribute positive amounts. The two regions have equal area, so their contributions cancel and the integral is \( 0 \).

The region below the axis contributes a negative amount that cancels the positive amount from the region above it.

The Fundamental Theorem of Calculus

For functions such as \( x \) and \( x^2 \), formulas for finite sums let us calculate the Darboux sums and take their limits. The same approach works for other positive integer powers when we have the corresponding sum formulas. With more complicated functions, though, finding a useful formula for those sums can become a problem of its own. It would be much easier to use the antiderivative calculations we've been doing all along: find an antiderivative, evaluate it at the endpoints, and subtract.

The Fundamental Theorem of Calculus tells us why that calculation gives the integral we've just defined. We now have the tools to connect the two: the derivative's limit definition makes instantaneous rates precise, and the Mean Value Theorem connects those rates to changes over a whole interval. Applying that connection on each piece of a partition will let us trap the change in an antiderivative between the lower and upper sums.

Since \( f' \) is continuous, its integral exists, and we can investigate it using lower and upper sums. Start with a partition \( a=x_0<x_1<\cdots<x_n=b \), and let \( m_1,m_2,\ldots,m_n \) and \( M_1,M_2,\ldots,M_n \) be the smallest and largest values of \( f' \) on the pieces.

On the first piece, the Mean Value Theorem says that the average rate of change of \( f \) equals its derivative somewhere inside that piece. That derivative value lies between \( m_1 \) and \( M_1 \), so

\[m_1\le\frac{f(x_1)-f(x_0)}{x_1-x_0}\le M_1.\]

Multiplying by the positive width \( \Delta x_1=x_1-x_0 \) gives bounds on the change in \( f \):

\[m_1\Delta x_1\le f(x_1)-f(x_0)\le M_1\Delta x_1.\]

We can repeat this on every piece and then add the inequalities. On the left, we get the lower sum for \( f' \); on the right, we get its upper sum. The terms in between add up all the changes in \( f \) as we move from \( x_0 \) to \( x_n \).

Writing those changes one below another helps us see how they add together:

\[\begin{aligned}&f(x_1)-f(x_0)\\&{}+f(x_2)-f(x_1)\\&{}+f(x_3)-f(x_2)\\&{}+\cdots\\&{}+f(x_{n-1})-f(x_{n-2})\\&{}+f(x_n)-f(x_{n-1}).\end{aligned}\]

The \( f(x_1) \) in the first line cancels with the \( -f(x_1) \) in the second, then \( f(x_2) \) cancels with \( -f(x_2) \) in the next line, and so on. Every interior value cancels, leaving only the final value minus the initial value. Since \( x_n=b \) and \( x_0=a \), the sum is

\[f(x_n)-f(x_0)=f(b)-f(a).\]

We call this telescoping: like the sections of a telescope sliding together, the long sum collapses into a much shorter expression.

For \( f'(x)=x^2 \) and \( \displaystyle f(x)=\frac{x^3}3 \), the red samples make each green rectangle's area equal the change in \( f \) across its piece. The Mean Value Theorem places each sample at a height between the smallest and largest values on its piece.

Adding the inequalities therefore gives

\[s_n\le f(b)-f(a)\le S_n.\]

Now choose \( n \) equal pieces. Their widths are \( \displaystyle \frac{b-a}n \), so every piece shrinks as \( n\to\infty \). Since \( f' \) is continuous, both sums approach its integral:

\[\limit{n\to\infty}s_n=\int_a^b f'(x)\dd{x}=\limit{n\to\infty}S_n.\]

The endpoint difference stays between these sums for every \( n \), so the Squeeze Theorem gives

\[\limit{n\to\infty}\qty[f(b)-f(a)]=\int_a^b f'(x)\dd{x}.\]

Since \( f(b)-f(a) \) is constant as \( n \) changes, its limit is that same difference. Thus

\[f(b)-f(a)=\int_a^b f'(x)\dd{x}.\]

Whenever we can find an antiderivative of a continuous function, we can therefore calculate its integral by subtracting two endpoint values. The theorem takes care of the connection to the lower and upper sums, so we can use our derivative rules to do the calculation. Adding a constant to the antiderivative gives the same result, since that constant cancels in the subtraction.

This brings our work with limits back to the relationship that has guided us throughout calculus: accumulating a rate of change recovers the total change. We began by reasoning with infinitesimal changes, and now finite sums, the Mean Value Theorem, and the Squeeze Theorem give that reasoning a precise foundation. The antiderivative method we've been using computes exactly the accumulated total defined by our bounds.

  1. Use the graph below and the dividing points \( 0,1,3,4 \) to construct lower and upper sums for \( \displaystyle \int_0^4 f(x)\dd{x} \).

    1. Sketch the graph and label the dividing points \( x_0,x_1,x_2,x_3 \). On each piece, mark its smallest height \( m_i \) and largest height \( M_i \). Include any heights reached between the dividing points.

      Solution

      The dividing points are \( \displaystyle x_0=0 \), \( \displaystyle x_1=1 \), \( \displaystyle x_2=3 \), and \( \displaystyle x_3=4 \). The first piece rises from height \( \displaystyle 1 \) to height \( \displaystyle 2 \). The middle piece starts and ends at height \( \displaystyle 2 \), but reaches height \( \displaystyle 4 \) between them. The last piece falls from height \( \displaystyle 2 \) to height \( \displaystyle -1 \).

    2. Use your labels to record the width and the two heights for each piece.

      Piece \( 1 \): \( x_1-x_0= \), \( m_1= \), and \( M_1= \).

      Piece \( 2 \): \( x_2-x_1= \), \( m_2= \), and \( M_2= \).

      Piece \( 3 \): \( x_3-x_2= \), \( m_3= \), and \( M_3= \).

      Solution

      Subtracting consecutive dividing points gives widths \( \displaystyle 1,2,1 \). Reading the heights from the graph gives \( \displaystyle m_1=1 \), \( \displaystyle m_2=2 \), and \( \displaystyle m_3=-1 \) for the lower sum, and \( \displaystyle M_1=2 \), \( \displaystyle M_2=4 \), and \( \displaystyle M_3=2 \) for the upper sum.

    3. Multiply each height by its piece's width to find \( s_3= \) and \( S_3= \). Write one inequality showing what these sums tell us about the integral, and explain why it holds.

      Solution

      Each piece contributes its height times its width. Using the smaller heights gives

      \[s_3=1\cdot1+2\cdot2+(-1)\cdot1=4,\]

      while using the larger heights gives

      \[S_3=2\cdot1+4\cdot2+2\cdot1=12.\]

      On every piece, the function stays between the two chosen heights, so the integral stays between the lower and upper sums:

      \[4\le\int_0^4f(x)\dd{x}\le12.\]

      The last lower contribution is negative because its height is below the axis. Including that sign keeps the lower sum below the integral.

  2. We divide the interval of a continuous function into more and more pieces, obtaining the lower and upper sums

    \[s_n=${a}-\frac{${p}}n,\qquad S_n=${a}+\frac{${q}}n.\]

    The gap is \( S_n-s_n= \). Both sums approach , so the integral equals . Explain how the Squeeze Theorem gives this conclusion.

    Solution

    Subtracting the lower sum from the upper sum gives \( \displaystyle \frac{${p+q}}n \), which approaches \( \displaystyle 0 \). The integral stays between the sums as they both approach \( \displaystyle ${a} \), so the Squeeze Theorem gives that same value for the integral.

  3. Use \( \displaystyle 1+2+\cdots+n=\frac{n(n+1)}2 \) to simplify these sums, each with \( n \) terms. In part (c), use the results of parts (a) and (b).

    1. \( ${c}+${c}+\cdots+${c}= \).

      Solution

      Adding \( \displaystyle ${c} \) a total of \( \displaystyle n \) times gives \( \displaystyle ${c}n \).

    2. \( ${a}+${2*a}+\cdots+${a}n= \).

      Solution

      Each term is \( \displaystyle ${a} \) times the corresponding integer, so we can factor out \( \displaystyle ${a} \) and use the identity:

      \[${a}(1+2+\cdots+n)=${a}\cdot\frac{n(n+1)}2.\]

    3. \( ${a+c}+${2*a+c}+\cdots+(${a}n+${c})= \).

      Solution

      Each term adds \( \displaystyle ${c} \) to the corresponding term from part (b). Adding all \( \displaystyle n \) of these terms therefore combines the two earlier totals:

      \[${a}\cdot\frac{n(n+1)}2+${c}n.\]

  4. Let \( f(x)=${formula} \) on \( [0,1] \). Use \( n \) equal pieces to evaluate its integral with lower and upper sums.

    1. Each width is . Since the function increases, the upper heights come from \( \displaystyle \frac1n,\frac2n,\ldots,1 \). Regrouping the heights gives:

      \[S_n=\qty[${c}n+\frac{${a}}n(1+2+\cdots+n)]\frac1n.\]

      After using the integer-sum identity, \( S_n= \).

      Solution

      Every height includes the constant \( \displaystyle ${c} \), which contributes \( \displaystyle ${c}n \) when we add all \( \displaystyle n \) heights. The remaining terms are multiples of \( \displaystyle \frac{${a}}n \), so we can use the sum of the integers from \( \displaystyle 1 \) through \( \displaystyle n \):

      \[\begin{aligned}S_n&=\qty[${c}n+\frac{${a}}n\cdot\frac{n(n+1)}2]\frac1n\\&=${c}+\frac{${a}(n+1)}{2n}.\end{aligned}\]

    2. On each piece, the upper height exceeds the lower height by \( \displaystyle \frac{${a}}n \). Multiplying by the width and adding all \( n \) differences gives \( S_n-s_n= \). Use this to find \( s_n \) and then the integral.

      Solution

      The difference in heights is \( \displaystyle \frac{${a}}n \), and each piece has width \( \displaystyle \frac1n \), so the upper and lower rectangle areas differ by \( \displaystyle \frac{${a}}{n^2} \). Adding these differences across all \( \displaystyle n \) pieces gives a total gap of \( \displaystyle \frac{${a}}n \), so

      \[\begin{aligned}s_n&=${c}+\frac{${a}(n+1)}{2n}-\frac{${a}}n\\&=${c}+\frac{${a}(n-1)}{2n}.\end{aligned}\]

      Since both sums approach \( \displaystyle ${answer} \), they squeeze the integral to that value: \( \displaystyle \int_0^1(${formula})\dd{x}=${answer} \).

  5. Let \( f(x)=x^2+${c} \). Evaluate \( \displaystyle \int_0^1f(x)\dd{x} \) using \( n \) equal pieces and the identity \( \displaystyle 1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}6 \).

    1. Because the function increases on this interval, its largest height on each piece occurs at the right endpoint. Using those heights gives the upper sum

      \[S_n=\qty(\frac{1^2+2^2+\cdots+n^2}{n^2}+${c}n)\frac1n.\]

      Use the identity, multiply out the numerator, and simplify to get \( S_n= \).

      Solution

      The width multiplies both the square terms and the constant terms:

      \[\begin{aligned}S_n&=\frac{n(n+1)(2n+1)}{6n^3}+${c}\\&=\frac{2n^3+3n^2+n}{6n^3}+${c}\\&=\frac13+\frac1{2n}+\frac1{6n^2}+${c}.\end{aligned}\]

    2. For the lower sum, we use the heights at \( \displaystyle 0,\frac1n,\ldots,\frac{n-1}n \). Compare the two lists of heights: the lower list includes \( f(0) \) where the upper list includes \( f(1) \), and all their other terms match. Hence \( S_n-s_n= \). What is the integral?

      Solution

      When we subtract the totals of the heights, all the matching terms cancel, leaving \( \displaystyle f(1)-f(0)=(${c}+1)-${c}=1 \). Multiplying by the common width gives \( \displaystyle S_n-s_n=\frac1n \). Thus

      \[s_n=\frac13-\frac1{2n}+\frac1{6n^2}+${c}.\]

      Both sums approach \( \displaystyle ${answer} \), so the integral is \( \displaystyle ${answer} \).

  6. Each sum below contains \( n \) function values, and the factor on the right is the width of each piece. Identify the function and interval, then write the limit as an integral. You can leave the integral unevaluated.

    1. \[\limit{n\to\infty}\qty[\cos\qty(\frac1n)+\cos\qty(\frac2n)+\cdots+\cos1]\frac1n.\]

      Solution

      The heights are cosine values at equally spaced points from \( \displaystyle \frac1n \) through \( \displaystyle 1 \). These are right endpoints of pieces covering \( \displaystyle [0,1] \), so the limit is \( \displaystyle \int_0^1\cos x\dd{x} \). Continuity ensures that these rectangle sums approach the integral.

    2. \[\limit{n\to\infty}\qty[\qty(\frac2n)^2+\qty(\frac4n)^2+\cdots+2^2]\frac2n.\]

      Solution

      Here the function is \( \displaystyle f(x)=x^2 \) and the width is \( \displaystyle \frac2n \). The \( \displaystyle n \) pieces cover \( \displaystyle [0,2] \), giving \( \displaystyle \int_0^2x^2\dd{x} \).

  7. For each function below, decide whether its integral over \( [0,1] \) exists. Explain your reasoning using continuity or the gap between lower and upper sums.

    1. \( f(x)=\cos x \).

      Solution

      Cosine is continuous on \( \displaystyle [0,1] \), so it is integrable there. Taking sufficiently small pieces makes the lower and upper sums as close as we like.

    2. \( g(x)=0 \) for \( \displaystyle x<\frac12 \), and \( g(x)=1 \) for \( \displaystyle x\ge\frac12 \).

      Solution

      To keep the jump within a short piece, place dividing points at \( \displaystyle \frac12-\delta \) and \( \displaystyle \frac12 \), where \( \displaystyle 0<\delta<\frac12 \). On the three pieces \( \displaystyle \qty[0,\frac12-\delta] \), \( \displaystyle \qty[\frac12-\delta,\frac12] \), and \( \displaystyle \qty[\frac12,1] \), only the middle piece has different upper and lower heights. Its width is \( \displaystyle \delta \) and its height difference is \( \displaystyle 1 \), so the gap is \( \displaystyle \delta \). We can make this arbitrarily small, so the function is integrable despite the jump.

    3. \( h(x)=x \) when \( x \) is rational, and \( h(x)=0 \) when \( x \) is irrational.

      Solution
      The blue guide follows \( y=x \) for rational inputs, while the orange guide follows \( y=0 \) for irrational inputs; they meet at \( (0,0) \). Both types of input occur in every interval, however small. An exact picture would need to distinguish infinitely many interspersed points, so the shaded bands and dots are a visual approximation of where those values lie.

      Every piece contains irrational inputs, so its smallest height is \( \displaystyle 0 \). It also contains rational inputs arbitrarily close to its right endpoint. At those inputs, the height equals the input, so the least upper bound on \( \displaystyle [x_{i-1},x_i] \) is \( \displaystyle x_i \).

      The lower sum is therefore always \( \displaystyle 0 \), while the upper sum is the same as the upper sum for \( \displaystyle y=x \). We found in Explore that \( \displaystyle \int_0^1x\dd{x}=\frac12 \), so every such upper sum is at least \( \displaystyle \frac12 \). The gap between the lower and upper sums stays at least \( \displaystyle \frac12 \), which means \( \displaystyle h \) is not integrable.

  8. The graph below shows a function \( f \) defined on the open interval \( (0,1) \).

    1. The greatest lower bound of its values is , and the least upper bound is . Does the function attain either bound? Explain why a larger lower bound or a smaller upper bound would fail.

      Solution

      The values satisfy \( \displaystyle 1<f(x)<2 \), so neither bound is attained. Values get as close to \( \displaystyle 1 \) as we like near the right endpoint, and as close to \( \displaystyle 2 \) as we like near the left endpoint. Any proposed lower bound above \( \displaystyle 1 \) would exceed some function values; any proposed upper bound below \( \displaystyle 2 \) would fall below some values.

    2. Add endpoint values that make the function continuous on \( [0,1] \), then use the resulting trapezoid to find \( \displaystyle \int_0^1f(x)\dd{x} \).

      Solution

      Set \( \displaystyle f(0)=2 \) and \( \displaystyle f(1)=1 \). The trapezoid has width \( \displaystyle 1 \) and heights \( \displaystyle 2 \) and \( \displaystyle 1 \), giving an integral of \( \displaystyle \frac{2+1}2\cdot1=\frac32 \). The endpoint values fit the same bounds that we found from the open interval.

  9. Let \( f(x)=x^2 \), so \( f'(x)=2x \). Use the dividing points \( 0,1,2,3 \) to connect changes in \( f \) with the integral of \( f' \).

    1. The successive changes in \( f \) are \( f(1)-f(0)= \), \( f(2)-f(1)= \), and \( f(3)-f(2)= \). Add them by writing out the function values, then explain which terms cancel.

      Solution

      The changes are \( \displaystyle 1 \), \( \displaystyle 3 \), and \( \displaystyle 5 \), adding to \( \displaystyle 9 \). To see how this total comes from the endpoint values, write the changes as

      \[\begin{aligned}&\qty[f(1)-f(0)]\\&\quad+\qty[f(2)-f(1)]\\&\quad+\qty[f(3)-f(2)].\end{aligned}\]

      Each of the intermediate values, \( \displaystyle f(1) \) and \( \displaystyle f(2) \), appears once with a plus sign and once with a minus sign. Those terms cancel, so the sum telescopes to \( \displaystyle f(3)-f(0)=9 \).

    2. For \( f'(x)=2x \), calculate the lower and upper sums on these three pieces: \( s_3= \) and \( S_3= \). Check that the total change from part (a) lies between them.

      Solution

      The lower heights are \( \displaystyle 0,2,4 \), and the upper heights are \( \displaystyle 2,4,6 \). With width \( \displaystyle 1 \), these give \( \displaystyle s_3=6 \) and \( \displaystyle S_3=12 \). Indeed, \( \displaystyle 6\le9\le12 \).

    3. As we make all the pieces smaller, the lower and upper sums for \( f' \) approach its integral. Throughout this process, the total change in \( f \) stays between the two sums. What does this tell us about \( \displaystyle \int_0^3 2x\dd{x} \)?

      Solution

      The changes in \( \displaystyle f \) telescope to \( \displaystyle f(3)-f(0)=9 \) on every partition. On each piece, the Mean Value Theorem tells us that the change in \( \displaystyle f \) lies between the lower rectangle contribution and the upper one. Adding these inequalities puts the total change between the two sums. Since \( \displaystyle f' \) is continuous, the sums approach its integral and squeeze that fixed total change between them. Consequently, \( \displaystyle \int_0^3 2x\dd{x}=f(3)-f(0)=9 \).