Riemann Sums and Definite Integrals

⚡ Key Takeaways

Riemann sums approximate the area under a curve by summing the areas of many thin rectangles; the definite integral is the exact limit of this sum as the rectangles become infinitely thin. In words: ∫abf(x) dx\int_a^b f(x)\,dx equals the signed area between ff and the xx-axis on [a,b][a,b]. Applies to continuous (and most piecewise-continuous) functions on a closed interval. Formalized by Bernhard Riemann (1854), building on Newton, Leibniz, and Cauchy.

💡 The Core Insight

You cannot directly compute the area under a curved boundary, but you can compute the area of a rectangle. So replace the curve with a staircase of rectangles you understand, then crush the staircase down by using more and more, thinner and thinner rectangles. If the total rectangle-area settles toward one number no matter how you slice or where you sample, that number is the definite integral. Integration is controlled, exact approximation.

Formal Statement

DefinitionPartition of an Interval

A partition PP of a closed interval [a,b][a,b] is a finite set of points

1
P={a=x0<x1<x2<⋯<xn=b}\quad P = \{a = x_0 < x_1 < x_2 < \cdots < x_n = b\}

Derivation hint: a partition simply lists the cut points; the subintervals are [xi−1,xi][x_{i-1},x_i]. The ii-th subinterval is [xi−1,xi][x_{i-1}, x_i] with width

2
Δxi=xi−xi−1\quad \Delta x_i = x_i - x_{i-1}

Derivation hint: width = right endpoint minus left endpoint. The norm (or mesh) of the partition is the width of the widest subinterval:

3
∥P∥=max⁡1≤i≤nΔxi\quad \|P\| = \max_{1 \le i \le n} \Delta x_i

Derivation hint: the mesh measures the coarseness of the slicing; small ∥P∥\|P\| forces every piece to be thin.

DefinitionRiemann Sum

Given a function ff defined on [a,b][a,b], a partition PP, and a choice of sample point xi∗∈[xi−1,xi]x_i^* \in [x_{i-1}, x_i] in each subinterval, the corresponding Riemann sum is

4
S(P,f)=∑i=1nf(xi∗) Δxi\quad S(P, f) = \sum_{i=1}^{n} f(x_i^*)\,\Delta x_i

Derivation hint: each term f(xi∗)Δxif(x_i^*)\Delta x_i is (height at the sample point) × (width) = area of one rectangle; sum them. Symbols: f(xi∗)f(x_i^*) is the rectangle's height (negative where f<0f<0), Δxi\Delta x_i its width, nn the number of rectangles. Special sample choices yield named sums:

  • Left sum LnL_n: take xi∗=xi−1x_i^* = x_{i-1}.
  • Right sum RnR_n: take xi∗=xix_i^* = x_i.
  • Midpoint sum MnM_n: take xi∗=12(xi−1+xi)x_i^* = \tfrac{1}{2}(x_{i-1}+x_i).
  • Upper sum U(P,f)U(P,f) / lower sum L(P,f)L(P,f): take the supremum / infimum of ff on each subinterval.

For a regular (uniform) partition every subinterval has equal width:

5
Δx=b−an,xi=a+i Δx\quad \Delta x = \frac{b-a}{n}, \qquad x_i = a + i\,\Delta x

Derivation hint: split [a,b][a,b] of length b−ab-a into nn equal pieces; the ii-th cut sits ii widths past aa. The right Riemann sum on a uniform partition then becomes the workhorse formula:

6
Rn=∑i=1nf ⁣(a+i b−an)b−an\quad R_n = \sum_{i=1}^{n} f\!\left(a + i\,\frac{b-a}{n}\right)\frac{b-a}{n}

Derivation hint: substitute the uniform Δx\Delta x and right sample point xi=a+iΔxx_i = a+i\Delta x into equation [4].

DefinitionThe Definite Integral

