Solution (source code)

= Solution

The <fundamental theorem of calculus> connects the <Riemann integral> with <differentiation>. Its first part says that for <continuous> $h:[a,b]\to\mathbb R$, the accumulation function $H(x)=\int_a^xh(t)\,dt$ is <continuous> on $[a,b]$ and <differentiable> inside it, with
$$
\boxed{H'(x)=h(x).}
$$
To prove this, boundedness of $h$ gives $|H(y)-H(x)|\le\|h\|_\infty|y-x|$, proving <continuity>. For an interior point and a sufficiently small nonzero increment $u$,
$$
\frac{H(x+u)-H(x)}u-h(x)
=\frac1u\int_x^{x+u}(h(t)-h(x))\,dt.
$$
Its absolute value is at most $\sup_{|t-x|\le|u|}|h(t)-h(x)|$, which tends to zero by <continuity> of $h$ at $x$. This proves the <derivative> formula. The same estimate gives the appropriate one-sided endpoint <derivatives>.

The second part says that if $Q$ is <continuous> on $[a,b]$, <differentiable> on $(a,b)$, and $Q'=h$ with $h$ <continuous>, then
$$
\boxed{\int_a^b h(t)\,dt=Q(b)-Q(a).}
$$
Indeed $(Q-H)'=0$, so the <mean value theorem> makes $Q-H$ constant, and evaluating at the endpoints proves the formula. A useful stronger version only requires $Q'$ to be <Riemann integrable>. For a partition $a=x_0<\cdots<x_N=b$, the <mean value theorem> on each subinterval provides $\xi_j\in(x_{j-1},x_j)$ such that
$$
Q(b)-Q(a)=\sum_{j=1}^NQ'(\xi_j)(x_j-x_{j-1}).
$$
As the mesh tends to zero, these tagged <Riemann sums> converge to $\int_a^b Q'$, proving that version too. Its integrability hypothesis must not be omitted.

\b[An integrable integrand need not give an everywhere <differentiable> accumulation function.] For a counterexample, let $f(t)=0$ for $t<1/2$ and $f(t)=1$ for $t\ge1/2$. This bounded step <function> is <Riemann integrable>, but
$$
F(x)=\int_0^xf(t)\,dt=\begin{cases}0,&x\le1/2,\\x-1/2,&x\ge1/2.
\end{cases}
$$
Its left and right <derivatives> at $1/2$ are zero and one. Thus \b[$F$ need not be <differentiable> at every interior point]. The first part of the <fundamental theorem of calculus> does apply at every point where the integrand is <continuous>.

\b[A <derivative> need not have a <Riemann integral>.] Define on all of $\mathbb R$
$$
f(x)=\begin{cases}x^2\sin(1/x^2),&x\ne0,\\0,&x=0.
\end{cases}
$$
At zero $f(h)/h=h\sin(1/h^2)\to0$, so $f'(0)=0$; elsewhere the <product rule> and <chain rule> give
$$
f'(x)=2x\sin(1/x^2)-\frac2x\cos(1/x^2).
$$
At $x_n=(2\pi n)^{-1/2}$, this equals $-2/x_n\to-\infty$. Hence $f'$ is unbounded on $[0,1]$, whereas a properly <Riemann integrable> <function> on a compact interval must be bounded. The requested <Riemann integral> therefore \b[need not exist], even though $f$ is <differentiable> everywhere. This example is an <unbounded derivative obstruction to Riemann integrability>; it does not contradict the theorem's version that explicitly assumes integrability of the derivative.