Build a sum for a definite integral
Three sums for one integral
The integral \(\int_0^4 2^x\,dx\) is the area under the curve \(y = 2^x\) from 0 to 4. A sum for this integral adds the areas of rectangles whose tops meet the curve.
With 4 pieces, each piece is \(\frac{4-0}{4} = 1\) wide, so the pieces start at 0, 1, 2 and 3. The area of each rectangle is its height times 1.
Move the slider to the left end. The heights are \(2^0, 2^1, 2^2, 2^3\), which are 1, 2, 4 and 8, and the sum is 15.
At the right end the heights are 2, 4, 8 and 16, and the sum is 30. In the middle the sum is about 21.2.
The three sums differ because the heights differ, while the width is 1 in all of them.
The same three steps for any integral
The integral \(\int_a^b f(x)\,dx\) fixes the interval and the function, and the sum needs two more choices: the number of pieces \(n\) and the sample points.
First, find the width \(\Delta x = \frac{b-a}{n}\). Second, find the sample point \(x_i\) of each piece.
Third, multiply each height \(f(x_i)\) by the width. Then add the \(n\) products.
Change \(n\) and move the sample points. The heights and the width change, but in every case the pieces fill the interval from \(a\) to \(b\).
Notation
A right sum reads piece \(i\) at its right end \(a + i\,\Delta x\). The last right end is \(b\), so the index runs from 1 to \(n\).
\[R_n = \sum_{i=1}^{n} \cy{f(a + i\,\Delta x)}\;\cg{\Delta x}\]A left sum reads each piece at its left end. The first piece is read at \(a\), so the index runs from 0 to \(n - 1\).
\[L_n = \sum_{i=0}^{n-1} \cy{f(a + i\,\Delta x)}\;\cg{\Delta x}\]A midpoint sum reads each piece halfway across it, half a width before its right end.
\[\begin{gathered} M_n = \sum_{i=1}^{n} \cy{f\!\left(a + \left(i - \tfrac12\right)\Delta x\right)}\;\cg{\Delta x} \\ \cg{\Delta x = \dfrac{b-a}{n}} \end{gathered}\]
Example 1: A right sum with three pieces
Write the right sum with 3 pieces for \(\displaystyle\int_0^{\pi/2}\cos x\,dx\).
The width is the length of the interval divided by 3.
\[\cg{\Delta x = \dfrac{\pi/2 - 0}{3} = \dfrac{\pi}{6}}\]The right ends of the pieces are \(\frac{\pi}{6}\), \(\frac{\pi}{3}\) and \(\frac{\pi}{2}\), so the heights are the values of the cosine there.
\[\begin{aligned} \cy{\cos\tfrac{\pi}{6}} &= \cy{\tfrac{\sqrt3}{2}} \\ \cy{\cos\tfrac{\pi}{3}} &= \cy{\tfrac12} \\ \cy{\cos\tfrac{\pi}{2}} &= \cy{0} \end{aligned}\]Each term is a height times \(\frac{\pi}{6}\), so the sum is \(\frac{\pi}{6}\) times the sum of the heights.
\[\begin{aligned} R_3 &= \cg{\dfrac{\pi}{6}}\left(\cy{\dfrac{\sqrt3}{2} + \dfrac12 + 0}\right) \\ &= \dfrac{\pi\left(\sqrt3 + 1\right)}{12} \approx 0.715 \end{aligned}\]The cosine falls on this interval, so each rectangle lies under the curve, as the bright teal gaps show. The sum is less than the area under the curve.
Example 2: A right sum with n pieces
Write the right sum with \(n\) pieces for \(\displaystyle\int_4^8 \left(x^2 - 4x\right)dx\).
The width is the length of the interval divided by \(n\).
\[\cg{\Delta x = \dfrac{8 - 4}{n} = \dfrac4n}\]A tempting wrong move: The right end of piece \(i\) is \(i\) widths from the start.
\[x_i = \dfrac{4i}{n}\]These points count widths from 0, so they run from \(\frac4n\) to 4 and the red rectangles cover the interval from 0 to 4. The integral is over the interval from 4 to 8.
The pieces start at 4, so the right end of piece \(i\) is 4 plus \(i\) widths.
\[\cy{x_i = 4 + \dfrac{4i}{n}}\]The height at \(x_i\) is \(x_i^2 - 4x_i\), and each term is this height times the width.
\[\begin{aligned} R_n = \sum_{i=1}^{n} \Big[ & \cy{\left(4 + \tfrac{4i}{n}\right)^2} \\ & \cy{{} - 4\left(4 + \tfrac{4i}{n}\right)} \Big]\,\cg{\frac4n} \end{aligned}\]As a check, put \(n = 2\). The sample points are 6 and 8, the heights are 12 and 32, and the width is 2.
\[R_2 = (12 + 32)\cdot 2 = 88\]
Practice
Write the left sum with \(n\) pieces for \(\displaystyle\int_1^3 \left(10 - x^2\right)dx\).
On the figure, the first rectangle is read at 1, the lower bound, and the last one at its left end, one width before 3.
Solution
The width is \(\frac{3-1}{n} = \frac2n\). The pieces start at 1, so the left sample points are \(1 + \frac{2i}{n}\) for \(i = 0\) to \(n - 1\).
\[\cy{x_i = 1 + \dfrac{2i}{n}}\]The height at a sample point is \(10 - x_i^2\), and each term is this height times the width.
\[L_n = \sum_{i=0}^{n-1}\cy{\left[10 - \left(1 + \frac{2i}{n}\right)^2\right]}\cg{\frac2n}\]As a check, put \(n = 4\). The sample points are 1, 1.5, 2 and 2.5, the width is 0.5, and the sum is 13.25.
\[\begin{aligned} L_4 &= (9 + 7.75 + 6 + 3.75)\cdot 0.5 \\ &= 13.25 \end{aligned}\]
Questions
Questions 1 and 2 use the figure of the curve \(y = 1 + \frac{x^2}{4}\) on the interval from 0 to 6. The three rectangles have equal width, and each is read at the left end of its piece.
What is the area of the third rectangle?
- 10
- 5
- 20
Answer
10
Compare the sum of the three areas with the area under the curve from 0 to 6. The sum is
- less than the area under the curve.
- greater than the area under the curve.
- equal to the area under the curve.
Answer
less than the area under the curve.
Which sum is the left sum with \(n\) pieces for \(\displaystyle\int_1^5 e^{-x}\,dx\)?
- \(\displaystyle\sum_{i=0}^{n-1}e^{-(1 + 4i/n)}\cdot\frac4n\)
- \(\displaystyle\sum_{i=1}^{n}e^{-(1 + 4i/n)}\cdot\frac4n\)
- \(\displaystyle\sum_{i=0}^{n-1}e^{-4i/n}\cdot\frac4n\)
Answer
\(\displaystyle\sum_{i=0}^{n-1}e^{-(1 + 4i/n)}\cdot\frac4n\)
Summary
You find the width, choose the sample point of each piece, multiply each height by the width and add.
This works because each product is the area of a rectangle on its piece, and the rectangles together fill the interval.
You use it to estimate an integral, and to write the sums whose limit is the integral.
This is one of four skills in topic 6.3 of Which & Why: AP Calculus.