Chapter 4 · Integration: Riemann to Lebesgue

4.1 The Riemann Integral

Darboux sums squeeze the area from above and below: Riemann's criterion, Riemann sums, the integrability of continuous and monotone functions, Lebesgue's criterion (discontinuities of measure zero) and both halves of the fundamental theorem of calculus.

What is the area under the graph of a function? For a polygon we can count triangles; for a curved region we must approximate, and the integral is whatever the approximations settle down to. Riemann (1854) made this precise with sums $\sum f(\xi_k)\,\Delta x_k$ over finer and finer partitions; Darboux (1875) streamlined it by trapping the area between an upper sum built from suprema and a lower sum built from infima. A function is integrable exactly when the trap can be closed. The surprising part is how much a function can misbehave and still be integrable — Thomae's function, discontinuous at every rational, has integral $0$ — and how little it takes to break integrability — the Dirichlet function, which only distinguishes rationals from irrationals, has no integral at all.

This section builds the Riemann integral from scratch, proves which functions are integrable, and ends with the fundamental theorem of calculus, which links integration to the derivatives of Chapter 3. CSIR NET tests it in three recurring ways: limits of sums that are Riemann sums in disguise (Part B), derivatives of integrals with variable limits (Part B), and "which of these functions are Riemann integrable / which statements about $F(x)=\int_a^x f$ are true" (Part C), where Lebesgue's criterion — bounded, with a set of discontinuities of measure zero — decides almost every option in one line.

Partitions, Darboux Sums and Riemann's Criterion

Throughout, $f:[a,b]\to\mathbb{R}$ is a bounded function, $a\lt b$. Boundedness is part of the definition of the Riemann integral: an unbounded function is never Riemann integrable in the proper sense (its integral, if any, is improper — §4.2).

📘 Definition 4.1 — Partitions, mesh and refinements

A partition of $[a,b]$ is a finite set $P=\{x_0,x_1,\dots,x_n\}$ with $a=x_0\lt x_1\lt\cdots\lt x_n=b$. Its subintervals are $I_k=[x_{k-1},x_k]$, of lengths $\Delta x_k=x_k-x_{k-1}$, and its mesh (norm) is $\|P\|=\max_k\Delta x_k$. A partition $P^*$ is a refinement of $P$ if $P\subseteq P^*$. Any two partitions $P,Q$ have the common refinement $P\cup Q$.

The uniform partition $P_n$ has $x_k=a+k\,\frac{b-a}{n}$, so $\|P_n\|=\frac{b-a}{n}$.

📘 Definition 4.2 — Upper and lower Darboux sums

For a partition $P$ put $M_k=\sup_{I_k}f$ and $m_k=\inf_{I_k}f$ (finite, since $f$ is bounded). The upper and lower Darboux sums are

$$U(f,P)=\sum_{k=1}^{n}M_k\,\Delta x_k,$$ $$L(f,P)=\sum_{k=1}^{n}m_k\,\Delta x_k.$$

If $m\le f\le M$ on $[a,b]$, then $m(b-a)\le L(f,P)\le U(f,P)\le M(b-a)$. Geometrically, $U$ is the area of a staircase lying above the graph and $L$ the area of one lying below it.

📐 Theorem 4.1 — Refinement lemma
(a) If $P^*$ refines $P$, then $L(f,P)\le L(f,P^*)\le U(f,P^*)\le U(f,P)$: refining raises lower sums and lowers upper sums.
(b) For any two partitions $P,Q$ of $[a,b]$: $L(f,P)\le U(f,Q)$. Every lower sum is at most every upper sum.

Proof. (a) By induction it is enough to add one point $y$ to $P$, say $x_{k-1}\lt y\lt x_k$. Only the term of $I_k$ changes: it is replaced by $\big(\sup_{[x_{k-1},y]}f\big)(y-x_{k-1})+\big(\sup_{[y,x_k]}f\big)(x_k-y)$. A supremum over a smaller set is no larger, so each of the two new suprema is $\le M_k$, and the new contribution is $\le M_k(y-x_{k-1})+M_k(x_k-y)=M_k\Delta x_k$. Hence $U(f,P^*)\le U(f,P)$. The lower sums are handled in the same way, with infima over smaller sets being no smaller; and $L(f,P^*)\le U(f,P^*)$ because $m_k\le M_k$ termwise.

(b) Apply (a) to the common refinement $P\cup Q$, which refines both: $$L(f,P)\le L(f,P\cup Q)\le U(f,P\cup Q)\le U(f,Q).$$ ∎

📘 Definition 4.3 — Upper and lower integrals; Riemann integrability

The upper and lower integrals of $f$ over $[a,b]$ are

$$\overline{\int_a^b}f=\inf_P U(f,P),\qquad \underline{\int_a^b}f=\sup_P L(f,P).$$

By Theorem 4.1(b) the set of lower sums lies entirely below the set of upper sums, so both numbers exist (completeness, §1.2) and $\underline{\int}f\le\overline{\int}f$. We say $f$ is Riemann integrable on $[a,b]$, written $f\in\mathcal{R}[a,b]$, if $\underline{\int_a^b}f=\overline{\int_a^b}f$; the common value is $\int_a^b f=\int_a^b f(x)\,dx$. We set $\int_a^a f=0$ and $\int_b^a f=-\int_a^b f$.

📐 Theorem 4.2 — Riemann's criterion
A bounded function $f$ on $[a,b]$ is Riemann integrable if and only if for every $\varepsilon\gt0$ there is a partition $P$ with $$U(f,P)-L(f,P)\lt\varepsilon.$$ In that case $L(f,Q)\le\int_a^b f\le U(f,Q)$ for every partition $Q$, and if $P_j$ is any sequence of partitions with $U(f,P_j)-L(f,P_j)\to0$, then $U(f,P_j)\to\int_a^bf$ and $L(f,P_j)\to\int_a^bf$.

Proof. For every partition $P$, $L(f,P)\le\underline{\int}f\le\overline{\int}f\le U(f,P)$. ($\Leftarrow$) If $U(f,P)-L(f,P)\lt\varepsilon$, then $0\le\overline{\int}f-\underline{\int}f\lt\varepsilon$; as $\varepsilon$ is arbitrary, the two integrals are equal.

($\Rightarrow$) Let $I=\int_a^bf$ and $\varepsilon\gt0$. By the $\varepsilon$-characterisation of $\inf$ and $\sup$ (§1.2) there are partitions $P_1,P_2$ with $U(f,P_1)\lt I+\varepsilon/2$ and $L(f,P_2)\gt I-\varepsilon/2$. For $P=P_1\cup P_2$, Theorem 4.1(a) gives $U(f,P)-L(f,P)\le U(f,P_1)-L(f,P_2)\lt\varepsilon$.

The last statement: $I$ and both sums lie in $[L(f,P_j),U(f,P_j)]$, an interval whose length tends to $0$. ∎

Riemann's criterion is the working tool: to prove integrability you do not need to know the value of the integral — you only need partitions on which the oscillation of $f$, weighted by length, is small.

✏️ Example 1 — Darboux sums for $x^2$
Let $f(x)=x^2$ on $[0,1]$ and $P_n$ the uniform partition. Compute $U(f,P_n)$ and $L(f,P_n)$, prove that $f$ is integrable, and find $\int_0^1x^2\,dx$.
Sup and inf $f$ is increasing on $[0,1]$, so on $I_k=[\tfrac{k-1}n,\tfrac kn]$ we have $M_k=\tfrac{k^2}{n^2}$ and $m_k=\tfrac{(k-1)^2}{n^2}$; each $\Delta x_k=\tfrac1n$.
The sums Using $\sum_{k=1}^nk^2=\tfrac{n(n+1)(2n+1)}6$: $$U(f,P_n)=\frac1{n^3}\sum_{k=1}^nk^2=\frac{(n+1)(2n+1)}{6n^2},$$ $$L(f,P_n)=\frac1{n^3}\sum_{k=0}^{n-1}k^2=\frac{(n-1)(2n-1)}{6n^2}.$$
The gap $U-L=\tfrac1{n^3}\big(\sum_{k=1}^nk^2-\sum_{k=0}^{n-1}k^2\big)=\tfrac{n^2}{n^3}=\tfrac1n\to0$. By Riemann's criterion $f$ is integrable, and both sums tend to $\tfrac{2}{6}$, so $\int_0^1x^2\,dx=\tfrac13$.
Picture The gap $U-L$ is a stack of $n$ thin rectangles of width $\tfrac1n$ whose heights add up to $f(1)-f(0)=1$ — the same telescoping happens for every monotone function (Theorem 4.4).
✏️ Example 2 — Functions that see rationals
(a) Show that the Dirichlet function $D(x)=1$ for $x\in\mathbb{Q}$, $D(x)=0$ for $x\notin\mathbb{Q}$ is not integrable on $[0,1]$. (b) Let $g(x)=x$ for rational $x$ and $g(x)=0$ for irrational $x$. Find the upper and lower integrals of $g$ over $[0,1]$. Where is $g$ continuous?
(a) Every subinterval $I_k$ of positive length contains a rational and an irrational (density, §1.2). So $M_k=1$, $m_k=0$, and $U(D,P)=1$, $L(D,P)=0$ for every partition. Hence $\overline{\int}D=1\ne0=\underline{\int}D$.
(b) Lower Each $I_k$ contains irrationals, where $g=0$, and $g\ge0$; so $m_k=0$ and $\underline{\int_0^1}g=0$.
(b) Upper On $I_k=[x_{k-1},x_k]$, $g\le x_k$, and rationals arbitrarily close to $x_k$ give values close to $x_k$, so $M_k=x_k$. Thus $U(g,P)=\sum x_k\Delta x_k\ge\sum_k\int_{x_{k-1}}^{x_k}x\,dx=\tfrac12$, and for $P_n$, $U(g,P_n)=\tfrac1{n^2}\sum_{k=1}^nk=\tfrac{n+1}{2n}\to\tfrac12$. Therefore $\overline{\int_0^1}g=\tfrac12$, and $g$ is not integrable.
Continuity At $x=0$: $|g(x)|\le|x|\to0$, so $g$ is continuous at $0$. At $c\ne0$, rationals $r_n\to c$ give $g(r_n)\to c$ while irrationals $s_n\to c$ give $0$, so $g$ is discontinuous. A single point of continuity does not help: the discontinuities fill $(0,1]$.

