23
$\begingroup$

Are continuous functions always differentiable? Are there any examples in dimension $n > 1$?

$\endgroup$
1
  • 46
    $\begingroup$ Think of $f(x)=\left\vert x\right\vert $. $\endgroup$ Oct 26 '10 at 15:15
43
$\begingroup$

No. Weierstraß gave in 1872 the first published example of a continuous function that's nowhere differentiable.

$\endgroup$
1
  • 57
    $\begingroup$ But using that example for this question is tantamount to using thermonuclear weapons to kill mosquitoes! $\endgroup$ Oct 26 '10 at 22:13
28
$\begingroup$

No, consider the example of $f(x) = |x|$. This function is continuous but not differentiable at $x = 0$.

There are even more bizare functions that are not differentiable everywhere, yet still continuous. This class of functions lead to the development of the study of fractals.

$\endgroup$
10
$\begingroup$

For a nice simple example of an everywhere continuous, nowhere differentiable function it's hard to beat this example of John McCarthy.

$\endgroup$
1
  • 7
    $\begingroup$ This is a nice example, and a nice exposition. It (the linked paper) also makes the point that (in some sense) most continuous functions are in fact non-differentiable. $\endgroup$
    – Matt E
    Oct 27 '10 at 4:58
8
$\begingroup$

This is my personal favorite example of intuition being catastrophically incorrect in real analysis.

In calculus, it is commonly taught that differentiable functions are always continuous, but also, all of the "common" continuous functions given, such as $f(x)=x^2$, $f(x)=e^x$, $f(x)=xsin(x)$ etc. are also differentiable. This leads to the false assumption that continuity also implies differentiability, at least in "most" cases.

The exception to this in early calculus courses is $f(x)=|x|$, which is continuous AND differentiable at every point except at $x=0$.

So it would appear that if functions are not differentiable, it can only happen at a finite number of points.

In real analysis, this concept of being differentiable everywhere except a finite number of points is formalized with the notion of "measure". A finite number of isolated, non-differentiable points adds up to a measure of $0$. The more precise way to comment on the differentiability of $f(x)=|x|$ is to say that it is continuous everywhere and differentiable almost everywhere. This means that the function $f(x)=|x|$ is differentiable in every subset of $\mathbb{R}$ except those subsets with measure 0, in particular, the singleton set ${x}=0$. Saying it is differentiable almost everywhere is advantageous to saying that $f(x)=|x|$ is not differentiable because it doesn't take into account how many points it is not differentiable at. A different function could be not differentiable at 3 points.

So it may seem reasonable that all continuous functions are differentiable a.e. (almost everywhere). This turns out to be completely false. In general, the set of continuous functions which are nowhere differentiable is dense in $C([0,1])$ (and for a general interval). Even stronger, the set of functions which are differentiable at even a single point is "meagre" in $C([0,1])$. This is is typically shown through proofs involving the Baire Category Theorem.

So this simply means that there are "way" more functions which can't be differentiated at any point than there are of functions which can be differentiated even at a single point (even if it is differentiable nowhere else!). This contradicts intuition but this is situation is a great example as to why proof is so vital to real analysis and mathematics in general. If a theorem holds in one direction, it should never be assumed the converse is true. There will likely be a counter example. In this particular situation, the counter-examples happen to be the general case.

$\endgroup$
2
  • 3
    $\begingroup$ I don't understand the downvote and the delete vote. Sure, this is an old question, and I even disagree that the intuition is contradicted, but this post does answer the question, and it also mentions things that others didn't, which certainly might be of interest to future readers. $\endgroup$
    – user21820
    Sep 16 '16 at 16:08
  • $\begingroup$ How would you go about showing that the set of functions that are differentiable at a single point is meagre in C([0,1])? Or is there some proof that you can link that demonstrates such a claim? $\endgroup$ Nov 22 '20 at 0:45
7
$\begingroup$

An interesting fact is that most (i.e. a co-meager set of) continuous functions are nowhere differentiable. The proof is a consequence of the Baire Category theorem and can be found (as an exercise) in Kechris' Classical Descriptive Set Theory or Royden's Real Analysis.

$\endgroup$
2
  • 3
    $\begingroup$ This holds also for other notions of most. Also, a more accessible reference might be "Measure and Category" by Oxtoby. $\endgroup$ May 16 '12 at 0:09
  • $\begingroup$ @MichaelGreinecker Very interesting. Thanks. $\endgroup$ May 16 '12 at 3:28
6
$\begingroup$

What these answers miss a little bit I think is the why of what's going on here. A mistake people make I think is assuming that continuous and 'smooth' (in a loose sense here not the technical meaning) are the same thing -- whereas in reality continuous functions just have the simple property that they have no 'jumps' in them or they don't change 'too much' while differentiable functions require the stronger property that functions change in a 'smooth' way i.e. no sharp corners etc. The absolute value function is instructive there, as is any fractal etc. These notions can of course be made much more precise, but the geometric intuition is in this case quite important so as not to get thoroughly stuck in believing that analysis is some form of magic.

$\endgroup$
2
$\begingroup$

The Wiener process is a continuous everwhere, but differentiable nowhere function (quite an impressive beast by the way...)

$\endgroup$
1
  • 3
    $\begingroup$ More precisely, the sample paths are continuous and with probability $1$ nowhere-differentiable. $\endgroup$ May 15 '12 at 23:52
2
$\begingroup$

Continuity requires

$$\lim_{h\to0}f(x+h)-f(x)=0.$$ Differentiability is stronger:

$$\lim_{h\to0}\frac{f(x+h)-f(x)}h$$ must exist.

Hence you can find counter-examples of the form

$$f(x)=x g(x)$$ where $$\lim_{x\to0}g(x)$$ does not exist.

E.g. $g(x)=\text{sgn}(x)$ or $g(x)=\sin\dfrac1x$ or $g(x)=|x|^{-1/2}$.

$\endgroup$
1
$\begingroup$

Consider $$ f(x)=x^{\frac{1}{3}}, x\in\mathbb{R}^{1} .$$ The derivative $$ f'(x)=\frac{1}{3}x^{-\frac{2}{3}}, x\in\mathbb{R}^{1}\backslash\{ 0 \} $$ does not exist at $ x=0 $ whereas $ f(x) $ is continuous on $ \mathbb{R}^{1} $.

$\endgroup$