##### Definition6.2.1Differentiability

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 *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\), then \(f\) must be continuous at \(a\). Equivalently, if \(f\) is not continuous, then \(f\) must not be differentiable.

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\).

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\).

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\). It has a *local minimum* at \(x=a\) if \(f(a) \le f(x)\) for all \(x\) in a neighborhood of \(a\).

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\).

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

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

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\).

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))\). 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)\), 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*}