Riemann Sums and Classes of Integrable Functions

Darboux sums need suprema and infima, which are often hard to compute. Riemann's original definition uses the value of $f$ at one chosen point of each subinterval instead.

📘 Definition 4.4 — Tagged partitions and Riemann sums
A tagged partition $(P,\xi)$ is a partition $P$ together with points $\xi_k\in I_k$ (the tags). The Riemann sum is $$S(f,P,\xi)=\sum_{k=1}^nf(\xi_k)\,\Delta x_k.$$ We say $\lim_{\|P\|\to0}S(f,P,\xi)=I$ if for every $\varepsilon\gt0$ there is $\delta\gt0$ such that $|S(f,P,\xi)-I|\lt\varepsilon$ for every tagged partition with $\|P\|\lt\delta$, whatever the tags. Since $m_k\le f(\xi_k)\le M_k$, always $L(f,P)\le S(f,P,\xi)\le U(f,P)$.
📐 Theorem 4.3 — Riemann sums and the Darboux integral agree
Let $f$ be bounded on $[a,b]$. Then $f\in\mathcal{R}[a,b]$ if and only if $\lim_{\|P\|\to0}S(f,P,\xi)$ exists, and then the limit equals $\int_a^bf$. In particular, for $f\in\mathcal{R}[0,1]$, $$\lim_{n\to\infty}\frac1n\sum_{k=1}^nf\!\left(\frac kn\right)=\int_0^1f(x)\,dx,$$ and the same holds with $f(\tfrac{k-1}n)$ or any tags $\xi_k\in[\tfrac{k-1}n,\tfrac kn]$.

Proof. ($\Rightarrow$) Let $|f|\le M$ (with $M\gt0$), $I=\int_a^bf$ and $\varepsilon\gt0$. Choose $P_0$ with $U(f,P_0)-L(f,P_0)\lt\varepsilon/2$, and let $m_0$ be the number of points of $P_0$ inside $(a,b)$. Put $\delta=\varepsilon/(8Mm_0+1)$ and let $P$ be any partition with $\|P\|\lt\delta$. Form $P\cup P_0$ by adding the $m_0$ points of $P_0$ to $P$ one at a time. Each added point splits one subinterval $J$ of length $\le\|P\|$, and, as in the proof of Theorem 4.1, changes the upper sum by at most $(\sup_Jf-\inf_Jf)|J|\le2M\delta$. Hence

$$U(f,P)\le U(f,P\cup P_0)+2Mm_0\delta\le U(f,P_0)+2Mm_0\delta,$$

and similarly $L(f,P)\ge L(f,P_0)-2Mm_0\delta$. Subtracting, $U(f,P)-L(f,P)\lt\varepsilon/2+4Mm_0\delta\lt\varepsilon$. Both $I$ and every Riemann sum $S(f,P,\xi)$ lie in $[L(f,P),U(f,P)]$, so $|S(f,P,\xi)-I|\lt\varepsilon$.

($\Leftarrow$) Suppose $|S(f,P,\xi)-I|\lt\varepsilon$ whenever $\|P\|\lt\delta$. Fix such a $P$. Choosing each tag $\xi_k$ with $f(\xi_k)\gt M_k-\varepsilon/(b-a)$ gives a Riemann sum $\gt U(f,P)-\varepsilon$; so $U(f,P)\lt I+2\varepsilon$. Similarly $L(f,P)\gt I-2\varepsilon$. Thus $U(f,P)-L(f,P)\lt4\varepsilon$; Riemann's criterion gives integrability, and $I$, squeezed between $L$ and $U$ for partitions of arbitrarily small mesh, equals $\int_a^bf$. The final formula is the special case of uniform partitions with right-hand tags. ∎

📐 Theorem 4.4 — Continuous and monotone functions are integrable
(a) Every continuous $f:[a,b]\to\mathbb{R}$ is Riemann integrable. (b) Every monotone $f:[a,b]\to\mathbb{R}$ is Riemann integrable. (c) Every bounded $f$ on $[a,b]$ that is continuous except at finitely many points is Riemann integrable.

Proof. (a) A continuous function on the compact interval $[a,b]$ is bounded and uniformly continuous (§3.1, §3.2). Given $\varepsilon\gt0$, choose $\delta\gt0$ with $|f(x)-f(y)|\lt\varepsilon/(b-a)$ whenever $|x-y|\lt\delta$. If $\|P\|\lt\delta$, then on each $I_k$ the extreme value theorem gives points $u,v\in I_k$ with $M_k=f(u)$, $m_k=f(v)$, so $M_k-m_k\lt\varepsilon/(b-a)$ and $U(f,P)-L(f,P)\lt\sum\frac{\varepsilon}{b-a}\Delta x_k=\varepsilon$.

(b) Say $f$ is increasing (otherwise use $-f$). On the uniform partition $P_n$, $M_k=f(x_k)$ and $m_k=f(x_{k-1})$, so the difference telescopes: $$U(f,P_n)-L(f,P_n)=\frac{b-a}{n}\sum_{k=1}^n\big(f(x_k)-f(x_{k-1})\big)=\frac{(b-a)\big(f(b)-f(a)\big)}{n}\to0.$$ (c) Let $|f|\le M$, let $c_1\lt\dots\lt c_r$ be the discontinuities and $\varepsilon\gt0$. Enclose each $c_i$ in an interval $J_i$ of length $\lt\varepsilon/(4Mr)$, the $J_i$ pairwise disjoint. On each of the finitely many closed intervals that remain, $f$ is continuous, so by (a) we can partition it with upper minus lower sum $\lt\varepsilon/(2(r+1))$. Together with the end points of the $J_i$ this gives a partition $P$ of $[a,b]$ with $U-L\lt r\cdot2M\cdot\frac{\varepsilon}{4Mr}+\frac{\varepsilon}{2}=\varepsilon$. ∎

Part (b) is more remarkable than it looks: a monotone function may have infinitely many jumps — countably many, as §3.2 shows — and is still integrable. Part (c) also says that changing a function at finitely many points changes neither its integrability nor its integral (Exercise I.6). To go further we need a way to measure how "small" the set of discontinuities is.

📘 Definition 4.5 — Sets of measure zero; oscillation

A set $A\subseteq\mathbb{R}$ has (Lebesgue) measure zero (is a null set) if for every $\varepsilon\gt0$ there are countably many open intervals $J_1,J_2,\dots$ with $A\subseteq\bigcup_iJ_i$ and $\sum_i|J_i|\lt\varepsilon$. Every countable set is null (cover the $i$-th point by an interval of length $\varepsilon/2^{i+1}$); a countable union of null sets is null; the Cantor set is an uncountable null set (§4.4). An interval of positive length is not null.

The oscillation of a bounded $f$ at $x$ is $$\omega_f(x)=\lim_{h\to0^+}\Big(\sup_{(x-h,x+h)}f-\inf_{(x-h,x+h)}f\Big)$$ (the intervals intersected with $[a,b]$). $f$ is continuous at $x$ if and only if $\omega_f(x)=0$.

📐 Theorem 4.5 — Lebesgue's criterion for Riemann integrability
A function $f:[a,b]\to\mathbb{R}$ is Riemann integrable if and only if (i) $f$ is bounded and (ii) the set $D_f$ of points of $[a,b]$ at which $f$ is discontinuous has measure zero.

Proof (careful sketch). Write $D_f=\bigcup_{j\ge1}D_j$ with $D_j=\{x:\omega_f(x)\ge1/j\}$. Each $D_j$ is closed (if $\omega_f(x)\lt1/j$, some neighbourhood of $x$ has $\sup-\inf\lt1/j$, and so every point of that neighbourhood has oscillation $\lt1/j$), hence compact.

Integrable $\Rightarrow$ $D_f$ null. It suffices to show each $D_j$ is null, since a countable union of null sets is null. Fix $j$ and $\varepsilon\gt0$, and take $P$ with $U(f,P)-L(f,P)\lt\varepsilon/j$. Let $\mathcal{B}$ be the set of subintervals $I_k$ whose interior meets $D_j$. On such an $I_k$, $M_k-m_k\ge1/j$ (the interior contains a whole neighbourhood of a point of oscillation $\ge1/j$). So $\frac1j\sum_{\mathcal{B}}\Delta x_k\le U-L\lt\varepsilon/j$, i.e. the intervals of $\mathcal{B}$ have total length $\lt\varepsilon$. They cover $D_j$ except possibly the finitely many points of $P$, which we cover by intervals of total length $\lt\varepsilon$. Enlarging slightly to open intervals, $D_j$ is covered by open intervals of total length $\lt3\varepsilon$.

$D_f$ null $\Rightarrow$ integrable. Let $|f|\le M$, $\varepsilon\gt0$ and choose $j$ with $1/j\lt\varepsilon$. The compact set $D_j\subseteq D_f$ is null, so it is covered by countably many open intervals of total length $\lt\varepsilon$, and by compactness (Heine–Borel, §3.1) by finitely many of them, $J_1,\dots,J_r$. On the compact set $K=[a,b]\setminus(J_1\cup\dots\cup J_r)$ every point has $\omega_f\lt1/j$; a compactness argument (cover $K$ by neighbourhoods on which $\sup-\inf\lt1/j$ and take a Lebesgue number) gives a partition of the pieces of $K$ into subintervals on which $M_k-m_k\lt1/j$. Using the end points of the $J_i$ as well, we get a partition $P$ with $$U(f,P)-L(f,P)\le2M\sum_i|J_i|+\frac1j(b-a)\lt\varepsilon\,(2M+b-a).$$ As $\varepsilon$ is arbitrary, Riemann's criterion applies. ∎

