Can a function be differentiable at a jump discontinuity

calculusderivativeslimitsself-learning

I learnt in spivak's calculus that if a function is differentiable at a point then it is continuous at that point however I am confused about this function for example
$$
f(x)=\begin{cases}
-2x & x<4, \\
8 & x=4.
\end{cases}
$$

Is this function differentiable at $x=4$ since this point is an isolated point of the functions range the function is continuous at that point.
However why can we not calculate the derivative at $x=4$ the right hand limit need not exsist as the function is not even defined for values of x greater than 4 so why is the derivative not defined ?

Best Answer

The (one-sided) derivative at $4$ would be

$$ \lim_{x\to 4} \frac{f(x) - f(4)}{x-4} = \lim_{x\to 4} \frac{-2x - 8}{x-4} = \lim_{x\to 4}\left(-2- \frac{16}{x-4} \right)$$

which doesn't exist. So $f$ is not differentiable at $4$, nor is it continuous at $4$: $$\lim_{x\to 4} f(x) = -8 \neq f(4).$$

In order to define a meaningful notion of "the limit of $f(x)$ as $x$ approaches $a$" you need $a$ to be a limit/cluster point of the domain of $f$. So in particular if $a$ is an interior point then you can define the two-sided limit that you're used to. If $a$ isn't an interior point, but still a cluster point, then you can still talk about the limit as $x \to a$ but just be careful that some of the theorems you have seen might no longer apply if $a$ is not an interior point.

In this case, however, it is still true that if $f$ is differentiable at $a$ (with $a$ a cluster point) then $f$ is continuous at $a$.