# Give an example, with proof, of a function differentiable at a point, whose derivative is non-differentiable that point.

This question was labeled as either prove or disprove. I think that this is impossible, here is my reasoning:

Any function $$f(x)$$ with asymptotic behavior at some point $$x=a$$ will hold this asymptotic behavior in the function $$F(x)=\int f(x) \, dx$$. We have not yet covered any technical terms with integration, only differentiation.

Help greatly appreciated!

The absolute value function is continuous so has an antiderivative. The antiderivative is differentiable at 0, but its derivative (the absolute value function) is not.

One of the simplest is $$f(x) = \begin{cases} \phantom{+}x^2 & \text{if } x\ge0, \\ -x^2 & \text{if } x<0. \end{cases}$$

The derivative is $$f'(x) = \begin{cases} \phantom{-} 2x & \text{if } x>0, \\ -2x & \text{if } x<0, \\ \text{what?} & \text{if } x=0. \end{cases}$$

At $$x=0$$ one can compute $$\displaystyle f'(x)= \lim_{h\to0} \frac{f(x+h) - f(x)} h = \lim_{h\to0} \frac{\pm h^2 - 0} h =0.$$

• The derivative can also be rewritten more recognisably as $f'(x) = 2|x|$. The fact that this isn’t differentiable at 0 is then a commonly given early example of non-differentiability. Apr 8, 2020 at 13:59

Hint:

Consider the function

$$f(x) = \begin{cases} x^3\sin\left(\frac{1}{x}\right), & \text{ if } x \neq 0 \\ 0, & \text{ if } x = 0 \end{cases} \tag{1}\label{eq1A}$$

at $$x = 0$$.

• More precisely, something like $x^3 \sin(1/x)$ if $x \neq 0$, and $0$ if $x=0$, right? That function is undefined at $x=0$. Apr 8, 2020 at 4:17
• Might as well take $x^2\sin(1/x)$ also Apr 8, 2020 at 4:18
• @DavidLui Thanks for the feedback. You're right. I've made that change. Apr 8, 2020 at 4:21
• @ElliotG I see that saulspatz has used your suggestion in an answer. I realize now I was considering something else, so your idea is valid. As such, I've deleted my previous $2$ comments. Also, thanks again for the feedback. Apr 8, 2020 at 4:33
• It's a still a worthwhile example because you can modify it to get 1) $f$ not continuous, 2) $f$ continuous but not differentiable, 3) $f$ differentiable but $f'$ not continuous, 4) $f$ differentiable and $f'$ continuous but not differentiable, or 5) $f$ and $f'$ both differentiable. Apr 8, 2020 at 4:36

Consider $$f(x)=\cases{x^2\sin\left(\frac1x\right),&x\neq0\\0,&x=0}$$

We have $$f'(0)=\lim_{x\to0}\frac{x^2\sin\left(\frac1x\right)-0}{x-0}=\lim_{x\to0}x\sin\left(\frac1x\right)=0$$

For $$x\neq0$$, we have $$f'(x)=2x\sin\left(\frac1x\right)-\cos\left(\frac1x\right)$$ which is not continuous at $$x=0$$, let alone differentiable.

• isn’t $\lim_{x\to0} x\sin(1/x)=1$ Apr 8, 2020 at 4:33
• @drfrankie No, you're thinking of $\frac{\sin x}{x}$. We have $x\to0$ and $|\sin(1/x)|\leq1$ Apr 8, 2020 at 4:35
• ah yes that’s what I was thinking of Apr 8, 2020 at 4:37

A general class of examples for our time is splines. Let $$f(x)$$ be a cubic spline with a knot at $$x_0$$. Then $$f$$ is continuous with a derivative at $$x_0$$, its derivative $$f'$$ likewise, but $$f''$$ is not differentiable at $$x_0$$. See https://en.wikipedia.org/wiki/Spline_(mathematics)