✏️ Example 3 — Thomae's function is integrable
Thomae's function on $[0,1]$ is $T(x)=\tfrac1q$ if $x=\tfrac pq$ in lowest terms ($q\ge1$; so $T(0)=T(1)=1$) and $T(x)=0$ for irrational $x$. Prove directly from Riemann's criterion that $T\in\mathcal{R}[0,1]$ and $\int_0^1T=0$. Then check the result against Lebesgue's criterion.
Lower sums Every subinterval contains irrationals, so $m_k=0$ and $L(T,P)=0$ for every $P$.
Few large values Fix $\varepsilon\in(0,1)$. The points where $T(x)\ge\varepsilon/2$ are the rationals $p/q\in[0,1]$ with $q\le2/\varepsilon$ — a finite set, say $N$ points.
A good partition Choose a partition $P$ in which these $N$ points lie in subintervals of total length $\lt\varepsilon/2$ (each point lies in at most two subintervals; make those of length $\lt\varepsilon/(4N)$). On those subintervals $M_k\le1$; on all others $M_k\lt\varepsilon/2$. Hence $$U(T,P)\lt1\cdot\frac\varepsilon2+\frac\varepsilon2\cdot1=\varepsilon.$$
Conclusion $U(T,P)-L(T,P)\lt\varepsilon$, so $T$ is integrable, and $0\le\int_0^1T\le U(T,P)\lt\varepsilon$ for every $\varepsilon$: $\int_0^1T=0$.
Lebesgue check $T$ is continuous at every irrational $c$ (near $c$ only rationals with large denominators occur, as in the second step) and discontinuous at every rational (irrationals nearby give $0\ne T(p/q)$). So $D_T=\mathbb{Q}\cap[0,1]$, countable, hence null — integrable, as found. Interactive 1 lets you watch $U(T,P_n)$ creep down to $0$.
Interactive 1 — Closing the Darboux Gap

On each subinterval the blue bar has height $m_k=\inf f$ and the bar continued in amber reaches $M_k=\sup f$. The blue area is $L(f,P)$, blue plus amber is $U(f,P)$, so the amber area alone is the gap $U-L$. The red dots are the tags of a Riemann sum. Press Play to refine the partition: for an integrable function the amber vanishes; for the Dirichlet function it never shrinks.

