% vim: tw=50
% 09/03/2022 11AM

\myskip
Here is another property of Riemann integrals:
\begin{enumerate}[(1)]
    \item[(6)] $f$ is integrable on $[a, b]$. If
        $a < c < b$, then $f$ is integrable over
        $[a, c]$ and $[c, b]$ and
        \[ \int_a^b f = \int_a^c f + \int_c^b f \]
        Conversely, if $f$ is integrable over $[a,
        c]$ and $[c, b]$, then $f$ is integrable
        over $[a, b]$ and
        \[ \int_a^b  f = \int_a^c f + \int_c^b f \]
\end{enumerate}

\begin{proof}[of (6)]
    We first make two observations:
    \begin{itemize}
        \item If $\mathcal{D}_1$ is a dissection
            of $[a, c]$ and $\mathcal{D}_2$ is a
            dissection of $[c, b]$, then
            $\mathcal{D} = \mathcal{D}_1 \cup
            \mathcal{D}_2$ is a dissection of $[a,
            b]$ and
            \[ S(f, \mathcal{D}_1 \cup
            \mathcal{D}_2) = S(f_{[a, c]},
            \mathcal{D}_1) + S(f_{[c, b]},
            \mathcal{D}_2 \tag{$*_1$} \]
        \item Also if $\mathcal{D}$ is a dissection
            of $[a, b]$, then
            \begin{align*}
                S(f, \mathcal{D})
                &\ge S(f, \mathcal{D} \cup \{c\})
                \\
                &= S(f_{[a, c]}, \mathcal{D}_1) +
                S(f_{[c, b]}, \mathcal{D}_2)
                \tag{$*_2$}
            \end{align*}
            where $\mathcal{D}_1$ dissects $[a,
            c]$ and $\mathcal{D}_2$ dissects $[c,
            b]$.
    \end{itemize}
    Then ($*_1$) gives
    \[ I^*(f) \le I^*(f_{[a, c]}) +
    I^*(f_{[c, b]}) \]
    and ($*_2$) gives
    \[ I^*(f) \ge I^*(f_{[a, c]}) +
    I^*(f_{[c, b]}) \]
    \[ \implies I^*(f) = I^*(f_{[a, c]}) +
    I^*(f_{[c, b]}) \]
    Similarly
    \[ I_*(f) = I_*(f_{[a, c]} +
    I_*(f_{[c, b]}) \]
    Thus
    \begin{align*}
        0
        &\le I^*(F) - I_*(f) \\
        &= [I^*(f_{[a, c]}) - I_*(f_{[a,
        c]})] + [I^*(f_{[c, b]}) -
        I_*(f_{[c, b]})]
    \end{align*}
    From this (6) follows right away.
\end{proof}

\begin{notation*}
    It is a convention that if $a > b$, then
    \[ \int_a^b f = -\int_b^a f \]
    and if $a = b$ we agree that its value is
    zero. With this convention if $|f| \le K$,
    then
    \[ \left| \int_a^b f \right| \le K|b - a| \]
\end{notation*}

\subsubsection*{Fundamental Theorem of Calculus (FTC)}

$f : [a, b] \to \RR$ bounded and integrable.
Write:
\[ F(x) = \int_a^x f(t) \dd t \]
$x \in [a, b]$.

\begin{theorem}
    $F$ is continuous.
\end{theorem}

\begin{proof}
    \[ F(x + h) - F(x) = \int_x^{x + h} f(t) \dd t \]
    so
    \begin{align*}
        |F(x + h) - F(x)|
        &= \left| \int_x^{x + h} f(t) \dd t
        \right| \\
        &\le K|h|
    \end{align*}
    if $|f| \le K \,\,\forall\,\, t \in [a, b]$.
    Now let $h \to 0$ and we're done. 
\end{proof}

\begin{theorem}[FTC]
    If in addition $f$ is continuous at $x$, then
    $F$ is differentiable at $x$ and
    \[ F'(x) = f(x) .\]
\end{theorem}

\begin{proof}
    We need to consider
    \[ \left| \frac{F(x + h) - F(x)}{h} - f(x) \right| \]
    (for $x + h \in [a, b]$ and $h \neq 0$).
    \begin{align*}
        \left| \frac{F(x + h) - F(x)}{h} - f(x) \right|
        &= \frac{1}{|h|} \left| \int_x^{x + h}
        f(t) \dd t - hf(x) \right| \\
        &= \frac{1}{|h|} \left| \int_x^{x + h}
        [f(t) - f(x)] \dd t \right|
    \end{align*}
    $f$ is continuous at $x$, means that given
    $\eps > 0$, $\exists\,\,\delta > 0$ such that
    if $|t - x| < \delta$ then
    \[ |f(t) - f(x)| < \eps \]
    If $|h| < \delta$, we can write
    \[ \le \frac{1}{|h|} \eps |h| = \eps \]
    This means
    \[ \lim_{h \to 0} \frac{F(x + h) - F(x)}{h} =
    f(x) \]
\end{proof}

\begin{example*}
    \[ f(x) = \begin{cases}
        -1 & x \in [-1, 0] \\
        1 & x \in (0, 1]
    \end{cases} \]
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/da18b3f2b9eb11ec.png}
    \end{center}
    Since monotone, it's integrable. One can check
    that
    \[ F(x) = \begin{cases}
        -x - 1 & x \le 0 \\
        x - 1 & x > 0
    \end{cases}
    = -1 + |x| \]
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/125a40f0b9ec11ec.png}
    \end{center}
\end{example*}

\begin{corollary}[integration is the inverse of differentiation]
    If $f = g'$ is continuous on $[a, b]$, then
    \[ \int_a^x f(t) \dd t = g(x) - g(a) \qquad
    \forall\,\, x \in [a, b] \]
\end{corollary}

\begin{proof}
    From Theorem 5.8 $F - g$ has zero derivative
    in $[a, b]$. Hence $F - g$ is constant and
    since $F(a) = 0$ this implies that $F(x) =
    g(x) - g(a)$.
\end{proof}

\myskip
Every continuous has an \emph{indefinite integral}
or anti-derivative written $\int f(x) \dd x$ which
is determined up to a constant.

\begin{remark*}
    We have solved the ODE:
    \[ \begin{cases}
        y'(x) = f(x) \\
        y(a) = y_0
    \end{cases} \]
\end{remark*}
