[Math] How is this function not differentiable everywhere

calculus

Let$$f(x) =
\begin{cases}
0 & \text{for $x$ < 0,} \\
\frac{x}{1+x} & \text{for 0 $\leq$ $x$. } \\
\end{cases}$$The function $f$ is continuous over the entire real line and is differentiable everywhere except at $x=0$.

How did we get to know that $f$ is not differentiable at $x=0$ ?

In General: If any function $f$ is differentiable at $x=x_0$, should it hold true that derivative of $f$ with respect to $x$, that is $f'$, is continuous at $x=x_0$ ?

Best Answer

It it was differentiable at $0$, then it would be true that: $$ \lim_{x \to 0+} \frac{f(x)}{x} = \lim_{x \to 0-} \frac{f(x)}{x} = f'(0).$$ Above, the $x\to 0+$ means that we take the limit over the positive values of $x$, and likewise for $x \to 0-$.

Now, these two limits are easy to compute, and unfortunately are different. First, you have: $$ \lim_{x \to 0-} \frac{f(x)}{x} = 0.$$ Secondly, you get with a little more work: $$ \lim_{x \to 0+} \frac{f(x)}{x} = \lim_{x \to 0+} \frac{1}{1+x} = 1.$$ Now, these two values obviously can't be both equal to $f'(x)$. Thus, $f$ is not differentiable at $0$.


As for the latter part: NO, the derivative does not automatically have to be continuous. There is a Wikipedia article that you will surely find relevant. For example, the function $f$ given below is differentiable, but the derivative $f'$ is not continuous at $0$: $$ f(x) = \begin{cases} x^2 \sin \frac{1}{x} \quad& x > 0\\ 0 \quad& x \leq 0 \end{cases}$$ The trick is that the term $x^2$ assures that $f$ goes to $0$ fast enough to have derivative $0$ at $0$, but the term $\sin \frac{1}{x}$ assures that close to $0$ the function has a large slope.

On the other hand, the derivative always has the mean value property, which is known as Darboux Theorem.