n · mesh ‖P‖—
Riemann sum S—
L(f, P)—
U(f, P)—
gap U − L—
∫₀¹ f—
✏️ Example 4 — Limits of sums as integrals
Evaluate (a) $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac{n}{n^2+k^2}$; (b) $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac1{n+k}$; (c) $\displaystyle\lim_{n\to\infty}\frac1n\Big[(n+1)(n+2)\cdots(2n)\Big]^{1/n}$; (d) $\displaystyle\lim_{n\to\infty}\frac1n\sum_{k=1}^n\sin\frac{k\pi}{n}$.
Method Pull out $\tfrac1n$ and write the summand as $f(k/n)$ for a function $f$ continuous on $[0,1]$; Theorem 4.3 then turns the limit into $\int_0^1f$.
(a) $\pi/4$ $\dfrac{n}{n^2+k^2}=\dfrac1n\cdot\dfrac1{1+(k/n)^2}$, so the limit is $\displaystyle\int_0^1\frac{dx}{1+x^2}=\tan^{-1}1=\frac\pi4$.
(b) $\log2$ $\dfrac1{n+k}=\dfrac1n\cdot\dfrac1{1+k/n}$, limit $\displaystyle\int_0^1\frac{dx}{1+x}=\log2$.
(c) $4/e$ Take logarithms: $$\log\Big(\tfrac1n\big[(n+1)\cdots(2n)\big]^{1/n}\Big)=\frac1n\sum_{k=1}^n\log\frac{n+k}{n}=\frac1n\sum_{k=1}^n\log\!\Big(1+\frac kn\Big),$$ which tends to $\int_0^1\log(1+x)\,dx=\big[(1+x)\log(1+x)-x\big]_0^1=2\log2-1$. Since $\exp$ is continuous, the limit is $e^{2\log2-1}=4/e\approx1.4715$.
(d) $2/\pi$ $\displaystyle\int_0^1\sin(\pi x)\,dx=\Big[-\tfrac1\pi\cos\pi x\Big]_0^1=\frac2\pi$.
Check With $n=20000$ the four sums are $0.785386$, $0.693135$, $1.471543$, $0.636620$, against $\pi/4=0.785398$, $\log2=0.693147$, $4/e=1.471518$, $2/\pi=0.636620$. The error of a one-sided sum is of order $1/n$ (Exercise IV.6 and the Research–Teaching Nexus).
✏️ Example 5 — Integrable or not? (Lebesgue's criterion)
Decide which of the following are Riemann integrable on $[0,1]$: (a) $f(x)=\sin(1/x)$ for $x\ne0$, $f(0)=0$; (b) $\mathbf 1_C$, the indicator of the Cantor set $C$; (c) $\mathbf 1_K$, the indicator of a "fat" Cantor set $K$ of measure $\tfrac12$ (constructed like $C$, but removing middle intervals of lengths $\tfrac14,\tfrac1{16},\tfrac1{64},\dots$ so that the removed total is $\tfrac12$); (d) $h(x)=1/x$ for $x\gt0$, $h(0)=0$.
(a) Yes $|f|\le1$, and $f$ is continuous on $(0,1]$; its only discontinuity is $0$ ($\sin(1/x)$ takes all values in $[-1,1]$ near $0$). $D_f=\{0\}$ is null — or use Theorem 4.4(c).
(b) Yes, $\int=0$ $C$ is closed, so $\mathbf 1_C$ is continuous on the open set $[0,1]\setminus C$ (locally $0$). At $x\in C$ it is discontinuous, because $C$ contains no interval and points of the complement come arbitrarily close. So $D=C$, which is null (§4.4): integrable. Its lower sums are $0$ (every interval meets the complement), hence $\int_0^1\mathbf 1_C=0$.
(c) No The same reasoning gives $D=K$, but now $K$ has measure $\tfrac12\gt0$, so it is not null. Directly: every subinterval meeting $K$ has $M_k-m_k=1$, and these subintervals have total length at least $\tfrac12$, so $U-L\ge\tfrac12$ for every partition.
(d) No $h$ is unbounded, so condition (i) fails: no upper sum is even finite, because the sup over $[0,x_1]$ is $+\infty$. (The improper integral $\int_0^1dx/x$ diverges too — §4.2.)
Lesson (b) and (c) look identical — both indicators of closed, nowhere dense, uncountable sets — and differ only in the measure of the discontinuity set. "Countably many discontinuities" is sufficient (with boundedness) but not necessary.

Properties of the Integral and the Mean Value Theorems

📐 Theorem 4.6 — Algebraic and order properties

Let $f,g\in\mathcal{R}[a,b]$ and $\alpha,\beta\in\mathbb{R}$.

  1. Linearity: $\alpha f+\beta g\in\mathcal{R}[a,b]$ and $\int(\alpha f+\beta g)=\alpha\int f+\beta\int g$.
  2. Monotonicity: if $f\le g$ then $\int_a^bf\le\int_a^bg$; and $\left|\int_a^bf\right|\le\int_a^b|f|\le M(b-a)$ where $|f|\le M$.
  3. Additivity: for $a\lt c\lt b$, $f\in\mathcal{R}[a,b]$ iff $f\in\mathcal{R}[a,c]$ and $f\in\mathcal{R}[c,b]$, and $\int_a^bf=\int_a^cf+\int_c^bf$.
  4. Products and moduli: $fg$, $|f|$, $\max(f,g)$, $\min(f,g)$ are integrable; so is $1/f$ if $|f|\ge c\gt0$.
  5. Composition: if $m\le f\le M$ and $\varphi:[m,M]\to\mathbb{R}$ is continuous, then $\varphi\circ f\in\mathcal{R}[a,b]$ (e.g. $f^2$, $f^3$, $e^f$, $\sqrt{|f|}$).
  6. Positivity: if $f$ is continuous, $f\ge0$ and $\int_a^bf=0$, then $f\equiv0$ on $[a,b]$.

Proof. (1) For any $P$, $\sup_{I}(f+g)\le\sup_If+\sup_Ig$ and $\inf_I(f+g)\ge\inf_If+\inf_Ig$, so $$L(f,P)+L(g,P)\le L(f+g,P),$$ $$U(f+g,P)\le U(f,P)+U(g,P).$$ Choosing $P$ (a common refinement) with $U-L\lt\varepsilon/2$ for both $f$ and $g$ gives $U(f+g,P)-L(f+g,P)\lt\varepsilon$ and squeezes $\int(f+g)$ between quantities within $\varepsilon$ of $\int f+\int g$. For $\alpha\ge0$, $U(\alpha f,P)=\alpha U(f,P)$; for $\alpha\lt0$, $U(\alpha f,P)=\alpha L(f,P)$, and the rest follows.

(2) If $f\le g$, every Riemann sum of $f$ is $\le$ the corresponding sum of $g$; pass to the limit (Theorem 4.3). Then $-|f|\le f\le|f|$ gives the modulus inequality once we know $|f|$ is integrable, which is part (4).

(3) Adding the point $c$ to a partition does not increase $U-L$, and a partition of $[a,b]$ containing $c$ is a partition of $[a,c]$ together with one of $[c,b]$; the upper and lower sums split accordingly.

(4), (5) The quickest proof uses Theorem 4.5. A bounded $f$ is integrable iff $D_f$ is null; and $D_{fg}\subseteq D_f\cup D_g$, $D_{|f|}\subseteq D_f$, $D_{\varphi\circ f}\subseteq D_f$ (where $f$ is continuous, so is $\varphi\circ f$), $D_{1/f}=D_f$, while all these functions are bounded. A union of two null sets is null. (A direct proof of (5) with Darboux sums uses the uniform continuity of $\varphi$; for $|f|$ it is just $\big||f(x)|-|f(y)|\big|\le|f(x)-f(y)|$, so $\sup_I|f|-\inf_I|f|\le M_k-m_k$.)

(6) If $f(c)\gt0$ for some $c$, continuity gives an interval $J\ni c$ of length $\ell\gt0$ in $[a,b]$ on which $f\gt f(c)/2$. Then $\int_a^bf\ge\int_Jf\ge\ell f(c)/2\gt0$. ∎

📐 Theorem 4.7 — First mean value theorem for integrals
(a) If $f$ is continuous on $[a,b]$, there is $c\in[a,b]$ with $\displaystyle\int_a^bf=f(c)(b-a)$.
(b) (Weighted form.) If $f$ is continuous on $[a,b]$ and $g\in\mathcal{R}[a,b]$ with $g\ge0$, there is $c\in[a,b]$ with $$\int_a^bf(x)g(x)\,dx=f(c)\int_a^bg(x)\,dx.$$

Proof. (b) Let $m=\min f$ and $M=\max f$ (extreme value theorem). Since $g\ge0$, $mg\le fg\le Mg$, and integrating (Theorem 4.6(2), with $fg$ integrable by 4.6(4)) gives $m\int g\le\int fg\le M\int g$. If $\int g=0$ then $\int fg=0$ and any $c$ works. Otherwise $\int fg/\int g\in[m,M]$, and the intermediate value theorem (§3.1) produces $c$ with $f(c)$ equal to this quotient. (a) is (b) with $g\equiv1$. ∎

The hypothesis $g\ge0$ cannot be dropped: on $[-1,1]$ with $f(x)=g(x)=x$, $\int fg=\tfrac23$ but $\int g=0$. Neither can continuity of $f$: a step function need not take its average value.

✏️ Example 6 — Concentrating mass at an end point
Let $f$ be continuous on $[0,1]$. Prove that $\displaystyle\lim_{n\to\infty}\int_0^1x^nf(x)\,dx=0$ and $\displaystyle\lim_{n\to\infty}n\int_0^1x^nf(x)\,dx=f(1)$.
First limit With $|f|\le M$: $\left|\int_0^1x^nf\right|\le M\int_0^1x^n\,dx=\dfrac{M}{n+1}\to0$.
Subtract the target Since $n\int_0^1x^n\,dx=\tfrac n{n+1}$, $$n\int_0^1x^nf(x)\,dx-\frac{n}{n+1}f(1)=n\int_0^1x^n\big(f(x)-f(1)\big)\,dx.$$
Split at $1-\delta$ Given $\varepsilon\gt0$, continuity at $1$ gives $\delta\in(0,1)$ with $|f(x)-f(1)|\lt\varepsilon$ on $[1-\delta,1]$. Then $$\Big|n\int_{1-\delta}^1x^n(f-f(1))\Big|\le\varepsilon\,n\int_0^1x^n\lt\varepsilon,\qquad\Big|n\int_0^{1-\delta}x^n(f-f(1))\Big|\le2M\,n(1-\delta)^{n}.$$ The last bound tends to $0$ (since $n r^n\to0$ for $0\le r\lt1$, §2.1).
Conclusion So $\limsup\big|n\int x^nf-\tfrac n{n+1}f(1)\big|\le\varepsilon$ for every $\varepsilon$, and $\tfrac n{n+1}f(1)\to f(1)$. Check with $f=e^x$: $n=1000$ gives $2.71286$, against $e=2.71828$.
Idea The weights $nx^n$ have total mass $\to1$ and pile up near $x=1$ — an "approximate identity". The same mechanism appears in Fejér kernels, Bernstein polynomials (§5.2) and Exam-corner E6.

The Fundamental Theorem of Calculus

For $f\in\mathcal{R}[a,b]$ the indefinite integral $F(x)=\int_a^xf(t)\,dt$ ($a\le x\le b$) is defined by Theorem 4.6(3). The two halves of the fundamental theorem say that integrating and differentiating undo each other — under hypotheses that matter.

📐 Theorem 4.8 — Fundamental theorem of calculus, part I
Let $f\in\mathcal{R}[a,b]$ with $|f|\le M$, and $F(x)=\int_a^xf(t)\,dt$. Then:
  1. $|F(x)-F(y)|\le M|x-y|$ for all $x,y\in[a,b]$: $F$ is Lipschitz, hence uniformly continuous;
  2. if $f$ is continuous at $c\in[a,b]$, then $F$ is differentiable at $c$ and $F'(c)=f(c)$ (one-sided at $c=a,b$);
  3. more generally, if $f(c^+)=\lim_{t\to c^+}f(t)$ exists, the right derivative of $F$ at $c$ equals $f(c^+)$; similarly on the left.

Proof. (1) For $x\lt y$, $F(y)-F(x)=\int_x^yf$ by additivity, and $\left|\int_x^yf\right|\le M(y-x)$.

(2) and (3) For $h\gt0$ small, $$\frac{F(c+h)-F(c)}{h}-f(c^+)=\frac1h\int_c^{c+h}\big(f(t)-f(c^+)\big)\,dt.$$ Given $\varepsilon\gt0$ choose $\delta$ with $|f(t)-f(c^+)|\lt\varepsilon$ for $c\lt t\lt c+\delta$. For $0\lt h\lt\delta$ the right side has modulus $\le\frac1h\cdot\varepsilon h=\varepsilon$ (the value of the integrand at the single point $t=c$ does not matter, Theorem 4.4(c)). So the right derivative is $f(c^+)$; the left derivative is $f(c^-)$ in the same way. If $f$ is continuous at $c$, both equal $f(c)$. ∎

📐 Theorem 4.9 — Fundamental theorem of calculus, part II
Let $F:[a,b]\to\mathbb{R}$ be differentiable at every point of $[a,b]$ (one-sided at the end points), and suppose $f=F'$ is Riemann integrable on $[a,b]$. Then $$\int_a^bF'(x)\,dx=F(b)-F(a).$$ The same holds if $F$ is continuous on $[a,b]$ and differentiable with $F'=f$ except at finitely many points.

Proof. Let $P$ be any partition. By the mean value theorem (§3.3) on each $I_k$ there is $c_k\in(x_{k-1},x_k)$ with $F(x_k)-F(x_{k-1})=F'(c_k)\Delta x_k$. Summing, the left side telescopes: $$F(b)-F(a)=\sum_{k=1}^nf(c_k)\,\Delta x_k,$$ a Riemann sum, which lies between $L(f,P)$ and $U(f,P)$. As this holds for every $P$, $\underline{\int}f\le F(b)-F(a)\le\overline{\int}f$, and the two outer quantities are both $\int_a^bf$. For the extension, apply the result on each closed piece between exceptional points (the mean value theorem needs only continuity on $[x_{k-1},x_k]$ and differentiability inside). ∎

Leibniz's rule. If $f$ is continuous on an interval $J$ and $u,v$ are differentiable functions with values in $J$, then by Theorem 4.8 and the chain rule, $$\frac{d}{dx}\int_{u(x)}^{v(x)}f(t)\,dt=f\big(v(x)\big)v'(x)-f\big(u(x)\big)u'(x).$$ (Write the integral as $G(v(x))-G(u(x))$ with $G(y)=\int_{y_0}^yf$, $y_0\in J$.)

📐 Theorem 4.10 — Integration by parts and substitution
(a) If $u,v$ are differentiable on $[a,b]$ and $u',v'\in\mathcal{R}[a,b]$, then $\displaystyle\int_a^bu\,v'=\big[uv\big]_a^b-\int_a^bu'v$.
(b) If $\varphi:[\alpha,\beta]\to\mathbb{R}$ has a continuous derivative and $f$ is continuous on an interval containing $\varphi([\alpha,\beta])$, then $$\int_\alpha^\beta f\big(\varphi(t)\big)\varphi'(t)\,dt=\int_{\varphi(\alpha)}^{\varphi(\beta)}f(x)\,dx.$$

Proof. (a) $u,v$ are continuous, hence integrable, so $(uv)'=u'v+uv'$ is integrable (Theorem 4.6). Theorem 4.9 applied to $uv$ gives $\int(u'v+uv')=[uv]_a^b$. (b) Let $G(y)=\int_{\varphi(\alpha)}^yf$; by Theorem 4.8, $G'=f$, so $(G\circ\varphi)'(t)=f(\varphi(t))\varphi'(t)$, a continuous function. Theorem 4.9 gives $\int_\alpha^\beta f(\varphi(t))\varphi'(t)\,dt=G(\varphi(\beta))-G(\varphi(\alpha))$, which is $\int_{\varphi(\alpha)}^{\varphi(\beta)}f$. Note that $\varphi$ need not be monotone or injective. ∎

✏️ Example 7 — Variable limits, jumps and corners
(a) Find $F'(x)$ for $F(x)=\displaystyle\int_x^{x^2}e^{-t^2}\,dt$. (b) Evaluate $\displaystyle\lim_{x\to0}\frac1{x^3}\int_0^x\sin(t^2)\,dt$. (c) Let $f(t)=-1$ for $t\lt0$ and $f(t)=1$ for $t\ge0$, on $[-1,1]$. Find $F(x)=\int_0^xf$ and decide where $F'=f$. (d) Let $g(t)=1$ for $t=0$ and $g(t)=0$ otherwise. Show $G(x)=\int_0^xg$ is differentiable at $0$ but $G'(0)\ne g(0)$.
(a) Leibniz's rule with the continuous integrand $e^{-t^2}$, $v(x)=x^2$, $u(x)=x$: $$F'(x)=2x\,e^{-x^4}-e^{-x^2}.$$
(b) $\tfrac13$ The numerator $\int_0^x\sin(t^2)\,dt$ and $x^3$ both tend to $0$ and are differentiable, so L'Hôpital's rule (§3.3) and Theorem 4.8 give $\lim\dfrac{\sin(x^2)}{3x^2}=\dfrac13$. (Alternatively $\sin(t^2)=t^2+O(t^6)$, so the integral is $\tfrac{x^3}3+O(x^7)$.)
(c) $F(x)=\int_0^x(-1)\,dt=-x$ for $x\lt0$ and $\int_0^x1\,dt=x$ for $x\ge0$: $F(x)=|x|$. It is continuous (Lipschitz with constant $1$, Theorem 4.8(1)), $F'(x)=f(x)$ for $x\ne0$, and at $0$ the one-sided derivatives are $f(0^-)=-1$ and $f(0^+)=1$ (Theorem 4.8(3)): a corner. Integrating a jump produces a corner.
(d) $g$ differs from $0$ at one point, so $G\equiv0$ and $G'(0)=0\ne1=g(0)$. The function $g$ is discontinuous at $0$, so Theorem 4.8(2) does not apply — differentiability of $F$ at $c$ does not force continuity of $f$ at $c$, nor $F'(c)=f(c)$.
Moral $F'=f$ is guaranteed at points of continuity of $f$, and only there. By Lebesgue's criterion these points are "almost all" points of $[a,b]$.
Interactive 2 — The Accumulation Function $F(x)=\int_0^xf$

Top: the integrand $f$ with the signed area from $0$ to $x$ shaded (blue above the axis, red below). Bottom: $F(x)$ is that area, plotted as $x$ moves, with the left and right difference quotients of $F$ drawn as short green segments. Where $f$ is continuous they agree with $f(x)$; at a jump of $f$ the graph of $F$ has a corner; changing $f$ at one point changes nothing at all.

x—
f(x)—
F(x)—
left quotient (h = 0.01)—
right quotient (h = 0.01)—
🧭 Problem-solving strategy — integrability and integrals in CSIR questions
  1. Is it bounded? If not, it is not Riemann integrable (proper sense) — stop, or treat it as an improper integral (§4.2).
  2. Where is it discontinuous? Find $D_f$. Finite or countable (jumps of a monotone function, the rationals, $\{1/n\}\cup\{0\}$) $\Rightarrow$ integrable. A Cantor-type closed set: decide whether its measure is $0$. An interval, or "every irrational", or a set of positive measure $\Rightarrow$ not integrable.
  3. Value of the integral. If $f=g$ except on a finite set, $\int f=\int g$. If $f\ge0$ vanishes on a dense set (e.g. at all irrationals) and is integrable, every lower sum is $0$, so $\int f=0$.
  4. Limits of sums. Look for $\tfrac1n\sum f(k/n)$ — after taking logarithms for products, and after a change of index for ranges like $k=n+1,\dots,2n$ (giving $\int_1^2$).
  5. $F(x)=\int_a^xf$. Always Lipschitz; $F'(c)=f(c)$ at continuity points; one-sided derivatives $f(c^\pm)$ at jumps; nothing can be concluded about $f$ from the differentiability of $F$ at a single point.
⚠️ Counterexamples and pitfalls
  1. Bounded but not integrable. The Dirichlet function $\mathbf 1_{\mathbb{Q}}$: $U=1$, $L=0$ for every partition.
  2. $|f|$ or $f^2$ integrable does not make $f$ integrable. $f=1$ on $\mathbb{Q}$, $-1$ off $\mathbb{Q}$: $|f|=f^2\equiv1$, but $D_f=[a,b]$. (The converse is true: $f$ integrable $\Rightarrow|f|,f^2$ integrable.)
  3. Composition of two integrable functions. With Thomae's $T$ and $\varphi(y)=0$ for $y=0$, $\varphi(y)=1$ otherwise (integrable, one discontinuity), $\varphi\circ T=\mathbf 1_{\mathbb{Q}}$ on $[0,1]$. Theorem 4.6(5) needs the outer function continuous. Even "integrable $\circ$ continuous" can fail: a homeomorphism $g$ of $[0,1]$ carrying a fat Cantor set $K$ onto the Cantor set $C$ gives $\mathbf 1_C\circ g=\mathbf 1_K$.
  4. Countable is sufficient, not necessary. $\mathbf 1_C$ ($C$ the Cantor set) is integrable with uncountably many discontinuities; $\mathbf 1_K$ for a fat Cantor set is not. Measure, not cardinality, decides.
  5. Changing values. Changing $f$ at finitely many points changes nothing; changing it at countably many points can destroy integrability ($0\mapsto\mathbf 1_{\mathbb{Q}}$).
  6. Limits of integrable functions. $f_n=\mathbf 1_{\{r_1,\dots,r_n\}}$ (an enumeration of $\mathbb{Q}\cap[0,1]$) are integrable with $\int f_n=0$, and $f_n\to\mathbf 1_{\mathbb{Q}}$ pointwise — not integrable. Uniform limits behave well (Exercise IV.4, Chapter 5).
  7. One sequence of Riemann sums is not enough. $\frac1n\sum_{k=1}^n\mathbf 1_{\mathbb{Q}}(k/n)=1$ for all $n$, yet $\mathbf 1_{\mathbb{Q}}$ is not integrable. Theorem 4.3 requires convergence for all tags; but once integrability is known, any sequence of tagged partitions with mesh $\to0$ works.
  8. An integrable function need not have an antiderivative. $\operatorname{sign}x$ on $[-1,1]$ is integrable, but no $F$ has $F'=\operatorname{sign}$ everywhere: derivatives have the intermediate value property (Darboux, §3.3).
  9. A derivative need not be integrable. $F(x)=x^2\sin(1/x^2)$, $F(0)=0$, is differentiable on $[0,1]$ but $F'$ is unbounded near $0$. (Volterra even built an $F$ with $F'$ bounded but not Riemann integrable.) Theorem 4.9 must assume $F'\in\mathcal{R}$.
  10. $F$ differentiable at $c$ says nothing about $f$ at $c$. $f=\mathbf 1_{\{0\}}$: $F\equiv0$, $F'(0)=0\ne f(0)$.
  11. Positivity needs continuity. $f\ge0$, $\int f=0$ forces $f\equiv0$ only for continuous $f$: Thomae's function is positive at every rational and has integral $0$.
  12. Mean value theorem needs $g\ge0$. $\int_{-1}^1x\cdot x\,dx=\tfrac23$ while $\int_{-1}^1x\,dx=0$, so no $c$ satisfies $\int fg=f(c)\int g$.