The function ff is Riemann integrable on [a,b][a,b] if there is a number II such that the Riemann sums approach II as the mesh shrinks to zero — regardless of the partitions or sample points chosen. That number is the definite integral:

7
∫abf(x) dx=lim⁡∥P∥→0∑i=1nf(xi∗) Δxi\quad \int_a^b f(x)\,dx = \lim_{\|P\| \to 0} \sum_{i=1}^{n} f(x_i^*)\,\Delta x_i

Derivation hint: the integral sign ∫\int is an elongated "S" for Sum; f(x) dxf(x)\,dx is the limiting form of f(xi∗)Δxif(x_i^*)\Delta x_i as the width becomes infinitesimal. Here aa is the lower limit, bb the upper limit, ff the integrand, and dxdx marks the variable of integration. The variable is a dummy: ∫abf(x) dx=∫abf(t) dt\int_a^b f(x)\,dx = \int_a^b f(t)\,dt.

TheoremIntegrability of Continuous Functions

If ff is continuous on [a,b][a,b], then ff is Riemann integrable on [a,b][a,b]. More generally, a bounded function on [a,b][a,b] is Riemann integrable if and only if its set of discontinuities has measure zero (Lebesgue's criterion). Monotonic functions are always integrable, even with jumps.

TheoremThe Fundamental Theorem of Calculus, Part 2

If ff is continuous on [a,b][a,b] and FF is any antiderivative of ff (so F′=fF'=f), then

8
∫abf(x) dx=F(b)−F(a)\quad \int_a^b f(x)\,dx = F(b) - F(a)

Derivation hint: define A(x)=∫axfA(x)=\int_a^x f; FTC Part 1 gives A′=fA'=f, so AA and FF differ by a constant, which cancels in F(b)−F(a)F(b)-F(a). This is the master shortcut: it lets you skip the limit of sums entirely once you can find an antiderivative.

Why It Holds / Derivation

ProofComputing ∫01x2 dx\int_0^1 x^2\,dx from the definition

We evaluate the definite integral directly as a limit of right Riemann sums, with no antiderivative shortcut, to show the machinery works.

Step 1 — Set up the uniform partition. With a=0a=0, b=1b=1, Δx=1n\Delta x = \tfrac{1}{n} and right endpoints xi=inx_i = \tfrac{i}{n}.

Step 2 — Write the Riemann sum. Using [6] with f(x)=x2f(x)=x^2:

9
Rn=∑i=1n(in)21n=1n3∑i=1ni2\quad R_n = \sum_{i=1}^{n}\left(\frac{i}{n}\right)^2 \frac{1}{n} = \frac{1}{n^3}\sum_{i=1}^{n} i^2

Derivation hint: pull the constant 1/n31/n^3 out of the sum since it does not depend on ii.

Step 3 — Apply the sum-of-squares formula. Use the closed form ∑i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}:

10
Rn=1n3⋅n(n+1)(2n+1)6=(n+1)(2n+1)6n2\quad R_n = \frac{1}{n^3}\cdot\frac{n(n+1)(2n+1)}{6} = \frac{(n+1)(2n+1)}{6n^2}

Derivation hint: substitute the closed form and cancel one factor of nn.

Step 4 — Expand and take the limit. Multiply out the numerator: (n+1)(2n+1)=2n2+3n+1(n+1)(2n+1) = 2n^2 + 3n + 1, so

11
Rn=2n2+3n+16n2=13+12n+16n2\quad R_n = \frac{2n^2+3n+1}{6n^2} = \frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}

Derivation hint: divide each term by 6n26n^2.

Step 5 — Conclude. As n→∞n\to\infty the last two terms vanish:

12
∫01x2 dx=lim⁡n→∞(13+12n+16n2)=13\quad \int_0^1 x^2\,dx = \lim_{n\to\infty}\left(\frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}\right) = \frac{1}{3}

