$\newcommand{\ds}{\displaystyle}$ $\newcommand{\Rr}{\mathbb{R}}$ $\newcommand{\Qq}{\mathbb{Q}}$ $\newcommand{\Nn}{\mathbb{N}}$ $\newcommand{\ve}{\varepsilon}$ $\newcommand{\lint}{\underline{\int}}$ $\newcommand{\uint}{\overline{\int}}$ $\newcommand{\sgn}{\mathrm{sgn}}$
The Fundamental Theorem of Calculus¶
Let $f \in R[a,b]$, then for $c \in [a,b]$ the function of $x$ defined by $$\int_c^x f $$ is call the indefinite integral of $f$ with basepoint $c$.
Theorem (FTC 2nd form) Let $f \in R[a.b]$. Then function
$$ F(x) = \int_a^x f $$
is Lipschitz continuous on $[a,b]$; furthermore, if $f$ is continuous at $x_0 \in [a,b]$, then $F$ differentiable at $x_0$ and $F'(x_0) = f(x_0).$
Proof. Suppose $|f| \le M$ on [a,b] (integrable functions are bounded). So, for any $x,x' \in [a,b]$, $$ |F(x')-F(x)| = \left|\int_a^{x'} f - \int_a^x f\right| = \left|\int_x^{x'} f\right| \le M|x'-x|. $$ This shows that $F$ is Lipschitz continuous on $[a,b]$.
Now suppose $f$ is continuous on $x_0$. Then for any $\varepsilon \gt 0$, there exists $\delta > 0$ so that
$$|f(t)-f(x_0)| \lt \varepsilon$$
whenever $t \in [a,b]$ and $|t-x_0| \lt \delta$. Thus, for $x \in [a,b]$ with $|x-x_0| < \delta$, we have
$$ \left|\frac{F(x) - F(x_0)}{x-x_0}-f(x_0)\right| = \left| \frac{1}{x-x_0} \int_{x_0}^x f - \frac{1}{x-x_0} \int_{x_0}^x f(x_0) \right| \le \dfrac{\int_{x_0}^x |f-f(x_0)|}{|x-x_0|} < \frac{\varepsilon \left|\int_{x_0}^x 1 \right|}{|x-x_0|} = \varepsilon $$
This shows that $F(x)$ is differentiable at $x=x_0$ and that $F'(x_0) =f(x_0)$.
Corollary. If $f \in C[a,b]$, then $F(x)=\int_a^x f$, the indefinite integral of $f$ with basepoint $a$, is an antiderivative (aka primitive) of $f$ on $[a,b]$.
In general, however, an indefinite integral $F$ of $f$ does not need to be differentiable at every point in $[a,b]$ and even if $F$ is differentiable at a point $x_0 \in [a,b]$, $F'(x_0)$ may not be $f(x_0)$.
Example. The indefinite integral of the signum function
$$ \sgn(x) = \begin{cases} \phantom{-}1 & x > 0 \\ \phantom{-}0 & x = 0 \\ -1 & x < 0. \end{cases} $$
with basepoint $0$ on $[-1,1]$ is the absolute value function $|x|$ which is not differentiable at $x=0$.
Example. We have seen that Thomae's function $h$ is non-negative and integrable on $[0,1]$ with $\int_0^1 h = 0$. So $H(x) := \int_0^x h = 0$ for all $x \in [0,1]$. And so $H'(x_0) =0 \neq h(x_0)$ for any rational $x_0 \in [0,1]$.
Theorem (FTC 1st form). Suppose $F \colon [a,b] \to \mathbb{R}$ is differentiable and $F'$ integrable, then $$ \int_a^b F' = F(b)-F(a).$$
Proof. Since differentiability implies continuity (at the end points as well), $F$ is continuous on $[a,b]$.
Take any partition $P = \{x_0,\ldots, x_n\}$ of $[a,b]$. The mean value theorem guarantees points $t_i \in [x_{i-1},x_i]$ such that
$$ F(x_i) - F(x_{i-1}) = F'(t_i)\Delta x_i. $$
Thus, $m_i\Delta x_i \le F(x_i)-F(x_{i-1}) \le M_i\Delta x_i$.
Summing over $1 \le i \le n$, we have $$ L(P,F') \le F(b)-F(a) = \sum_{i=1}^n F'(t_i)\Delta x_i \le U(P,F'). $$
Since $P$ is an arbitrary partition of $[a,b]$, we conclude that $$ \underline{\int_a^b} F' \le F(b)-F(a) \le \overline{\int_a^b} F' $$
By integrability of $F'$, the upper and the lower integral of $F'$ are the same. Thus,
$$ F(b)-F(a) = \underline{\int_a^b} f = \overline{\int_a^b} f = \int_a^b f. $$
Remark. If $f$ is continuous on $[a,b]$ then the 1st form of the FTC follows from the 2nd form because under that assumption the indefinite integral $F_a(x) := \int_a^x f$ is a primitive of $f$ on $[a,b]$ (see the Corollary above). So if $F$ is also a primitive of $f$, then $(F_a-F)'(x) = f(x)-f(x) = 0$ for any $x \in [a,b]$. By the MVT, $F(x) = F_a(x)+c$ for some constant $c$. Since $F_a(a)=\int_a^a f = 0$, $F(a) = F_a(a)+c = c$. Therefore, $$F(x) = F_a(x) + F(a)$$ Consequently, $\int_a^b f = F_a(b) = F(b) -F(a)$.
Example. Thomae function $h$ is integrable on $[0,1]$ but does not have a primitive on $[0,1]$. Indeed, if it had one, say $H$, then according to the 1st form of the FTC, $H(x)-H(0) = \int_0^x h = 0$ for each $x \in [0,1]$. And that means $H$ must be the constant zero function but it is clearly not a primitive of $h$.
Example. The function $H(x):=2\sqrt{x}$ is continuous on $[0,1]$ and $h(x):=H'(x) = 1/\sqrt{x}$ for $x \in (0,1]$ is unbounded hence not integrable no matter how we define $h(0)$.
Example. The function on $[-1,1]$ defined by
$$ F(x) = \begin{cases} x^2\sin(1/x) & x \neq 0 \\ 0 & x =0 \end{cases} $$ is differentiable on $[-1,1]$ and
$$ F'(x) = \begin{cases} 2x\sin(1/x)-\cos(1/x) & x \neq 0 \\ 0 & x=0. \end{cases} $$
Note that $F'$ is bounded on $[-1,1]$ (can you give a bound?) and continuous on $[-1,1]$ except $0$ hence $F'$ is integrable on $[-1,1]$. What is $\int_{-1}^1 F'(x) dx$?
Example. Let $F(x) = x^2\cos(1/x^2)$ on $(0,1]$ and $F(0)=0$. It is easy to check that $F$ differentiable and hence continuous at every point on $[0,1]$ and that
$$F'(x) = 2x\cos(1/x^2) +(2/x)\sin(1/x^2)$$ for $x \in (0,1]$ and $F'(0) = 0$.
Note that $F'$ in not bounded on $[0,1]$ and hence not integrable.
Proposition (Integration by Parts). Suppose $F$ and $G$ are differentiable on $[a,b]$ and that $F'$ and $G'$ are both integrable on $[a,b]$. Then
$$\int_a^b FG' = F(b)G(b)-F(a)G(a) - \int_a^b F'G.$$
Proof. The product $FG$ is differentiable and by the product rule,
$$ (FG)' = F'G + FG'. $$
Differentiable functions on $[a,b]$ are continuous and hence integrable, $F',G'$ are integrable by assumption. Therefore, $(FG)'$, $F'G$ and $FG'$ are all integrable since integrable functions are closed under sum and product. It now follows from the 1st form of the FTC that
$$F(b)G(b)-F(a)G(a) = \int (FG)' = \int F'G + FG' = \int_a^b F'G + \int_a^b FG'.$$
Exercise. Find differentiable $F$, $G$ and $[-1,1]$ so that the conclusion of integration by parts does not hold.
Theorem (Change of variables). Let $\varphi \in C^1[a,b]$ and $f$ be continuous on $\varphi([a,b])$. Then
$$\int_a^b f(\varphi(x))\varphi'(x)dx = \int_{\varphi(a)}^{\varphi(b)} f(u) du.$$
Proof. Since $f$ is continuous on $[a,b]$, it has a primitive $F$ on $[a,b]$ (Corollary of the 2nd form of the FTC). The Chain rule asserts that $F \circ \varphi$ is differentiable on $[a,b]$ and
$$ (F\circ \varphi)'(x) = F'(\varphi(x))\varphi'(x)=f(\varphi(x))\varphi'(x).$$
Since $\varphi \in C^1[a,b]$, $f(\varphi(x))\varphi'(x)$ is continuous on $[a,b]$ and hence integrable. By applying the 1st form of the FTC, to this function and $f$, we get
$$ \int_a^b f(\varphi(x))\varphi'(x) dx = \int_a^b (F\circ \varphi)' = F\circ \varphi(b)-F\circ \varphi(a) =F(\varphi(b))-F(\varphi(a))=\int_{\varphi(a)}^{\varphi(b)} f(u) du. $$
Example. Consider the integral $\ds \int_{-1}^2 \frac{x}{1+x^2} dx$.
Let $u=\varphi(x) = 1+x^2$ and $f(u)=\frac{1}{2u}$.
Then $\varphi(-1)=2, \varphi(2) = 5 \in \varphi([-1,2])=[1,5]$, $\varphi'(x) =2x$ and so
$$ f \circ \varphi(x) \cdot \varphi'(x) = \frac{1}{2(1+x^2)}2x = \frac{x}{1+x^2}$$
The theorem above asserts that
$$ \int_{-1}^2 \frac{x}{1+x^2} dx = \int_{1}^5 \frac{1}{2u} = \ln\sqrt{\frac{5}{2}}. $$
Lebesgue's Integrability Criterion (Optional)¶
We conclude this set of notes with a criteria for integrability. See Bartle and Sherbert's Introduction to Real Analysis for a proof.
Lebesgue's Integrability Criterion
A bounded function $f \colon [a,b] \to \Rr$ is Riemann integrable if and only if $f$ is continuous almost everywhere on $[a,b]$.
That is the set of discontinuties of $f$ has measure $0$.
A proof of the result can be found here.
A subset $A$ of $\Rr$ has measure 0 if for any $\varepsilon > 0$, there are of open intervals $(a_k,b_k)$ $(k \in \mathbb{N})$ that cover $A$, i.e.
$$A \subseteq \bigcup_k (a_k,b_k),\ \text{and}\quad \sum_k (b_k-a_k) \le \varepsilon.$$
A measure 0 set is also known as a null set.
Example $\mathbb{N}$ is null.
For any $\ve >0$, and $k \in \Nn$, let $I_k = (k - \ve/2^{k+1}, k + \ve/2^{k+1})$. Since $k \in I_k$ for each $k$, the open intervals $I_k$'s cover $\Nn$. Note that the length of $I_k$ is $\ve/2^k$. Hence $\sum_k |I_k| = \ve$.
From this it follows easily that every countable subset of $\Rr$ is null.
Proposition. The union of two null sets is null.
Proof. Suppose $A$ and $B$ are null. For any $\ve > 0$, there exist countable collections of open intervals $\{I_k\}$ and $\{J_k\}$ such that the $I_k$'s cover $A$ and the $J_k$'s cover $B$ with $\sum |I_k| \le \ve/2$ and $\sum |J_k| \le \ve/2$. Then $\{I_k\} \cup \{J_k\}$ is still a countable collection of open intervals that covers $A \cup B$ and the sum of the lengths of the interval in this collection is clearly at most $\ve$.
Remarks.
Theorem 2 in Notes 05 (composition theorem) follows immediately from Lebesgue's criterion: if $\phi$ is continuous then the discontinuities of $\phi \circ f$ is a subset of the discountinuities of $f$.
It also follows from Lebesgue's criterion that product of two integrable functions is integrable: the set of discontinuities of $fg$ is contained in the union of the sets of discontinuities of $f$ and of $g$. And union of two measure zero sets is measure zero.