Exercises

I
Darboux sums and Riemann's criterion.
  • 1 For $f(x)=x^3$ on $[0,2]$ and the uniform partition $P_n$, compute $U(f,P_n)$, $L(f,P_n)$ and $U-L$, and find $\int_0^2x^3\,dx$.
  • 2 For $f(x)=1/x$ on $[1,2]$ use the geometric partition $x_k=2^{k/n}$ ($0\le k\le n$). Show $U(f,P)=n(2^{1/n}-1)$ and $L(f,P)=n(1-2^{-1/n})$, and deduce $\int_1^2dx/x=\log2$.
  • 3 Let $f(x)=0$ for $x\ne\tfrac12$ and $f(\tfrac12)=5$, on $[0,1]$. Prove from Riemann's criterion that $f$ is integrable with $\int_0^1f=0$.
  • 4 Let $f(x)=1$ for rational $x$ and $f(x)=x$ for irrational $x$, on $[0,1]$. Find $\overline{\int_0^1}f$ and $\underline{\int_0^1}f$.
  • 5 Prove: if $f\in\mathcal{R}[a,b]$ then $f\in\mathcal{R}[c,d]$ for every $[c,d]\subseteq[a,b]$.
  • 6 Prove that if $f\in\mathcal{R}[a,b]$ and $g=f$ except at one point, then $g\in\mathcal{R}[a,b]$ and $\int g=\int f$. Extend to finitely many points.
  • 7 Without Lebesgue's criterion, prove that $f(x)=\sin(1/x)$ ($x\ne0$), $f(0)=0$, is integrable on $[0,1]$.
  • 8 Prove that a bounded $f$ is integrable on $[a,b]$ iff for every $\varepsilon\gt0$ there are step functions $s\le f\le t$ with $\int_a^b(t-s)\lt\varepsilon$.
