Skip to content

The Riemann Integral

In this lesson you’ll build the integral from scratch using upper and lower sums, see the criterion that decides which functions are integrable, meet a bounded function that is not, and finally prove the fundamental theorem of calculus instead of quoting it.

Calculus defined the integral as a limit of sums with the partition getting finer, and left “the limit exists” undiscussed. Analysis reorganizes the definition so that existence becomes a checkable condition.

Let ff be bounded on [a,b][a,b]. Boundedness is assumed from the start, and it is what makes everything below well defined. A partition PP is a finite set of points

a=x0<x1<<xn=ba = x_0 < x_1 < \cdots < x_n = b

On the iith subinterval put mi=inffm_i = \inf f and Mi=supfM_i = \sup f, which exist by the completeness axiom because ff is bounded. Then

L(f,P)=i=1nmiΔxi,U(f,P)=i=1nMiΔxiL(f,P) = \sum_{i=1}^{n} m_i \Delta x_i, \qquad U(f,P) = \sum_{i=1}^{n} M_i \Delta x_i

Notice what is not here: no sample point is chosen, no continuity is assumed, and no limit is taken yet. Using inf and sup instead of function values at chosen points is the Darboux formulation, and it gives the same integral as Riemann’s while being much easier to work with.

If QQ refines PP - meaning PQP \subseteq Q - then

L(f,P)L(f,Q)U(f,Q)U(f,P)L(f,P) \le L(f,Q) \le U(f,Q) \le U(f,P)

Adding a point can only raise a lower sum and lower an upper sum, because the inf over a smaller set is at least as large. So refining tightens the trap and never loosens it.

A short but crucial consequence: every lower sum is below every upper sum, even for unrelated partitions, since both compare to their common refinement. Therefore

abf=supPL(f,P)infPU(f,P)=abf\underline{\int_a^b} f = \sup_P L(f,P) \le \inf_P U(f,P) = \overline{\int_a^b} f

Both numbers exist for any bounded ff. The lower integral is a supremum of a set bounded above; the upper is an infimum of a set bounded below. Completeness again.

ff is Riemann integrable on [a,b][a,b] if it is bounded and the lower and upper integrals agree. Their common value is abf\int_a^b f.

That is the whole definition. Integrability is the statement that the gap between the two integrals is zero.

The definition is hard to use directly, since it involves two sups and infs. This version is what you actually use:

ff is integrable on [a,b][a,b] if and only if for every ε>0\varepsilon > 0 there is some partition PP with

U(f,P)L(f,P)<εU(f,P) - L(f,P) < \varepsilon

You only need to exhibit one good partition per ε\varepsilon, and the structure is identical to every other ε\varepsilon argument in this section.

Every continuous function on [a,b][a,b] is integrable.

Proof sketch. [a,b][a,b] is compact, so ff is uniformly continuous. Given ε\varepsilon, choose δ\delta so that f(s)f(t)<ε/(ba)|f(s)-f(t)| < \varepsilon/(b-a) whenever st<δ|s-t| < \delta, and take any partition with mesh below δ\delta. On each subinterval Mimiε/(ba)M_i - m_i \le \varepsilon/(b-a), so

U(f,P)L(f,P)εbaΔxi=εU(f,P) - L(f,P) \le \frac{\varepsilon}{b-a}\sum \Delta x_i = \varepsilon

This is the payoff for the uniform continuity lesson. Ordinary continuity would give a different δ\delta at each point and no single mesh would work. Uniformity is what lets one partition handle the whole interval at once.

Every monotone function on [a,b][a,b] is integrable, even with infinitely many jumps.

For an increasing ff and a uniform partition of width Δx\Delta x, the differences Mimi=f(xi)f(xi1)M_i - m_i = f(x_i) - f(x_{i-1}) telescope:

UL=Δx(f(b)f(a))=(ba)(f(b)f(a))nU - L = \Delta x \big(f(b)-f(a)\big) = \frac{(b-a)(f(b)-f(a))}{n}

which goes to 0. Monotone functions can have countably many discontinuities and remain integrable.

More generally, a bounded function with finitely many discontinuities is integrable, and in fact one with a discontinuity set of measure zero is too - that last statement is the Lebesgue criterion, and it is the natural stopping point of this theory.

Let ff be 1 at every rational and 0 at every irrational, on [0,1][0,1]. Bounded, defined everywhere, and not integrable.

Every subinterval, however short, contains both rationals and irrationals. So mi=0m_i = 0 and Mi=1M_i = 1 for every subinterval of every partition, giving

L(f,P)=0andU(f,P)=1for all PL(f,P) = 0 \quad\text{and}\quad U(f,P) = 1 \quad\text{for all } P

The gap is 1 no matter how you refine. The lower integral is 0 and the upper integral is 1, so the definition simply does not apply.

This is the example that motivated Lebesgue’s integral, which handles it: the rationals are countable, so the “1” is spread over a set of measure zero and the Lebesgue integral is 0.

