\section{Differentiation}

\begin{definition*}
  If $U\included\R$, and $c$ is an interior point of $U$, then a
  function $f:U\to \R$ is \defn{differentiable at $c$}, with
  \defn{derivative} $f'(c)$ at $c$, if the limit
$$\lim_{x\to c}\frac{f(x)-f(c)}{x-c}$$
exists and is $f'(c)$.
\end{definition*}

\begin{lemma*}
  With notation as in the definition, $f$ is differentiable at $c$ if
  and only if, for some $d$, the function 
$$x\longmapsto
  \begin{cases}
    \displaystyle\frac{f(x)-f(c)}{x-c},& \text{ if }x\in U\setminus\{c\};\\
d,&\text{ if }x=c
  \end{cases}$$
is continuous at $c$; in this case, $d=f'(c)$.
\end{lemma*}

\begin{proof}
  Obvious.
\end{proof}

The function of the lemma can be called $f^*_c$.  [I did not use this
  notation fully in class.]

\begin{theorem*}
  Differentiability implies continuity.
\end{theorem*}

\begin{proof}
  Say $f$ is differentiable at $c$.  Then $f^*_c$ is continuous at
  $c$, hence so is 
$$x\mapsto(x-c)f^*_c(x)+f(c),$$
which is $f$.
\end{proof}

\begin{theorem*}
  The class of functions differentiable at a point is closed under
  addition, additive inversion and multiplication.  Moreover,
  \begin{itemize}
    \item
$(-f)'(c)=-f'(c)$,
\item
$f+g)'(c)=f'(c)+g'(c)$,
\item
$(fg)'(c)=f'(c)g(c)+f(c)g'(c)$.
  \end{itemize}
The class of functions differentiable and non-zero at a point is
closed under multiplicative inversion, and 
$$\left(\frac 1f\right)'(c)=\frac{-f'(c)}{f(c)^2}.$$
Hence also
$$\left(\frac fg\right)'(c)=\frac{f'(c)g(c)-f(c)g'(c)}{g(c)^2}.$$
Constant functions have derivative $0$, and the identity-function
$x\mapsto x$ has derivative $1$ (everywhere).  Hence all polynomial
functions have derivatives (everywhere), and rational functions have
derivatives where they are defined.
\end{theorem*}

\begin{exercise}
  Prove the theorem.
\end{exercise}

\begin{theorem*}[Chain Rule]
  Differentiability is preserved under composition.  If $f$ is
  differentiable at $c$, and $g$ is differentiable at $f(c)$, then
  $g\circ f$ is differentiable at $c$, and
$$(g\circ f)'(c)=g'(f(c))\cdot f'(c).$$
\end{theorem*}

\begin{proof}
  The function $x\mapsto g_{f(c)}^*(f(x))\cdot f_c^*(x)$ is continuous
  at $c$; but this function is $(g\circ f)_c^*$ and has value
  $g'(f(c))\cdot f'(c)$ at $c$.
\end{proof}

\begin{exercise}
  Supply the details of the proof.
\end{exercise}

If $f$ is invertible, and $(f\inv)'(f(c))$ exists, then it is
$1/f'(c)$.  Why?  Apply the Chain Rule to $f\inv\circ f$ or $f\circ
f\inv$. 

\begin{exercise}
  If $f$ is continuous and invertible on an interval 
$I$, then $f\inv$ is continuous on $f(I)$.
\end{exercise}

\begin{theorem*}
  If $f$ is continuous and invertible on an open interval $I$, and $f'(c)$
  is defined and
  non-zero for some $c$ in $I$, then $f\inv$ is differentiable at $f(c)$.
\end{theorem*}

\begin{proof}
  In this case, $1/f_c^*$ is continuous at $c$, hence $1/f_c^*\circ
  f\inv$ is continuous at $f(c)$; but the latter function is
  $(f\inv)_{f(c)}^*$. 
\end{proof}

There are invertible functions $f$ with non-zero derivative at $c$
such that $f\inv$ is not differentiable at $f(c)$.  By the theorem,
such functions must not be continuous on any neighborhood of $c$.


