% vim: tw=50
% 14/02/2022 11AM

\begin{theorem}[Mean Value Theorem]
    Let $f : [a, b] \to \RR$ be a continuous
    function which is differentiable on $(a, b)$.
    Then $\exists\,\,c \in (a, b)$ such that
    \[ f(b) - f(a) = f'(c)(b - a) \]
\end{theorem}

\begin{proof}
    Write
    \[ \phi(x) = f(x) - kx \]
    choose $k$ such that $\phi(a) = \phi(b)$.
    Hence $f(b) - bk = f(a) - ak$
    \[ \implies k = \frac{f(b) - f(a)}{b - a} \]
    By Rolle's theorem applied to $\phi$,
    $\exists\,\,c \in (a, b)$ such that $\phi'(c)
    = 0$, i.e. $f'(c) = k$.
\end{proof}

\begin{remark*}
    We will often write
    \[ f(a + h) = f(a) + hf'(a + \theta h) \]
    for $\theta \in (0, 1)$. (Note that $\theta =
    \theta(h)$!)
\end{remark*}

\begin{corollary}
    $f : [a, b] \to \RR$ continuous and
    differentiable on $(a, b)$.
    \begin{enumerate}[(i)]
        \item If $f'(x) > 0\,\,\forall\,\, x \in
            (a, b)$ then $f$ is strictly
            increasing. (i.e. if $b \ge y > x \ge
            a$, then $f(y) > f(x)$)
        \item If $f'(x) \ge 0\,\,\forall\,\, x \in
            (a, b)$ then $f$ is increasing (i.e.
            if $b \ge y > x \ge a$ then $f(y) \ge
            f(x)$)
        \item If $f'(x) = 0\,\,\forall\,\, x \in
            (a, b)$ then $f$ is constant on $[a,
            b]$.
    \end{enumerate}
\end{corollary}

\begin{proof}
    \begin{enumerate}[(i)]
        \item MVT
            \[ \implies f(y) - f(x) = f'(c)(y - x) \]
            \[ f'(c) > 0 \implies f(y) > f(x) \]
        \item Same but $f(c) \ge 0 \implies f(y)
            \ge f(x)$.
        \item Take $x \in [a, b]$. Then use the
            MVT in $[a, x]$ to get $c \in (a, x)$
            such that
            \[ f(x) - f(a) = f'(c)(x - a) = 0 \]
            \[ \implies f(x) = f(a) \]
            so $f$ is continuous.
    \end{enumerate}
\end{proof}

\subsubsection*{Inverse Rule / Inverse Function Theorem}

\begin{theorem}
    $f : [a, b] \to \RR$ continuous and
    differentiable on $(a, b)$ with $f'(x) > 0
    \,\,\forall\,\, x \in (a, b)$. \\
    Let $f(a) = c$ and $f(b) = d$. Then the
    function $f : [a, b] \to [c, d]$ is bijective
    and $f^{-1}$ is differentiable with
    \[ (f^{-1})'(x) = \frac{1}{f'(f^{-1}(x))} \]
\end{theorem}

\begin{proof}
    By Corollary 3.5, $f$ is strictly increasing
    on $[a, b]$. By Theorem 2.6 $\exists\,\, y :
    [c, d] \to [a, b]$ which is a continuous
    strictly increasing inverse of $f$. \\
    Need to prove that $g$ is differentiable and
    that
    \[ g'(y) = \frac{1}{f'(x)} \]
    where $y = f(x)$ and $x \in (a, b)$. If $k
    \neq 0$ is given, let $h$ be given by
    \[ y + k = f(x + h) \]
    That is, $g(y + k) = x + h$, $h \neq 0$. Then
    \[ \frac{g(y + k) - g(y)}{k} = \frac{x + h -
    x}{f(x + h) - f(x)} \]
    Let $k \to 0$, then $h \to 0$ (since $g$ is
    continuous), and then
    \[ g'(y) = \lim_{k \to 0} \frac{g(y + k) -
    g(y)}{k} = \frac{1}{f'(x)} .\]
\end{proof}

\begin{example*}
    $g(x) = x^{\frac{1}{q}}$ ($x > 0$, $q$ a positive
    integer).
    \[ f(x) = x^q, \qquad f'(x) = qx^{q - 1} \]
    $f$ is differentiable, then so is $g$ and by
    Theorem 3.6 (inverse rule)
    \[ g'(x) = \frac{1}{q(x^{\frac{1}{q}})^{q - 1}} =
    \frac{1}{q} x^{\frac{1}{q} - 1} \]
\end{example*}

\begin{remark*}
    If $g(x) = x^r$, $r \in \QQ$ then $g'(x) =
    rx^{r - 1}$ (check!)
\end{remark*}

\noindent
Suppose $f, g : [a, b] \to \RR$ continuous and
differentiable on $(a, b)$ and $g(a) \neq g(b)$,
then the MVT gives us $s, t \in (a, b)$ such that
\[ \frac{f(b) - f(a)}{g(b) - g(a)} = \frac{(b -
a)f'(s)}{(b - a)g'(t)} = \frac{f'(s)}{g'(t)} \]
Cauchy showed that we can take $s = t$.

\begin{theorem}[Cauchy's Mean Value Theorem]
    Let $f, g : [a, b] \to \RR$ be continuous and
    differentiable on $(a, b)$. Then $\exists\,\,
    t \in (a, b)$ such that
    \[ (f(b) - f(a))g'(t) = f'(t)(g(b) - g(a)) \]
\end{theorem}

\begin{note*}
    We recover the MVT if we take $g(x) = x$.
\end{note*}