1 $\Delta x=\tfrac2n$, $f$ increasing: $U=\tfrac2n\sum_{k=1}^n\tfrac{8k^3}{n^3}=\tfrac{16}{n^4}\cdot\tfrac{n^2(n+1)^2}4=\tfrac{4(n+1)^2}{n^2}$, $L=\tfrac{4(n-1)^2}{n^2}$, $U-L=\tfrac{16}n\to0$. Both tend to $4$: $\int_0^2x^3dx=4$.
2 Let $r=2^{1/n}$, so $x_k=r^k$ and $\Delta x_k=r^{k-1}(r-1)$. Since $1/x$ decreases, $M_k=r^{-(k-1)}$, $m_k=r^{-k}$. So $U=\sum_{k=1}^n(r-1)=n(r-1)$ and $L=\sum_{k=1}^n(1-r^{-1})=n(1-2^{-1/n})$. With $t=1/n$, $\tfrac{2^t-1}{t}\to\log2$ and $\tfrac{1-2^{-t}}{t}\to\log2$ (derivatives of $2^t$ and $-2^{-t}$ at $0$). So $\int_1^2dx/x=\log2$.
3 $L(f,P)=0$ for all $P$ ($f\ge0$ and every subinterval has points other than $\tfrac12$). Take $P$ with $\tfrac12$ inside a subinterval of length $\delta$ (or shared by two of total length $\delta$): $U(f,P)\le5\delta$. With $\delta\lt\varepsilon/5$, $U-L\lt\varepsilon$, and $0\le\int f\le5\delta$ gives $\int f=0$.
4 On $[x_{k-1},x_k]$: $\sup f=1$ (rationals), $\inf f=x_{k-1}$ (irrationals close to $x_{k-1}$, and $f\ge x\ge x_{k-1}$). So $U=1$ always, $L=\sum x_{k-1}\Delta x_k\le\tfrac12$, with $L(f,P_n)=\tfrac{n-1}{2n}\to\tfrac12$. Upper integral $1$, lower integral $\tfrac12$: not integrable.
5 Given $\varepsilon$, take $P$ with $U-L\lt\varepsilon$ on $[a,b]$; add $c,d$ (this does not increase $U-L$). The terms of $P\cap[c,d]$ form part of the nonnegative sum $\sum(M_k-m_k)\Delta x_k$, so their contribution is $\lt\varepsilon$ too.
6 $h=g-f$ is zero except at one point $p$, where $h(p)=\lambda$. As in part 3, $h\in\mathcal{R}$ with $\int h=0$ (use $|\lambda|$ in place of $5$ and $\pm$ signs). By linearity $g=f+h$ is integrable and $\int g=\int f$. Induct for finitely many points.
7 Let $0\lt\varepsilon\lt1$. On $[\varepsilon/4,1]$, $f$ is continuous, hence integrable: choose a partition $Q$ of it with $U-L\lt\varepsilon/2$. Let $P=\{0\}\cup Q$. The first subinterval $[0,\varepsilon/4]$ contributes $(M_1-m_1)\tfrac\varepsilon4\le2\cdot\tfrac\varepsilon4$. Total $U(f,P)-L(f,P)\lt\varepsilon$.
8 ($\Rightarrow$) For $P$ with $U-L\lt\varepsilon$ let $t=M_k$, $s=m_k$ on the interior of $I_k$ (and $t=s=f$ at the partition points): then $\int(t-s)=U-L$. ($\Leftarrow$) Given $s\le f\le t$, refine to a partition $P$ on whose open subintervals both are constant; then $L(f,P)\ge\int s$ and $U(f,P)\le\int t$ (values at partition points do not affect $\int s,\int t$, and $\sup_{I_k}f\le\sup_{I_k}t$), so $U-L\le\int(t-s)\lt\varepsilon$.
II
Integrability, properties and the mean value theorem.
  • 1 Which are Riemann integrable on $[0,1]$? (a) $f(x)=x\lfloor1/x\rfloor$, $f(0)=0$; (b) $f(x)=\operatorname{sign}\big(\sin(1/x)\big)$, $f(0)=0$; (c) $f(x)=x(1-x)\mathbf 1_{\mathbb{Q}}(x)$; (d) $f(x)=\lfloor1/x\rfloor$, $f(0)=0$.
  • 2 Compute $\displaystyle\int_0^2\lfloor x^2\rfloor\,dx$.
  • 3 For Thomae's function $T$ and the uniform partition of $[0,1]$ into $4$ subintervals, compute $U(T,P_4)$.
  • 4 Prove directly (with Darboux sums) that if $f\in\mathcal{R}[a,b]$ and $f\ge c\gt0$, then $1/f\in\mathcal{R}[a,b]$.
  • 5 Prove the Cauchy–Schwarz inequality $\left(\int_a^bfg\right)^2\le\int_a^bf^2\int_a^bg^2$ for $f,g\in\mathcal{R}[a,b]$.
  • 6 Let $f$ be continuous on $[a,b]$ with $\int_a^bf(x)g(x)\,dx=0$ for every continuous $g$. Prove $f\equiv0$.
  • 7 Prove that if $f\in\mathcal{R}[a,b]$, the points of continuity of $f$ are dense in $[a,b]$.
  • 8 Find a point $c$ given by the weighted mean value theorem for $\int_0^1x^2\cdot e^x\,dx$ with $f(x)=x^2$, $g(x)=e^x$ (give $c$ to three decimals).
1 (a) Yes: for $x\gt0$, $\tfrac1x-1\lt\lfloor\tfrac1x\rfloor\le\tfrac1x$ gives $1-x\lt f(x)\le1$ — bounded — and $f$ is discontinuous only at the points $1/n$ (and possibly $0$): countable. (b) Yes: $|f|\le1$, discontinuities at $1/(n\pi)$ and $0$: countable. (c) No: it is discontinuous at every $x\in(0,1)$ (rationals give $x(1-x)\ne0$, irrationals give $0$) — continuous only at $0,1$. (d) No: unbounded.
2 $\lfloor x^2\rfloor=0,1,2,3$ on $[0,1),[1,\sqrt2),[\sqrt2,\sqrt3),[\sqrt3,2)$. The integral is $(\sqrt2-1)+2(\sqrt3-\sqrt2)+3(2-\sqrt3)=5-\sqrt2-\sqrt3\approx1.8537$.
3 $\sup T$ on an interval is $1/q$ for the least $q$ such that the interval contains some $p/q$. $[0,\tfrac14]\ni0=\tfrac01$: $1$. $[\tfrac14,\tfrac12]\ni\tfrac12$: $\tfrac12$. $[\tfrac12,\tfrac34]$: $\tfrac12$. $[\tfrac34,1]\ni1$: $1$. $U=\tfrac14(1+\tfrac12+\tfrac12+1)=\tfrac34$.
4 For $x,y\in I_k$: $\left|\tfrac1{f(x)}-\tfrac1{f(y)}\right|=\tfrac{|f(y)-f(x)|}{f(x)f(y)}\le\tfrac{M_k-m_k}{c^2}$. Hence $\sup_{I_k}\tfrac1f-\inf_{I_k}\tfrac1f\le\tfrac{M_k-m_k}{c^2}$ and $U(\tfrac1f,P)-L(\tfrac1f,P)\le\tfrac1{c^2}\big(U(f,P)-L(f,P)\big)$. Also $0\lt1/f\le1/c$ is bounded.
5 For every real $t$, $0\le\int(tf+g)^2=t^2\int f^2+2t\int fg+\int g^2$ (all integrable by Theorem 4.6). A quadratic in $t$ that is never negative has discriminant $\le0$: $4(\int fg)^2-4\int f^2\int g^2\le0$. (If $\int f^2=0$ the expression is linear in $t$ and bounded below, so $\int fg=0$.)
6 Take $g=f$: $\int f^2=0$ with $f^2$ continuous and $\ge0$, so $f^2\equiv0$ by Theorem 4.6(6).
7 By Lebesgue's criterion $D_f$ is null; an interval of positive length is not null, so $D_f$ contains no interval. Hence every subinterval of $[a,b]$ contains a point of continuity.
8 $\int_0^1x^2e^x\,dx=\big[(x^2-2x+2)e^x\big]_0^1=e-2$ and $\int_0^1e^x=e-1$. So $c^2=\tfrac{e-2}{e-1}\approx0.41802$, $c\approx0.647$.
III
Riemann sums, the fundamental theorem and Leibniz's rule.
  • 1 Evaluate $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac1{\sqrt{n^2+kn}}$.
  • 2 Evaluate $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac{k^2}{n^3+k^3}$.
  • 3 Evaluate $\displaystyle\lim_{n\to\infty}\frac1{n^2}\sum_{k=1}^nk\sin\frac{k\pi}n$.
  • 4 Evaluate $\displaystyle\lim_{n\to\infty}\frac1n\sum_{k=1}^ne^{k/n}$, and compare the sum for $n=10$ with the limit.
  • 5 Find $F'(x)$ for $F(x)=\displaystyle\int_0^{x^2}\sqrt{1+t^3}\,dt$.
  • 6 Find $G'(x)$ for $G(x)=\displaystyle\int_{\sin x}^{\cos x}e^{t^2}\,dt$.
  • 7 Evaluate $\displaystyle\lim_{x\to0^+}\frac1{x^3}\int_0^{x^2}\sin\sqrt t\,dt$.
  • 8 Find all continuous $f:\mathbb{R}\to\mathbb{R}$ with $f(x)=1+\displaystyle\int_0^xt\,f(t)\,dt$ for all $x$.
  • 9 Let $f(t)=t$ for $0\le t\lt1$ and $f(t)=3$ for $1\le t\le2$. Find $F(x)=\int_0^xf$ and the points where $F$ is not differentiable.