Derivation hint: 1/(2n)→01/(2n)\to 0 and 1/(6n2)→01/(6n^2)\to 0, leaving only 1/31/3. The same answer follows instantly from [8] since F(x)=x3/3F(x)=x^3/3 gives F(1)−F(0)=13F(1)-F(0)=\tfrac{1}{3} — confirming the limit is exact, not approximate. ■\blacksquare

∎

:::svg[Right Riemann sum approximating the area under f(x)=x2f(x)=x^2 on [0,1][0,1] with n=5n=5 rectangles. Each rectangle's height is set by the curve at its right edge.] ```svg x y 1 0 1 f(x)=x² each width Δx = 1/5 ```

Building Intuition

🧠 Intuition

Picture filling a curved swimming pool with stacked bricks of equal width. The bricks can't perfectly hug the curved boundary, so a right sum on an increasing function overshoots (bricks poke above the curve) and a left sum undershoots. The genuine area is sandwiched between them. As you switch to thinner bricks, the overshoot and undershoot shrink toward each other, squeezing onto a single number — the integral. The signed area idea is the second key. Where ff dips below the axis, its rectangles have negative height, so they subtract. Thus ∫02πsin⁡x dx=0\int_0^{2\pi}\sin x\,dx = 0: the positive hump from 00 to π\pi exactly cancels the negative trough from π\pi to 2π2\pi. An integral is not "how much paint," it's "area above minus area below." The third intuition is accumulation. If f(t)f(t) is your speed at time tt, each rectangle f(ti∗)Δtf(t_i^*)\Delta t is approximately "speed × little time = little distance." Summing gives total distance, and the limit gives it exactly. The integral accumulates a rate into a total — which is exactly why it inverts the derivative.

BR
Bernhard Riemann
1826–1866

Georg Friedrich Bernhard Riemann, a student of Gauss at Göttingen, gave the first rigorous, general definition of the integral in his 1854 Habilitationsschrift on trigonometric series. Earlier, Cauchy had defined integrals only for continuous functions using left endpoints; Riemann's leap was to allow arbitrary sample points and arbitrary partitions and to demand the limit exist independent of those choices. This made it possible to ask precisely which functions are integrable — including badly discontinuous ones arising in Fourier analysis. Riemann is even more famous for Riemannian geometry (the mathematical bedrock of general relativity) and the still-unsolved Riemann Hypothesis. He died of tuberculosis at 39.

Worked Examples

ExampleEstimating ∫131x dx\int_1^3 \frac{1}{x}\,dx with a midpoint sum, n=4n=4

Given: f(x)=1/xf(x)=1/x, interval [1,3][1,3], n=4n=4 subintervals.

Step 1 — Width. Δx=3−14=0.5\Delta x = \dfrac{3-1}{4} = 0.5.

Step 2 — Subintervals and midpoints. [1,1.5],[1.5,2],[2,2.5],[2.5,3][1,1.5],[1.5,2],[2,2.5],[2.5,3] give midpoints x∗=1.25, 1.75, 2.25, 2.75x^*=1.25,\,1.75,\,2.25,\,2.75.

Step 3 — Heights. f(1.25)=0.8000, f(1.75)=0.5714, f(2.25)=0.4444, f(2.75)=0.3636f(1.25)=0.8000,\ f(1.75)=0.5714,\ f(2.25)=0.4444,\ f(2.75)=0.3636.

Step 4 — Midpoint sum.

13
M4=Δx∑f(xi∗)=0.5(0.8000+0.5714+0.4444+0.3636)\quad M_4 = \Delta x\sum f(x_i^*) = 0.5(0.8000+0.5714+0.4444+0.3636)

Derivation hint: factor the common width Δx=0.5\Delta x=0.5 out of all four rectangle areas. M4=0.5(2.1794)=1.0897M_4 = 0.5(2.1794) = 1.0897.

Step 5 — Compare to the exact value ∫131x dx=ln⁡3−ln⁡1=ln⁡3≈1.0986\int_1^3 \tfrac1x\,dx = \ln 3 - \ln 1 = \ln 3 \approx 1.0986.

M4≈1.0897(error≈0.0089, dimensionless)\boxed{M_4 \approx 1.0897 \quad (\text{error} \approx 0.0089,\ \text{dimensionless})}

The midpoint rule already lands within 1% using just 4 rectangles — far better than a left or right sum of the same nn.

ExampleDistance from velocity via a Riemann sum

Given: a cart's velocity (m/s) sampled every 2 s:

tt (s)02468
vv (m/s)05899

We want total distance ∫08v(t) dt\displaystyle\int_0^8 v(t)\,dt over [0,8][0,8].

Step 1 — Width. Each gap is Δt=2\Delta t = 2 s.

Step 2 — Left Riemann sum (uses left endpoints 0,2,4,60,2,4,6):

14
L4=Δt [ v(0)+v(2)+v(4)+v(6) ]=2(0+5+8+9)\quad L_4 = \Delta t\,[\,v(0)+v(2)+v(4)+v(6)\,] = 2(0+5+8+9)

Derivation hint: each term is "velocity at the interval's start × time interval" = a lower-end distance estimate. L4=2(22)=44L_4 = 2(22) = 44 m.

Step 3 — Right Riemann sum (uses 2,4,6,82,4,6,8):

15
R4=2(5+8+9+9)=2(31)=62 m\quad R_4 = 2(5+8+9+9) = 2(31) = 62\text{ m}

Derivation hint: shift the sample to each interval's right end; for increasing vv this over-estimates.

Step 4 — Best simple estimate (trapezoid = average).

distance≈L4+R42=44+622=53 m\text{distance} \approx \frac{L_4+R_4}{2} = \frac{44+62}{2} = 53\text{ m}
distance≈53 m(44 m≤distance≤62 m)\boxed{\text{distance} \approx 53\ \text{m}\quad (44\ \text{m} \le \text{distance} \le 62\ \text{m})}

The true area lies between the left and right sums because vv is increasing.

Common Misconceptions

⚠️ Common mistake

The integral is not the area unless f≥0f\ge 0. ∫abf dx\int_a^b f\,dx is signed area. To get the geometric (total) area between the curve and the axis you must integrate ∣f∣|f|, splitting at the zeros: Area=∫ab∣f(x)∣ dx\text{Area}=\int_a^b |f(x)|\,dx. For sin⁡x\sin x on [0,2π][0,2\pi], the integral is 00 but the total area is 44.

More misconceptions:

  • dxdx is not "times dxdx" — it is a tag marking the integration variable and the limiting width; it is essential, not optional.
  • A larger nn does not always mean a more accurate left or right sum if you also enlarge the interval — accuracy depends on the mesh ∥P∥→0\|P\|\to 0, not nn alone.
  • Riemann integrability requires ff to be bounded on a finite, closed interval. Unbounded integrands or infinite limits need improper integrals, defined as separate limits.
  • ∫aaf dx=0\int_a^a f\,dx = 0 and ∫baf dx=−∫abf dx\int_b^a f\,dx = -\int_a^b f\,dx — reversing the limits flips the sign.
CounterexampleA bounded function that is NOT Riemann integrable

Let the Dirichlet function be

16
D(x)={1,x rational0,x irrational\quad D(x)=\begin{cases}1,& x\text{ rational}\\[2pt]0,& x\text{ irrational}\end{cases}

Derivation hint: every subinterval, no matter how small, contains both rationals and irrationals. On any subinterval DD has supremum 11 and infimum 00. Hence for every partition the upper sum is U=1⋅(b−a)U=1\cdot(b-a) while the lower sum is L=0L=0. They never close the gap, so the limit in [7] does not exist — DD is not Riemann integrable on [0,1][0,1], even though it is bounded. (It is Lebesgue integrable, with integral 00, because the rationals have measure zero — a hint at why a more powerful integral was eventually built.)

Connections

connection

Riemann sums sit at the crossroads of nearly all of calculus.

  • The Fundamental Theorem of Calculus converts the limit-of-sums into antiderivative evaluation, fusing definite integrals with the Derivative.
  • Indefinite Integrals and Antiderivatives supply the function FF needed by equation [8]; the definite integral attaches numbers to that family.
  • Numerical Integration (the Trapezoidal Rule and Simpson's Rule) are refined Riemann-type sums that converge faster by using trapezoids or parabolas instead of flat-topped rectangles.
  • Sequences and Series supply the closed-form summation identities (like ∑i2\sum i^2) and the limit reasoning that make direct evaluation possible.
  • The Lebesgue Integral generalizes the Riemann integral, repairing its failure on functions like the Dirichlet function and behaving better under limits.
  • In reverse, recognizing a hard sum as a Riemann sum lets you replace it with an integral — a standard trick for evaluating limits of sums.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- c. 250 BCE — Archimedes computes the area of a parabolic segment by the method of exhaustion, summing inscribed triangles — a conceptual ancestor of Riemann sums.
- c. 1000 CE — Ibn al-Haytham (Alhazen) sums fourth powers to find the volume of a paraboloid, effectively evaluating ∫x4 dx\int x^4\,dx geometrically.
- 1630s — Cavalieri and Fermat develop "indivisibles" and compute areas under xnx^n, anticipating the power rule for integrals.
- 1660s–1680s — Newton and Leibniz independently discover the Fundamental Theorem, linking area to antiderivatives; Leibniz introduces the ∫\int symbol (1675).
- 1823 — Augustin-Louis Cauchy gives the first rigorous integral definition, restricted to continuous functions using left-endpoint sums.
- 1854 — Bernhard Riemann generalizes to arbitrary partitions and sample points in his Habilitation, and characterizes integrability via upper and lower sums.
- 1875 — Gaston Darboux reformulates the theory using upper/lower (Darboux) sums, giving the clean modern integrability criterion.
- 1902 — Henri Lebesgue introduces measure-based integration, integrating the Dirichlet function and resolving the Riemann integral's limit defects.
- 1957–1963 — Kurzweil and Henstock define the gauge integral, an elegant extension that recovers the FTC in full generality and even contains the Lebesgue integral.

Subtleties & Limits

open-problem

The Riemann integral is powerful but has frayed edges that motivate deeper theory.

  • Failure under limits. If fn→ff_n\to f pointwise, ∫fn\int f_n need not converge to ∫f\int f, and ff may fail to be Riemann integrable even when all fnf_n are. This "limit-exchange" weakness is the main reason the Lebesgue integral was invented; understanding exactly when lim⁡∫=∫lim⁡\lim\int = \int\lim holds (dominated/monotone convergence) is essential in analysis.
  • The integrability boundary. Lebesgue's criterion (integrable   ⟺  \iff discontinuities have measure zero) is clean but pushes you to define "measure zero" rigorously — leading into measure theory.
  • Improper and oscillatory integrals. Integrals like ∫0∞sin⁡xx dx\int_0^\infty \frac{\sin x}{x}\,dx converge conditionally but not absolutely; whether such an integral exists depends subtly on cancellation, and Riemann's framework must be extended by limits.
  • High dimensions and curse of slicing. A grid Riemann sum in dd dimensions needs ndn^d boxes; for large dd this is infeasible, which is why Monte Carlo (randomized) integration dominates modern high-dimensional computation. Bounding its error is itself an active research area.

See Also

Fundamental Theorem of Calculus · Indefinite Integrals and Antiderivatives · Numerical Integration · Trapezoidal Rule · Simpson's Rule · Lebesgue Integral · Improper Integrals · Summation Notation and Series · Average Value of a Function