All of these are proved from the sums, and none is assumed:

  • Linearity. (αf+βg)=αf+βg\int (\alpha f + \beta g) = \alpha\int f + \beta\int g.
  • Additivity over intervals. acf=abf+bcf\int_a^c f = \int_a^b f + \int_b^c f for a<b<ca<b<c.
  • Monotonicity. fgf \le g implies fg\int f \le \int g.
  • The basic bound. abfabfM(ba)\left|\int_a^b f\right| \le \int_a^b|f| \le M(b-a) when fM|f|\le M.
  • Products. If f,gf,g are integrable so is fgfg, though fg\int fg is unrelated to fg\int f \cdot \int g.

The additivity proof is fussier than it looks, because it requires comparing partitions of the pieces with partitions of the whole. This is the usual pattern in this subject: the statements are unsurprising and the proofs are where the work is.

There are two halves, and they say different things.

First part (differentiating an integral). If ff is integrable on [a,b][a,b], define F(x)=axfF(x) = \int_a^x f. Then FF is continuous on [a,b][a,b]. If in addition ff is continuous at cc, then FF is differentiable at cc with F(c)=f(c)F'(c) = f(c).

Proof of the derivative claim. For h>0h > 0,

F(c+h)F(c)h=1hcc+hf\frac{F(c+h)-F(c)}{h} = \frac{1}{h}\int_c^{c+h} f

which is an average of ff over [c,c+h][c, c+h] and therefore lies between the inf and sup of ff there. Continuity at cc squeezes both toward f(c)f(c) as h0h \to 0. ∎

Note the strength of the continuity half: FF is continuous whenever ff is merely integrable. Integration smooths. Differentiation does the opposite.

Second part (evaluating an integral). If ff is integrable on [a,b][a,b] and FF is any antiderivative of ff there, then

abf=F(b)F(a)\int_a^b f = F(b) - F(a)

Proof. Take any partition. On each [xi1,xi][x_{i-1},x_i] the mean value theorem gives tit_i with

F(xi)F(xi1)=f(ti)ΔxiF(x_i)-F(x_{i-1}) = f(t_i)\Delta x_i

Summing, the left side telescopes to F(b)F(a)F(b)-F(a), while the right side is a sum with mif(ti)Mim_i \le f(t_i) \le M_i, so

L(f,P)F(b)F(a)U(f,P)L(f,P) \le F(b)-F(a) \le U(f,P)

for every partition PP. Since ff is integrable, the only number with that property is abf\int_a^b f. ∎

That is the MVT doing the work again. The theorem that made “+C” legitimate is also what turns the integral into a subtraction, which is why every definite integral you ever computed rests on it.

The two parts are not the same statement: the first builds an antiderivative out of an integral, the second uses any antiderivative to evaluate one. A function can be integrable without being a derivative, and can be a derivative without being integrable.

Example 1: Integrate x2x^2 over [0,1][0,1] from the definition.

Solution. Use the uniform partition with Δx=1/n\Delta x = 1/n. Since x2x^2 increases, mi=((i1)/n)2m_i = ((i-1)/n)^2 and Mi=(i/n)2M_i = (i/n)^2.

U(f,Pn)=1ni=1ni2n2=1n3n(n+1)(2n+1)6U(f,P_n) = \frac{1}{n}\sum_{i=1}^{n}\frac{i^2}{n^2} = \frac{1}{n^3}\cdot\frac{n(n+1)(2n+1)}{6}

which simplifies to 2n2+3n+16n213\frac{2n^2+3n+1}{6n^2} \to \frac13.

Similarly L(f,Pn)13L(f,P_n) \to \frac13, and indeed

UL=1n(f(1)f(0))=1n0U - L = \frac{1}{n}\big(f(1)-f(0)\big) = \frac{1}{n} \to 0

Both integrals equal 13\frac13, so 01x2=13\int_0^1 x^2 = \frac13. ✓

This is why nobody integrates from the definition twice. The fundamental theorem exists so this calculation never has to be repeated.

Example 2: Show the Dirichlet function is not integrable.

Solution. f=1f = 1 on rationals, 0 on irrationals, on [0,1][0,1].

Both rationals and irrationals are dense, so every subinterval of positive length contains points of each kind. Hence mi=0m_i = 0 and Mi=1M_i = 1 always, giving L(f,P)=0L(f,P)=0 and U(f,P)=1U(f,P)=1 for every PP.

The lower integral is 0, the upper is 1, and they differ. Not integrable.

Notice that no refinement helps at all - the gap is not shrinking slowly, it is constant.

Example 3: Integrate a step function.

Let f(x)=1f(x) = 1 for x[0,2)x \in [0,2) and f(x)=3f(x)=3 for x[2,5]x\in[2,5]. Compute 05f\int_0^5 f.

Solution. Use the partition {0,2,5}\{0, 2, 5\}. On [0,2][0,2], m=1m=1 and M=3M=3 because 2 is an endpoint of both pieces; that is inconvenient, so use {0,2η,2+η,5}\{0, 2-\eta, 2+\eta, 5\} for small η>0\eta>0 instead.