Check: watch the sums of III.1–4 approach the claimed limits
n—
sum Sₙ—
claimed limit—
n · (Sₙ − limit)—
1 $\dfrac1{\sqrt{n^2+kn}}=\dfrac1n\cdot\dfrac1{\sqrt{1+k/n}}$; limit $\displaystyle\int_0^1\frac{dx}{\sqrt{1+x}}=\big[2\sqrt{1+x}\big]_0^1=2(\sqrt2-1)\approx0.8284$.
2 $\dfrac{k^2}{n^3+k^3}=\dfrac1n\cdot\dfrac{(k/n)^2}{1+(k/n)^3}$; limit $\displaystyle\int_0^1\frac{x^2}{1+x^3}dx=\tfrac13\log2\approx0.2310$.
3 $\tfrac1n\sum\tfrac kn\sin\tfrac{k\pi}n\to\int_0^1x\sin(\pi x)\,dx=\Big[-\tfrac{x\cos\pi x}\pi+\tfrac{\sin\pi x}{\pi^2}\Big]_0^1=\tfrac1\pi\approx0.3183$.
4 $\int_0^1e^x\,dx=e-1\approx1.71828$. For $n=10$ the sum is $\tfrac1{10}\cdot\tfrac{e^{0.1}(e-1)}{e^{0.1}-1}\approx1.80563$ — a right-hand sum of an increasing function overestimates, here by $0.0873$, close to $\tfrac{f(1)-f(0)}{2n}\approx0.0859$ (Exercise IV.6).
5 $F=G(x^2)$ with $G'(y)=\sqrt{1+y^3}$: $F'(x)=2x\sqrt{1+x^6}$.
6 Leibniz: $G'(x)=e^{\cos^2x}(-\sin x)-e^{\sin^2x}\cos x$.
7 L'Hôpital: the derivative of the numerator is $2x\sin x$ (Leibniz with $\sqrt{x^2}=x$ for $x\gt0$), that of $x^3$ is $3x^2$; $\tfrac{2x\sin x}{3x^2}\to\tfrac23$. (Or: $\sin\sqrt t\approx\sqrt t$, $\int_0^{x^2}\sqrt t\,dt=\tfrac23x^3$.)
8 The right side is differentiable (Theorem 4.8, $tf(t)$ continuous), so $f$ is, with $f'(x)=xf(x)$ and $f(0)=1$. Then $(f(x)e^{-x^2/2})'=0$, so $f(x)=e^{x^2/2}$ — the only solution. Check: $1+\int_0^xte^{t^2/2}dt=1+(e^{x^2/2}-1)$.
9 $F(x)=\tfrac{x^2}2$ for $0\le x\le1$ and $F(x)=\tfrac12+3(x-1)$ for $1\le x\le2$. $F$ is continuous; at $x=1$ the left derivative is $f(1^-)=1$ and the right derivative is $f(1^+)=3$, so $F$ is not differentiable at $1$ only (one-sided derivatives exist at $0$ and $2$).
IV
Proofs and challenges.
  • 1 (Riemann–Lebesgue lemma) Prove that $\displaystyle\lim_{n\to\infty}\int_a^bf(x)\sin(nx)\,dx=0$ for every $f\in\mathcal{R}[a,b]$. (First do it for step functions.)
  • 2 Let $f$ be continuous on $[0,\pi]$ with $\int_0^\pi f(x)\sin x\,dx=\int_0^\pi f(x)\cos x\,dx=0$. Prove that $f$ has at least two zeros in $(0,\pi)$.
  • 3 Let $f\in\mathcal{R}[0,1]$ satisfy $\int_0^xf=\int_x^1f$ for every $x\in[0,1]$. Prove that $f(c)=0$ at every point $c$ of continuity of $f$.
  • 4 Prove that a uniform limit of Riemann integrable functions on $[a,b]$ is Riemann integrable, and that the integrals converge.
  • 5 Let $f$ be continuous on $[0,\infty)$ with $f(x)\to L$ as $x\to\infty$. Prove $\frac1x\int_0^xf(t)\,dt\to L$.
  • 6 Let $f$ have a continuous derivative on $[0,1]$. Prove $$n\Big(\frac1n\sum_{k=1}^nf\big(\tfrac kn\big)-\int_0^1f\Big)\to\frac{f(1)-f(0)}2.$$
  • 7 Let $f$ be differentiable on $[0,1]$ with $f'\in\mathcal{R}[0,1]$ and $f(0)=0$. Prove $\displaystyle\int_0^1f^2\le\frac12\int_0^1(f')^2$.
1 For $f=\mathbf 1_{[c,d]}$: $\left|\int_c^d\sin nx\,dx\right|=\tfrac{|\cos nc-\cos nd|}n\le\tfrac2n\to0$; by linearity the lemma holds for step functions. For $f\in\mathcal{R}$ and $\varepsilon\gt0$, Exercise I.8 gives a step function $s\le f$ with $\int(f-s)\lt\varepsilon$. Then $\left|\int f\sin nx\right|\le\int(f-s)+\left|\int s\sin nx\right|\lt2\varepsilon$ for large $n$.
2 If $f$ had no zero in $(0,\pi)$, it would keep one sign and $\int f\sin\gt0$ or $\lt0$ ($f\sin$ continuous, nonzero inside). If it had exactly one zero $c$, where it changes sign (otherwise the same argument applies), then $\sin(x-c)=\sin x\cos c-\cos x\sin c$ also changes sign exactly at $c$ in $(0,\pi)$, so $f(x)\sin(x-c)$ keeps one sign and is not identically $0$; but $\int_0^\pi f(x)\sin(x-c)\,dx=\cos c\cdot0-\sin c\cdot0=0$, contradicting Theorem 4.6(6).
3 With $F(x)=\int_0^xf$, the hypothesis is $F(x)=F(1)-F(x)$, so $F\equiv F(1)/2$ is constant; $F(0)=0$ forces $F\equiv0$. At a continuity point $c$, $f(c)=F'(c)=0$ (Theorem 4.8). (So $f=0$ except on a null set.)
4 If $\sup|f-f_n|\lt\varepsilon$, then on every $I_k$, $\sup f-\inf f\le\sup f_n-\inf f_n+2\varepsilon$, so $U(f,P)-L(f,P)\le U(f_n,P)-L(f_n,P)+2\varepsilon(b-a)$; choosing $P$ for $f_n$ gives $U-L\lt\varepsilon(1+2(b-a))$ (and $f$ is bounded since $f_n$ is). Then $\left|\int f-\int f_n\right|\le\varepsilon(b-a)$.
5 Given $\varepsilon$, choose $A$ with $|f(t)-L|\lt\varepsilon$ for $t\ge A$. For $x\gt A$: $\left|\tfrac1x\int_0^x(f-L)\right|\le\tfrac1x\int_0^A|f-L|+\tfrac{x-A}x\varepsilon$. The first term $\to0$ as $x\to\infty$, so the $\limsup$ is $\le\varepsilon$.
6 The error is $\sum_k\int_{x_{k-1}}^{x_k}\big(f(x_k)-f(x)\big)dx$. By the mean value theorem $f(x_k)-f(x)=f'(\eta)(x_k-x)$, so the $k$-th term lies between $m'_k\int(x_k-x)dx$ and $M'_k\int(x_k-x)dx$, where $\int_{x_{k-1}}^{x_k}(x_k-x)dx=\tfrac1{2n^2}$ and $m'_k,M'_k$ are the min/max of $f'$ on $I_k$. Hence $n\cdot$error lies between $\tfrac12L(f',P_n)$ and $\tfrac12U(f',P_n)$, both $\to\tfrac12\int_0^1f'=\tfrac{f(1)-f(0)}2$ (Theorem 4.9).
7 By Theorem 4.9, $f(x)=\int_0^xf'$. Cauchy–Schwarz (II.5) on $[0,x]$: $f(x)^2\le x\int_0^x(f')^2\le x\int_0^1(f')^2$. Integrating over $[0,1]$: $\int_0^1f^2\le\tfrac12\int_0^1(f')^2$.
🎯 Exam corner CSIR Part BCSIR Part CGATE MA

E1. CSIR Part B GATE MA The value of $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac{n+k}{n^2+k^2}$ is (A) $\dfrac\pi4$; (B) $\dfrac\pi4+\dfrac{\log2}2$; (C) $\log2$; (D) $\dfrac\pi2-\log2$.

Idea $\dfrac{n+k}{n^2+k^2}=\dfrac1n\cdot\dfrac{1+k/n}{1+(k/n)^2}$: a right-hand Riemann sum of $f(x)=\dfrac{1+x}{1+x^2}$ on $[0,1]$.
Integral $\displaystyle\int_0^1\frac{dx}{1+x^2}+\int_0^1\frac{x\,dx}{1+x^2}=\frac\pi4+\frac12\log2\approx1.1320$ (numerically, $n=20000$ gives $1.13197$).
Answer (B). (A) keeps only the first half; (C), (D) are distractors.

E2. CSIR Part B Let $F(x)=\int_0^x\lfloor t\rfloor\,dt$ for $x\in[0,3]$. Which statement is true? (A) $F$ is differentiable on $(0,3)$; (B) $F$ is continuous on $[0,3]$ and not differentiable exactly at $x=1$ and $x=2$; (C) $F$ is discontinuous at $1$ and $2$; (D) $F'(x)=\lfloor x\rfloor$ for every $x\in(0,3)$.

Formula $F(x)=0$ on $[0,1]$, $x-1$ on $[1,2]$, $1+2(x-2)$ on $[2,3]$: piecewise linear and continuous (Theorem 4.8(1)).
Corners At $x=1$ the one-sided derivatives are $\lfloor1^-\rfloor=0$ and $\lfloor1^+\rfloor=1$; at $x=2$ they are $1$ and $2$ (Theorem 4.8(3)). Elsewhere in $(0,3)$, $\lfloor t\rfloor$ is continuous and $F'=\lfloor x\rfloor$.
Answer (B). (A), (D) fail at $1,2$; (C) contradicts the Lipschitz property.

E3. CSIR Part B Define $f:[0,1]\to\mathbb{R}$ by $f(x)=1$ if $x=\tfrac1n$ for some $n\in\mathbb{N}$, and $f(x)=0$ otherwise. Then (A) $f$ is not Riemann integrable, since it has infinitely many discontinuities; (B) $f$ is Riemann integrable and $\int_0^1f=0$; (C) $f$ is Riemann integrable and $\int_0^1f=1$; (D) the upper integral of $f$ is $1$.

Discontinuities $f$ is discontinuous at each $\tfrac1n$ and at $0$ (since $f(1/n)=1\not\to f(0)=0$); continuous elsewhere. $D_f=\{0\}\cup\{1/n\}$ is countable, hence null, and $f$ is bounded: integrable (Theorem 4.5).
Value Every subinterval contains points where $f=0$, so all lower sums are $0$; hence $\int f=0$, and the upper integral is $0$ too.
Answer (B).

