###### Definition 10.1.1 Differentiability

A function \(f\) is differentiable at \(a\) if \(f'(a)\) exists, or more precisely the limit

exists.

\(\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\)

A function is differentiable at points where the derivative is defined. Alternatively, because the derivative at a point represents the slope of the tangent line, we say the function is differentiable at a point wherever the function has a well-defined tangent line.

A function \(f\) is differentiable at \(a\) if \(f'(a)\) exists, or more precisely the limit

\begin{equation*}
\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{x \to a} \frac{f(x)-f(a)}{x-a}
\end{equation*}

exists.

A function is not differentiable if the limit does not exist. There are several reasons this might occur. The first reason is if the function is not continuous.

If \(f\) is differentiable at \(a\text{,}\) then \(f\) must be continuous at \(a\text{.}\) Equivalently, if \(f\) is not continuous, then \(f\) must not be differentiable.

Suppose that \(f\) is differentiable at \(a\text{.}\) This means that \(f'(a)\) is a value defined by

\begin{equation*}
\lim_{x \to a}\frac{f(x)-f(a)}{x-a} = f'(a).
\end{equation*}

We also know that

\begin{equation*}
\lim_{x \to a}[x-a] = a-a = 0.
\end{equation*}

Using the product rule (LC:Product), this implies

\begin{equation*}
\lim_{x \to a} [f(x)-f(a)] = \lim_{x \to a} \frac{f(x)-f(a)}{x-a} \cdot (x-a) = f'(a) \cdot 0 = 0.
\end{equation*}

Because \(\displaystyle \lim_{x \to a} f(a) = f(a)\) (LE:Constant), we know that

\begin{equation*}
\lim_{x \to a} f(x) = \lim_{x \to a} [f(x)-f(a) + f(a)] = 0 + f(a) = f(a)
\end{equation*}

using the sum rule (LC:Sum). Therefore, \(f\) is continuous at \(a\text{.}\)

Another way that a function might not have be differentiable is where it is continuous but has a corner. This means that the slope at the point looks different from either of the two sides. Mathematically, if we computed the one-sided limits for the formula of the derivative, we would get two different values.

Consider the piecewise function defined by

\begin{equation*}
f(x) = \begin{cases} x^2, & x \le 1, \\ x, & x \gt 1.\end{cases}
\end{equation*}

Determine if \(f\) is differentiable at \(x=1\text{.}\)

Solution

This function is continuous because the limit on the left and the limit on the right are equal to the value of the function at \(x=1\text{,}\) as follows:

\begin{align*}
\lim_{x \to 1^-}f(x) &= \lim_{x \to 1}x^2 = 1^2 = 1,\\
\lim_{x \to 1^+}f(x) &= \lim_{x \to 1}x = 1 = 1,\\
f(1) &= 1^2 = 1.
\end{align*}

Now that we know the function is continuous, we can think about the functions to the left and right, \(f_\ell(x)=x^2\) and \(f_r(x)=x\text{,}\) respectively. Because \(f_\ell'(x)=2x\text{,}\) we know that

\begin{equation*}
\lim_{h \to 0^-} \frac{f(1+h)-f(1)}{h} = f_\ell'(1) = 2.
\end{equation*}

Similarly, because \(f_r'(x)=1\text{,}\) we know that

\begin{equation*}
\lim_{h \to 0^+} \frac{f(1+h)-f(1)}{h} = f_r'(1)=1.
\end{equation*}

Since the left and right limits are different, we conclude that \(\displaystyle \lim_{h \to 0}\frac{f(1+h)-f(1)}{h}\) does not exist and \(f\) is not differentiable at \(x=1\text{.}\) The figure below illustrates this graph, showing that there is a corner at \(x=1\text{.}\)

Consider the piecewise function defined by

\begin{equation*}
f(x) = \begin{cases} x^2-3x+8 & x \lt 2, \\ 5x-x^2, & x \ge 2.\end{cases}
\end{equation*}

Determine if \(f\) is differentiable at \(x=2\text{.}\)

Solution

This function is continuous because the limit on the left and the limit on the right are equal to the value of the function at \(x=2\text{,}\) as follows:

\begin{align*}
\lim_{x \to 2^-}f(x) &= \lim_{x \to 2}(x^2-3x+8) = 2^2-3(2)+8 = 6,\\
\lim_{x \to 2^+}f(x) &= \lim_{x \to 2}(5x-x^2) = 5(2)-2^2 = 6,\\
f(2) &= 5(2)-2^2 = 6.
\end{align*}

Now that we know the function is continuous, we can think about the functions to the left and right, \(f_\ell(x)=x^2-3x+8\) and \(f_r(x)=5x-x^2\text{,}\) respectively. Because \(f_\ell'(x)=2x-3\text{,}\) we know that

\begin{equation*}
\lim_{h \to 0^-} \frac{f(2+h)-f(2)}{h} = f_\ell'(2) = 2(2)-3=1.
\end{equation*}

Similarly, because \(f_r'(x)=5-2x\text{,}\) we know that

\begin{equation*}
\lim_{h \to 0^+} \frac{f(2+h)-f(2)}{h} = f_r'(2)=5-2(2)=1.
\end{equation*}

Since the left and right limits are the same, we conclude that \(\displaystyle \lim_{h \to 0}\frac{f(2+h)-f(2)}{h} = 1\) and \(f'(2)=1\text{.}\) So \(f\) is differentiable at \(x=2\text{.}\) The graph of this function has the two parabolas join smoothly with no corner at \(x=2\text{.}\)

There are a number of important consequences of a function being differentiable. These consequences are stated as mathematical theorems that you will need to know by name. We begin by introducing terminology about local extreme values.

A function \(f\) has a local maximum at a point \(x=a\) if \(f(a) \ge f(x)\) for all \(x\) in a neighborhood of \(a\text{.}\) It has a local minimum at \(x=a\) if \(f(a) \le f(x)\) for all \(x\) in a neighborhood of \(a\text{.}\)

The first theorem is about the slope at a local extreme. It guarantees that a local extreme can only occur where the function either is not differentiable or has a horizontal tangent line.

If \(f\) has a local extreme at \(x=a\) and \(f'(a)\) exists, then \(f'(a)=0\text{.}\)

The second theorem combines the Extreme Value Theorem with Fermat's Theorem. If a function is continuous on a closed interval \([a,b]\text{,}\) then it must achieve both a maximum and a minimum value. If that function has \(f(a)=f(b)\text{,}\) then one of the extreme values must occur inside the interval at some point \(c \in (a,b)\text{.}\) If the function is also differentiable, then we must have \(f'(c)=0\text{.}\) This result is named Rolle's theorem.

If \(f\) is continuous on \([a,b]\) and differentiable on \((a,b)\) and \(f(a)=f(b)\text{,}\) then there must be some value \(c \in (a,b)\) so that \(f'(c)=0\text{.}\)

The consequence of Rolle's theorem is that if a function starts and ends at the same value over an interval, it must turn around somewhere. For a differentiable function, the slope at that point must be \(f'(c)=0\text{.}\)

The third theorem about differentiability applies Rolle's theorem to say something about the average rate of change. Recall that the average rate of change,

\begin{equation*}
\left.\frac{\Delta f}{\Delta x}\right|_{[a,b]} = \frac{f(b)-f(a)}{b-a},
\end{equation*}

is the slope of the line, called a secant line, that joins the points \((a,f(a))\) and \((b,f(b))\text{.}\) The Mean Value Theorem guarantees that a continuous and differentiable function will have some point at which the tangent line has the same slope as the secant line over the interval.

If \(f\) is continuous on \([a,b]\) and differentiable on \((a,b)\text{,}\) then there must be some value \(c \in (a,b)\) so that

\begin{equation*}
f'(c)=\frac{f(b)-f(a)}{b-a}.
\end{equation*}

Alternatively, we sometimes rewrite this as

\begin{equation*}
f(b)-f(a)=f'(c) \cdot (b-a).
\end{equation*}

Let \(s(x)\) be the linear function corresponding to this secant line and then define \(g(x)=f(x)-s(x)\text{.}\) Since \(s(a)=f(a)\) and \(s(b)=f(b)\text{,}\) we have \(g(a)=g(b)=0\text{.}\) If \(f\) is continuous and differentiable, then so is \(g\text{.}\) Rolle's theorem guarantees that \(g'(c)=f'(c)-s'(c) = 0\) for some value \(c \in (a,b)\text{.}\) Thus, \(f'(c)=\left.\frac{\Delta f}{\Delta x}\right|_{[a,b]}\text{.}\)