The middle strip contributes at most 32η3 \cdot 2\eta, and the outer strips give 1(2η)1\cdot(2-\eta) and 3(3η)3\cdot(3-\eta). As η0\eta \to 0,

UL22η0U - L \le 2 \cdot 2\eta \to 0

so ff is integrable with 05f=1(2)+3(3)=11\int_0^5 f = 1(2) + 3(3) = 11.

A single jump costs nothing, because you can isolate it inside a subinterval of arbitrarily small width, and a bounded function times a small width is small.

Example 4: Additivity is needed, not obvious.

Explain why 05f\int_0^5 f in Example 3 is not just "02+25\int_0^2 + \int_2^5" by definition.

Solution. The definition of 05f\int_0^5 f ranges over partitions of [0,5][0,5], and most of them do not include the point 2. To split at 2 you must first argue that inserting 2 changes neither integral, which is the refinement lemma, and then that partitions of the pieces combine to partitions of the whole.

The property is a theorem, not a definition. It’s a good illustration of how much of this subject consists of verifying things calculus used silently.

Example 5: Use the first part of the FTC.

Let F(x)=1x21tdtF(x) = \int_1^{x^2} \frac{1}{t}\,dt. Find F(x)F'(x) for x>0x > 0.

Solution. Let G(u)=1u1tdtG(u)=\int_1^u \frac1t dt. Since 1/t1/t is continuous on any interval avoiding 0, the first part gives G(u)=1/uG'(u)=1/u. Then F=G(x2)F = G \circ (x^2), and the chain rule gives

F(x)=1x22x=2xF'(x) = \frac{1}{x^2}\cdot 2x = \frac{2}{x}

Consistent with F(x)=ln(x2)=2lnxF(x) = \ln(x^2) = 2\ln x. ✓

The FTC supplies the derivative and the chain rule does the rest, which is the standard shape of these problems.

Example 6: An integrable function whose integral is not differentiable everywhere.

Take f=sign(x)f = \operatorname{sign}(x) on [1,1][-1,1], so f=1f=-1 for x<0x<0, f=1f=1 for x>0x>0, f(0)=0f(0)=0. What is F(x)=1xfF(x)=\int_{-1}^x f?

Solution. ff is bounded with one discontinuity, hence integrable. Computing, F(x)=(x+1)F(x) = -(x+1) for x0x\le0 and F(x)=x1F(x)=x-1 for x0x\ge0, so F(x)=x1F(x)=|x|-1.

FF is continuous everywhere, as the first part promises. But FF is not differentiable at 0, precisely where ff is discontinuous.

The differentiability half of the FTC needs continuity at the point, and this shows the hypothesis is not removable.

Example 7: Bound an integral without computing it.

Show 01dx1+x4\int_0^1 \frac{dx}{1+x^4} lies between 12\frac12 and 1.

Solution. On [0,1][0,1] the denominator runs from 1 to 2, so

1211+x41\tfrac12 \le \frac{1}{1+x^4} \le 1

Monotonicity of the integral gives 1201dx1+x41\frac12 \le \int_0^1 \frac{dx}{1+x^4} \le 1. ∎

The true value is about 0.86690.8669. Bounding the integrand and integrating the bounds is the most-used estimate in the subject, and it is a one-line consequence of monotonicity.

Numerical integration. Trapezoid, midpoint, and Simpson rules are partition sums with specified sample points, and their error bounds come from Taylor’s theorem on each subinterval. The Riemann criterion is what guarantees the answer they converge to exists.

Probability. A continuous distribution’s probabilities are integrals of a density. Cumulative distribution functions are exactly the F(x)=fF(x)=\int f of the first part of the FTC, which is why they are always continuous even when the density has jumps.

Signal processing. Energy, average power, and Fourier coefficients are all integrals of functions with jumps. Integrability of piecewise-continuous functions is the reason square waves and sampled signals can be analysed at all.

Physics. Work, flux, centre of mass, and moment of inertia are integrals over regions where material properties change abruptly. Additivity over subintervals is what licenses computing piece by piece and adding.

Finance. Accumulated value under a varying rate is r(t)dt\int r(t)\,dt, and rate schedules are step functions. This is Example 3 with money attached.

Where Riemann runs out. Modern probability, Fourier analysis, and PDE theory all use the Lebesgue integral instead, and the Dirichlet function is the shortest explanation of why. Riemann integration also behaves badly under limits, which is the subject of the next lesson.

What must be assumed about f before lower and upper sums can even be defined?
What happens to the sums when a partition is refined?
The Riemann criterion says f is integrable exactly when:
Which earlier theorem is used to prove that continuous functions are integrable?
For the function equal to 1 on rationals and 0 on irrationals on [0, 1], what are L(f, P) and U(f, P)?
If f is merely integrable and F(x) = ∫ₐˣ f, what can be said about F?
Which theorem is used in the proof that ∫ₐᵇ f = F(b) − F(a)?
Which class of functions is integrable even when it has infinitely many discontinuities?