Sweet! I'm keen to learn about the basic fundamentals of calculus!
> For each subinterval ...(bunch of cool maths rendering I can't copy and paste because it's all comes out newline delimited on my clipboard) ... and let m<sub>k</sub> and M<sub>k</sub> denote the infimum and supremum of f on that subinterval...
Okay, guess it wasn't the kind of introduction I had assumed/hoped.
Very cool maths rendering though.
As someone who never passed high school or got a degree thanks to untreated ADHD, if anyone knows of an introduction to the basic fundamentals of calculus that a motivated but under educated maths gronk can grok, I would gratefully appreciate a link or ten.
I feel similar about the trace of a matrix being equal to the sum of eigenvalues.
Probably this means I should sit with it more until it is obvious, but I also kind of like this feeling.
FWIW, I think this is the same as saying "iff it is bounded and has finite discontinuities". I like that characterization b/c it seems more precise than "almost everywhere", but I've heard both.
I mention that because when I read the first footnote, I thought this was a mistake:
> boundedness alone ensures the subinterval infima and suprema are finite.
But it wasn't. It does, in fact, insure that infima and suprema are finite. It just does NOT ensure that it is Riemann integrable (which, of course the last paragraph in the first section mentions).
Thanks for posting. This was a fun diversion down memory lane whilst having my morning coffee.
If anyone wants a rabbit hole to go down:
Think about why the Dirichlet function [1], which is bounded -- and therefore has upper and lower sums -- is not Riemann integrable (hint: its upper and lower sums don't converge. why?)
Then, if you want to keep going down the rabbit hole, learn how you _can_ integrate it (ie: how you _can_ assign a number to the area it bounds) [2]
[1] One of my favorite functions. It seems its purpose in life is to serve as a counter example. https://en.wikipedia.org/wiki/Dirichlet_function
The source code of the website is open if you wanna check it out!
The math fonts used in the formulas are just the ones provided by KaTeX, which I think are just TeX's default math fonts.
--edit: The font used for those initials is called Goudy Initialen: https://www.dafont.com/goudy-initialen.font
It is not: for example, the piece-wise constant function f: [0,1] -> [0,1] which starts at f(0) = 0, stays constant until suddenly f(1/2) = 1, until f(3/4) = 0, until f(7/8) = 1, etc. is Riemann integrable.
"Continuous almost everywhere" means that the set of its discontinuities has Lebesgue measure 0. Many infinite sets have Lebesgue measure 0, including all countable sets.
1910 book, but actually does the job well
To see why \int_a^b f(x) dx = F(b) - F(a) with F'(x) = f(x),
we replace f with f' (and hence F with f) and get
\int_a^b f'(x) dx = f(b) - f(a).
Re-arranging terms, we get
f(b) = f(a) + \int_a^b f'(x) dx.
The last line just says: The value of function f at point b is is the value at point a plus the sum of all the infinitely many changes the function goes through on its path from a to b.
the discrete version is much clearer to me. Suppose you have a function f(n) defined at integer positions n. Its "derivative" is just the difference of consecutive values
f'(n) = f(n+1) - f(n)
Then the fundamental theorem is just a telescopic sum: f(b) - f(a) = \sum_a^b f'(n)So to get the area under the curve between a and b, you calculate the area under the curve from 0 to b (antiderivative at b) and subtract the area under the curve from 0 to a (antiderivative at a).
At least that's my sleep deprived take.
Here's an example of a Riemann integrable function w/ infinitely many discontinuities: https://en.wikipedia.org/wiki/Thomae%27s_function
Anyone interested in this should check out the Prologue to Lebesgue's 1901 paper: http://scratchpost.dreamhosters.com/math/Lebesgue_Integral.p...
It gives several reasons why we "knew" the Riemann integral wasn't capturing the full notion of integral / antiderivative
For anyone interested in checking out the book, there is a PDF preview here[1] and printable concept maps[2], which should be useful no matter which book you're reading.
[1] https://minireference.com/static/excerpts/noBSmathphys_v5_pr...
[2] https://minireference.com/static/conceptmaps/math_and_physic...
- except finitely many, or
- except a set of measure zero.
"iff it is bounded and has countable discontinuities"?
Or, are there some uncountable sets which also have Lebesgue measure 0?
The indicator function of the Cantor set is Riemann integrable. Like you said, though, the Dirichlet function (which is the indicator function of the rationals) is not Riemann integrable.
The reason is because the Dirchlet function is discontinuous everywhere on [0,1], so the set of discontinuities has measure 1. The Cantor function is discontinuous only on the Cantor set.
Likewise, the indicator function of a "fat Cantor set" (a way of constructing a Cantor-like set w/ positive measure) is not Riemann integrable: https://en.wikipedia.org/wiki/Smith%E2%80%93Volterra%E2%80%9...
April 22, 2026
Although the notion of area is intuitive, its mathematical treatment requires a rigorous definition. This post introduces the Riemann integral, and proves the fundamental theorem of calculus—a beautiful result that connects integrals and derivatives.
Given a bounded1 1 Note that continuity is not required here; boundedness alone ensures the subinterval infima and suprema are finite. function \(f:[a,b]\to\mathbb{R}\), we can approximate the area under its graph by rectangles. Choose a partition of its domain
\[ \mathcal{P}=\{x_0,x_1,\ldots,x_n\mid a=x_0<x_1<\cdots<x_n=b\}. \]
For each subinterval \([x_{k-1},x_k]\), define the width \(\Delta x_k=x_k-x_{k-1}\), and let \(m_k\) and \(M_k\) denote the infimum and supremum of \(f\) on that subinterval. The lower and upper sums are
\[ L(f,\mathcal{P})=\sum_{k=1}^{n}m_k\Delta x_k, \qquad U(f,\mathcal{P})=\sum_{k=1}^{n}M_k\Delta x_k. \]
We define \(f\) to be Riemann integrable2 2 Every continuous function on \([a,b]\) is Riemann integrable; so is every monotone function. The exact characterization is Lebesgue’s criterion: \(f\) is Riemann integrable iff it is bounded and continuous almost everywhere. on \([a,b]\) iff for every \(\varepsilon>0\) there exists a partition \(\mathcal{P}\) such that \(U(f,\mathcal{P})-L(f,\mathcal{P})<\varepsilon\), in which case
\[ \int_a^b f =\sup_{\mathcal{P}}L(f,\mathcal{P}) =\inf_{\mathcal{P}}U(f,\mathcal{P}). \]
The proof requires the mean value theorem, which in turn rests on Rolle’s theorem and Fermat’s proposition.
Fermat’s Proposition. Let \(I\subset\mathbb{R}\) be open and \(f:I\to\mathbb{R}\) differentiable at \(a\in I\). If \(f\) has a local extremum at \(a\), then \(f^{\prime}(a)=0\).
Proof. Assume \(f\) has a local maximum3 3 The local minimum case is identical, with all inequalities reversed. at \(a\). Then there exists \(\delta>0\) such that \(f(x)-f(a)\le 0\) for all \(x\in(a-\delta,a+\delta)\). Therefore
\[ \frac{f(x)-f(a)}{x-a}\ge 0 \quad (x<a), \qquad \frac{f(x)-f(a)}{x-a}\le 0 \quad (x>a). \]
Taking limits, \(f^{\prime}_-(a)\ge 0\) and \(f^{\prime}_+(a)\le 0\). Since \(f\) is differentiable at \(a\), \(f^{\prime}_-(a)=f^{\prime}_+(a)=f^{\prime}(a)\), hence \(f^{\prime}(a)=0\). \(\square\)
Rolle’s Theorem. If \(f:[a,b]\to\mathbb{R}\) is continuous on \([a,b]\), differentiable on \((a,b)\), and \(f(a)=f(b)\), then there exists \(\xi\in(a,b)\) such that \(f^{\prime}(\xi)=0\).
Proof. By the extreme value theorem,4 4 Topological result: \([a,b]\) is compact (Heine-Borel), the continuous image of a compact set is compact, and compact subsets of \(\mathbb{R}\) are closed and bounded, so they contain their \(\inf\) and \(\sup\), which are finite. \(f\) attains its minimum \(m\) and maximum \(M\) on \([a,b]\). If \(m=M\), then \(f\) is constant and any \(\xi\in(a,b)\) works. Otherwise, since \(f(a)=f(b)\), at least one extremum is attained at some \(\xi\in(a,b)\); by Fermat, \(f^{\prime}(\xi)=0\). \(\square\)
**Mean Value Theorem.**5 5 Geometrically: there is always a point where the tangent line is parallel to the secant through the endpoints. If \(f\) is continuous on \([a,b]\) and differentiable on \((a,b)\), then there exists \(\xi\in(a,b)\) such that
\[ f^{\prime}(\xi)=\frac{f(b)-f(a)}{b-a}. \]
Proof. Define
\[ g(x)=f(a)+\frac{f(b)-f(a)}{b-a}(x-a), \qquad h(x)=f(x)-g(x). \]
Then \(h\) is continuous on \([a,b]\), differentiable on \((a,b)\), and \(h(a)=h(b)=0\). By Rolle’s theorem, there exists \(\xi\in(a,b)\) with \(h^{\prime}(\xi)=0\), which gives
\[ f^{\prime}(\xi)-\frac{f(b)-f(a)}{b-a}=0.\,\square \]
We now have everything needed to prove the main result.
**Fundamental Theorem of Calculus.**6 6 A broader formulation also includes the statement that \(x\mapsto\int_a^x f(t)\,dt\) is an antiderivative of \(f\) under suitable regularity assumptions. Let \(f:[a,b]\to\mathbb{R}\) be Riemann integrable, and let \(F:[a,b]\to\mathbb{R}\) be continuous on \([a,b]\), differentiable on \((a,b)\), and satisfy \(F^{\prime}(x)=f(x)\) for all \(x\in(a,b)\). Then
\[ \int_a^b f = F(b)-F(a). \]
Proof. Fix a partition \(\mathcal{P}=\{x_0,\ldots,x_n\}\). For each \([x_{k-1},x_k]\), the mean value theorem applied to \(F\) gives \(z_k\in(x_{k-1},x_k)\) such that
\[ F(x_k)-F(x_{k-1})=f(z_k)\,\Delta x_k. \]
Since \(m_k\le f(z_k)\le M_k\), we obtain
\[ L(f,\mathcal{P}) \le \sum_{k=1}^{n}\left(F(x_k)-F(x_{k-1})\right) = F(b)-F(a) \le U(f,\mathcal{P}). \]
Taking supremum and infimum over all partitions and using integrability, we get
\[ \int_a^b f=F(b)-F(a).\,\square \]
Thus computing an area reduces to evaluating an antiderivative at two points.7 7 For example, \(\int_0^1 x^2\,dx = F(1)-F(0) = 1/3\) with \(F(x)=x^3/3\). No partitions needed. This theorem is fundamental because it unifies differentiation and integration, the two central operations of calculus.
—David Álvarez Rosa