E4. CSIR Part C Let $f:[0,1]\to\mathbb{R}$ be bounded. Which of the following statements are true? (One or more options may be correct.) (A) If $f^2$ is Riemann integrable, then $f$ is Riemann integrable. (B) If $f$ is Riemann integrable, then $f^3$ is Riemann integrable. (C) If $f$ is continuous except at countably many points, then $f$ is Riemann integrable. (D) If $f$ is Riemann integrable and $g:[0,1]\to\mathbb{R}$ is bounded with $g=f$ except at countably many points, then $g$ is Riemann integrable.

(A) False $f=1$ on $\mathbb{Q}$, $-1$ elsewhere: $f^2\equiv1$, but $f$ is discontinuous everywhere.
(B) True $f^3=\varphi\circ f$ with $\varphi(y)=y^3$ continuous (Theorem 4.6(5)); also $D_{f^3}\subseteq D_f$.
(C) True $f$ is bounded and $D_f$ is countable, hence null (Theorem 4.5).
(D) False $f\equiv0$ and $g=\mathbf 1_{\mathbb{Q}\cap[0,1]}$ differ only on a countable set; $g$ is not integrable. (For finitely many points it would be true.)
Answer (B) and (C).

E5. CSIR Part C Let $f:[-1,1]\to\mathbb{R}$ be Riemann integrable and $F(x)=\int_0^xf(t)\,dt$. Which of the following are true? (A) $F$ is uniformly continuous on $[-1,1]$. (B) If $f$ is continuous at $0$, then $F'(0)=f(0)$. (C) If $F$ is differentiable at $0$, then $f$ is continuous at $0$. (D) If $\lim_{t\to0^-}f(t)$ and $\lim_{t\to0^+}f(t)$ exist and are different, then $F$ is not differentiable at $0$.

(A) True $|F(x)-F(y)|\le M|x-y|$ with $M=\sup|f|$ (Theorem 4.8(1)).
(B) True Theorem 4.8(2).
(C) False $f=\mathbf 1_{\{0\}}$ gives $F\equiv0$, differentiable everywhere, while $f$ is discontinuous at $0$.
(D) True By Theorem 4.8(3) the left and right derivatives of $F$ at $0$ exist and equal the two one-sided limits of $f$, which differ: a corner (whatever the value $f(0)$).
Answer (A), (B) and (D).

E6. CSIR Part C Let $f:[0,1]\to\mathbb{R}$ be continuous. Which of the following hold for every such $f$? (A) $\displaystyle\lim_{n\to\infty}\int_0^1f(x^n)\,dx=f(0)$. (B) $\displaystyle\lim_{n\to\infty}n\int_0^1x^nf(x)\,dx=f(1)$. (C) $\displaystyle\lim_{n\to\infty}\int_0^1nf(x)e^{-nx}\,dx=f(0)$. (D) $\displaystyle\lim_{n\to\infty}\int_0^1f(x)\,|\sin nx|\,dx=0$.

(A) True Let $|f|\le M$, $\varepsilon\gt0$, and $\eta\gt0$ with $|f(y)-f(0)|\lt\varepsilon$ for $0\le y\lt\eta$. Fix $\delta\in(0,1)$; for $n$ large, $x^n\le(1-\delta)^n\lt\eta$ on $[0,1-\delta]$. So $\left|\int_0^1(f(x^n)-f(0))dx\right|\le\varepsilon+2M\delta$. ($f=e^x$, $n=1000$: $1.00132$.)
(B) True Example 6.
(C) True Substitute $u=nx$: $\int_0^nf(u/n)e^{-u}du$. Since $\int_0^ne^{-u}du\to1$ and $nf(x)e^{-nx}$ concentrates at $0$, split at $x=\delta$ as in Example 6: the part over $[\delta,1]$ is at most $Mne^{-n\delta}\to0$. ($f=e^x$: the integral is $\tfrac n{n-1}(1-e^{1-n})\to1=f(0)$.)
(D) False $|\sin nx|$ has mean value $\tfrac2\pi$ over each period, and in fact $\int_0^1f(x)|\sin nx|\,dx\to\tfrac2\pi\int_0^1f$; for $f\equiv1$ the limit is $\tfrac2\pi\ne0$. (Without the modulus the limit is $0$ — the Riemann–Lebesgue lemma, Exercise IV.1.)
Answer (A), (B) and (C).
🧑‍🏫 For the teacher

Suggested plan — 3 lectures × 60 min.

  1. Darboux sums. Definitions 4.1–4.3, the refinement lemma with a picture of one added point, Riemann's criterion (Theorem 4.2). Example 1 on the board, then Interactive 1 with $x^2$ and the step function; switch to the Dirichlet function and let the class explain why the amber never shrinks (Example 2).
  2. Which functions are integrable? Theorem 4.3 (state, prove one direction), Theorem 4.4 with the telescoping proof for monotone functions, measure zero and Lebesgue's criterion (state, sketch the "$\Leftarrow$" direction with the oscillation sets $D_j$). Example 3 (Thomae) with Interactive 1, Example 5, and the pitfalls on compositions and $|f|$.
  3. Properties and FTC. Theorems 4.6–4.10, Example 4 (limits of sums — have students find the integral before you reveal it), Example 7 and Interactive 2 (cycle through all five integrands; stop at the one-point function). Finish with Exam-corner E2 and E5 live.

Discussion questions. (1) Thomae's function and the Dirichlet function both "see" the rationals. Why is one integrable and the other not? (2) If $F$ is differentiable everywhere, is $\int_a^bF'=F(b)-F(a)$ automatic? What extra hypothesis does Theorem 4.9 need, and why? (3) Can a function be integrable on $[0,1]$ and discontinuous at uncountably many points? Can its discontinuities be dense? Both?

Misconceptions to watch for. "Infinitely many discontinuities ⇒ not integrable"; "uncountably many discontinuities ⇒ not integrable" (the Cantor set); "$|f|$ integrable ⇒ $f$ integrable"; computing a limit of a sum by one convenient choice of tags for a function not yet known to be integrable; "$F'=f$ everywhere" for any integrable $f$; forgetting boundedness.

Suggested homework. I(1, 2, 4, 7), II(1, 2, 3, 5, 7), III(1, 2, 3, 6, 8, 9), IV(1, 3, 5); Exam corner E1, E3, E4, E6.

🔬 Research–Teaching NexusResearch-tutored · optional, about 60 minutes

Research question. How fast do Riemann sums converge, and how does the answer depend on the choice of tags and on the smoothness of the integrand?

Why it matters. In clinical pharmacology the "area under the curve" (AUC) of a drug's blood concentration measures total exposure and is used worldwide to compare generic and brand-name medicines; regulators accept AUC computed by the trapezoidal rule from a handful of blood samples. Environmental engineers estimate the total pollutant load of a river from sampled flow rates in the same way. Knowing the error of such sums tells you how many samples are needed.

What to do.

  1. For $f(x)=e^x$ on $[0,1]$ compute the left sum $L_n$, midpoint sum $M_n$, trapezoidal sum $T_n=\tfrac12(L_n+R_n)$ and Simpson's value $S_n=\tfrac13(T_n+2M_n)$ for $n=10,20,40,80$.
  2. Tabulate the errors and estimate the exponent $p$ in error $\approx Cn^{-p}$ from successive ratios. Explain the result for $L_n$ with Exercise IV.6.
  3. Repeat for $f(x)=\sqrt x$, whose derivative is unbounded at $0$. Which rules lose their speed, and why?
  4. Model an AUC study: take $c(t)=10\,(e^{-0.2t}-e^{-1.5t})$ mg/L for $0\le t\le24$ h, "sample" it at $8$ irregular times, and compare the trapezoidal AUC with the exact integral.

Tools: Python with NumPy (or a spreadsheet); Interactive 1 for intuition about tags.

Hand in: A one-page report with the error table, the fitted exponents, and a recommendation on sampling times for the AUC model.

Going further. Read about the Euler–Maclaurin formula, which explains the trapezoidal exponent and why the trapezoidal rule is spectacularly accurate for smooth periodic functions; then try $\int_0^{2\pi}e^{\cos x}dx$.

Instructor note: for $e^x$ at $n=10,20,40$ the errors are about $L_n$: $-8.45\times10^{-2},-4.26\times10^{-2},-2.14\times10^{-2}$ ($p=1$); $M_n$: $-7.16\times10^{-4},-1.79\times10^{-4},-4.47\times10^{-5}$ ($p=2$); $T_n$: $1.43\times10^{-3},3.58\times10^{-4},8.95\times10^{-5}$ ($p=2$); $S_n$: $6.0\times10^{-8},3.7\times10^{-9},2.3\times10^{-10}$ ($p=4$). For $\sqrt x$ the midpoint and trapezoid errors fall only like $n^{-3/2}$ ($1.72\times10^{-3}\to6.29\times10^{-4}\to2.28\times10^{-4}$ for $M_n$) and Simpson's error also like $n^{-3/2}$ ($-9.1\times10^{-4}\to-3.2\times10^{-4}\to-1.1\times10^{-4}$), while $L_n$ keeps $p=1$. The exact AUC of the model is $10\big(\tfrac{1-e^{-4.8}}{0.2}-\tfrac{1-e^{-36}}{1.5}\big)\approx42.92$ mg·h/L.

🧪 Self-check quiz

0/5 correct

Q1. Which function is not Riemann integrable on $[0,1]$?

Q2. $\displaystyle\lim_{n\to\infty}\sum_{k=1}^n\frac1{n+k}$ equals

Q3. If $F(x)=\int_0^{x^3}\cos(t^2)\,dt$, then $F'(x)=$

Q4. Riemann's criterion says that a bounded $f$ is integrable on $[a,b]$ if and only if

Q5. Let $f\in\mathcal{R}[a,b]$ and $F(x)=\int_a^xf$. Which statement is always true?