# What is an example of a function whose second derivative is continuous but not differentiable

I am looking for an example to help supplement my understanding of what a "smooth function" is. If possible could someone come up with an example with one variable and another where there are two variables?

-
How about integrating a continuous but not differential function two times! – Ehsan M. Kermani Mar 9 '12 at 5:58
– user17762 Mar 9 '12 at 6:05
Check out this post: math.stackexchange.com/q/113148/22405 The solution to your question is the same (and follows ehsanmo's suggestion), you just have to integrate twice instead of once. – Brett Frankel Mar 9 '12 at 6:09

It's very easy to come up with such functions. Suppose we have the function that is identically $0$ on all $\mathbb{R}$ except $[0,2]$, $1$ on $(0,1)$, and $2$ on $[1, 2)$. It's clearly integrable, and so is the integral of its integral.

But differentiating the integral of its integral would clearly give this very discontinuous function.

Or you could play with the example of functions like $f(x) = x^2 \sin(1/x)$, and $0$ at $0$ (which is differentiable, but not continuously differentiable at $0$).

-

Here's a very quick one-variable answer.

Let $$f(x) = \frac{1}{6} x^{3} \textrm{sgn}(x).$$

You can see a plot of it on WolframAlpha.

Then $$f'(x) = \frac{1}{2} x^{2} \textrm{sgn}(x)$$ and $$f''(x) = |x|.$$

The second derivative is continuous, but not differentiable. The function $\textrm{sgn}(x)$ is $+1$ when $x$ is positive and $-1$ when $x$ is negative.

-
In other words $f(x)=\frac16|x|^3$. – Did Mar 10 '12 at 20:07
Yeah, I guess that is a better way of writing it. – in_wolfram_we_trust Mar 12 '12 at 5:07