# Everywhere continuous and differentiable $f : \mathbb{R} → \mathbb{R}$ that is not smooth?

I can't seem to find any counterexamples to the statement "all functions that are continuous and differentiable at every point of the reals are smooth," nor can I find anyone asserting or proving this statement. Are there known functions that are continuous and differentiable at every point (with no holes / discontinuities / bounded domain) but are not smooth, that is, after some number of derivatives the derivative function is no longer fully differentiable?

• Forgot to specify that I am talking about real functions only, if that wasn't clear - complex functions that are discontinuous off the real axis are not interesting counterexamples! – jmarvin_ Mar 24 at 15:04
• What do you mean by "smooth" --- continuous derivative or infinitely differentiable (or something else)? FYI, both uses of "smooth" occur quite often here, and nearly always without the questioner saying what "smooth" means until asked. – Dave L. Renfro Mar 24 at 15:46
• Dave: infinitely differentiable was the one I was using, since that's the limit of "smoothness" and thus what I thought was the unequivocal meaning of "smooth" (I specified this in the question at the end - it is "not smooth" if it is no longer totally differentiable after some derivative) – jmarvin_ Mar 24 at 18:07
• Actually, when I saw the part about totally differentiable, I thought you were talking about this, although I did wonder why you used the term in a non-multivariable setting (but not enough to think carefully about what you might have intended, since your question already had several answers). Incidentally, this answer might be of interest. – Dave L. Renfro Mar 24 at 18:37
• Ah, yes, I was using the word "totally" as a non-technical synonym for "completely." My bad - it's been years since I took multivariable calc. – jmarvin_ Mar 25 at 19:03

Sure. Take, for instance$$f(x)=\begin{cases}x^2&\text{ if }x\geqslant0\\-x^2&\text{ otherwise.}\end{cases}$$

• Thanks - I wasn't thinking about just composing a piecewise function like this. – jmarvin_ Mar 24 at 18:18
• I'm glad I could help. – José Carlos Santos Mar 24 at 18:21

An example is

$$f(x) = \begin{cases}0 & \text{for } x<0\\x^2 & \text{for } x\geq 0 \end{cases}.$$

It is clear that the function is continuous and differentiable for all $$x\in \mathbb{R}$$. But $$f'(x)$$ is not differentiable at $$x=0$$.

• @TomislavOstojich I think you didn't notice the prime. I said that $f(x)$ differentiable. And $f'(x)$ (the derivative of f(x)$is not differentiable. – MachineLearner Mar 24 at 15:27 • @TomislavOstojich No contradiction..$f$differentiable always, but$f'$(not$f\$) isn't always. – coffeemath Mar 24 at 15:27

Let $$W$$ be the continuous, nowhere differentiable Weierstrass function. Then $$f(x)=\int_0^x W(t)\,dt$$ is continuously differentiable on $$\mathbb R,$$ but $$f''(x)$$ fails to exist for every $$x.$$

• This is an interesting answer, probably the most extreme one easily available. Thanks! – jmarvin_ Mar 24 at 18:19