# Why can a discontinuous function not be differentiable?

I don't really understand why a discontinuous function cannot be differentiable.

In Stewart's Calculus, the definition of a function $f$ being differentiable at $a$ is that $f'(a)$ exists. Earlier it gives the definition of the derivative as $f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$. It also has a theorem that if $f$ is differentiable at $a$, then $f$ is continuous at $a$. There is also a definition that a functions $f$ is continuous at a number $a$ if $\lim_{x\to a}f(x)=f(a)$.

Take for example the very simple function:

$$f(x)=\begin{cases} x+1 & x\geq0, \\ x & x<0. \end{cases}$$

It is discontinuous at $x=0$ (the limit $\lim_{x\to 0}f(x)$ does not exist and so does not equal $f(0)$), but if I find the derivative using the limit above, I get the left and right limits to equal $1$. So therefore, the derivative exists.

According to the book, the function shouldn't be differentiable at $x=0$ as it has a discontinuity (continuity is a necessary condition of differentiability). What am I doing/understanding wrong?

• The limit from the left would give you $$\lim\limits_{h\rightarrow0^-}{f(0+h)-f(0)\over h } =\lim\limits_{h\rightarrow0^-}{h -1\over h } =\infty.$$ Jun 9 '14 at 22:49
• Thank you @DavidMitra. I completely missed that. I don't think I can vote that as the answer since it's a comment. Jun 9 '14 at 23:11
• On a rough intuitive level, continuous means "looks connected as you zoom in", and differentiable means "looks like a line segment as you zoom in". It can't look like a line segment without looking connected. Mar 18 '16 at 12:44

Computing the derivative from the left gives you $$\lim\limits_{h\rightarrow0^-} {f(0+h)-f(0)\over h } =\lim\limits_{h\rightarrow0^-} {h-1\over h }=\infty.$$ (In particular, note $f(0)=1$, not $0$.)
You can also see the derivative from the left doesn't exist (as a real number) by considering slopes of secant lines. Note a secant line has one endpoint at the point $(0,1)$ and the other at a point $(h,h)$ with $h<0$. As $h$ tends to $0$, the slopes tend to $\infty$.
You are computing $\lim_{x\rightarrow 0_{\pm}}f'(x)$ rather than $$\lim_{h\rightarrow 0^\pm}\frac{f(0+h)-f(0)}{h}.$$