Riemann sums

A definite integral is defined as the limit of a sum of the areas of thin rectangles1. We confirm it for f(x)=x2f(x) = x^2 from 00 to 22.

The sum built on left endpoints

Cut the interval into eight equal pieces of width 14\dfrac{1}{4} and stand a rectangle over each, taking the value at the left endpoint as its height.

14k=07(k4)2=164(0+1+4+9+16+25+36+49)=3516\frac{1}{4}\sum_{k=0}^{7} \left( \frac{k}{4} \right)^2 = \frac{1}{64} (0 + 1 + 4 + 9 + 16 + 25 + 36 + 49) = \frac{35}{16}

That is 3516=2.1875\dfrac{35}{16} = 2.1875, smaller than the true value 832.6667\dfrac{8}{3} \approx 2.6667. Using the height at the left endpoint underestimates an increasing function.

Trapping the value between left and right

ConstructionValueRelation to the true value
Left endpoints3516=2.1875\dfrac{35}{16} = 2.1875smaller
The true value832.6667\dfrac{8}{3} \approx 2.6667the reference
Right endpoints5116=3.1875\dfrac{51}{16} = 3.1875larger

The gap between them is 11, which is the difference of the end heights f(2)f(0)=4f(2) - f(0) = 4 multiplied by the width 14\dfrac{1}{4}. The true value always lies between the two.

Refining the partition

The left-endpoint sum for nn pieces works out as follows.

2nk=0n1(2kn)2=8n3(n1)n(2n1)683(n)\begin{align*} \frac{2}{n}\sum_{k=0}^{n-1} \left( \frac{2k}{n} \right)^2 &= \frac{8}{n^3} \cdot \frac{(n-1)n(2n-1)}{6} \\ &\longrightarrow \frac{8}{3} \quad (n \to \infty) \end{align*}

That limit is the value of the definite integral.

The general form

Cutting [a,b][a, b] into nn equal pieces of width Δx=ban\Delta x = \dfrac{b - a}{n}, the limit of the sum is the definite integral.

abf(x)dx=limnk=0n1f(a+kΔx)Δx\int_a^b f(x) \, dx = \lim_{n \to \infty} \sum_{k=0}^{n-1} f(a + k \Delta x) \, \Delta x

It looks like a computation of area, but it is really a limit of addition. That is why every quantity of the form multiply and add can be written as a definite integral.

  • Distance from velocity
  • Mass from density
  • A total from a unit price

The parabola on the graph is y=x2y = x^2, the staircase is the tops of the rectangles of width 14\dfrac{1}{4}, and the large dots are the two ends of the interval.

  1. Riemann sum, Wikipedia