Approximating integrals
Adding up rectangles
What is the area under y=x^2 between x=0 and x=2? No formula from geometry covers a curved edge. But you can find the area of rectangles. How close can rectangles get?
Cut the interval into n strips and stand a rectangle on each one. Change how the heights are chosen, then add more strips and watch the total close in on a single number.
Ochre rectangles count as positive area. Indigo rectangles, below the axis, count as negative.
| n | Sum | Error |
|---|
Left, right and midpoint sums
Split [a,b] into n strips of equal width \Delta x=\frac{b-a}{n}. The strip edges are x_i=a+i\,\Delta x for i=0,1,\dots,n. Each rule picks a different height for each rectangle:
| Rule | Height of rectangle i | Sum |
|---|---|---|
| Left | the left edge, f(x_{i-1}) | L_n=\Delta x\,[f(x_0)+\dots+f(x_{n-1})] |
| Right | the right edge, f(x_i) | R_n=\Delta x\,[f(x_1)+\dots+f(x_n)] |
| Midpoint | the middle, f\!\left(\frac{x_{i-1}+x_i}{2}\right) | M_n=\Delta x\,[f(\bar x_1)+\dots+f(\bar x_n)] |
When f is increasing, left sums underestimate and right sums overestimate. Why? Midpoint sums are usually far more accurate than either, as the error column shows. Where f is negative, the rectangles count as negative area. Try x^3-2x.
Every rule gets closer to the same number as n grows. What happens when n grows without bound is the subject of the next lesson.
Solve it step by step
Compute each approximation by hand. Decimals are fine. The score counts steps you answer correctly on the first try.
Common mistakes
- Using n + 1 sample points
There are n rectangles, so a left sum uses x_0 to x_{n-1} and a right sum uses x_1 to x_n.
- Forgetting to multiply by Δx
Each term is a height times a width. Adding the heights alone gives the wrong answer unless \Delta x=1.
- Counting every rectangle as positive
Where f(x)<0, a rectangle has negative height, so it subtracts from the sum.