[Math] A Continuous Nowhere-Differentiable Function

real-analysis

The book Understanding Analysis by Stephen Abbott asserts that

$$
g(x)=\sum_{n=0}^{\infty}\frac{1}{2^n}h(2^nx),
$$

where $h(x)=\left|x\right|$, $h:\left[-1,1\right]\to\mathbb{R}$, and $h(x+2)=h(x)$, is continuous on all of $\mathbb{R}$ but fails to be differentiable at any point.

However, if I am not mistaken, can the $2^n$'s be cancelled out in $g$? I tried plotting this and could not obtain a nowhere-differentiable function.

Best Answer

The plot looks like this. It's hard to tell by a casual look that this is nowhere differentiable.

enter image description here

For a better view of what's going on, here's an animation that zooms into the graph. You can see that the picture looks similar at different length scales. A differentiable curve, on the other hand, would look more and more like a straight line as you zoomed in. enter image description here

EDIT: I plotted this in Maple. I don't have the code any more, but it might have been something like this.

h:= x -> abs(x - 2*round(x/2)):
g:= unapply(add(1/2^n*h(2^n*x), n=0..1000),x):
x0:= 0.23456: y0:= evalf(g(x0)): r:= 1.13:
for i from 0 to 99 do
  frame[i]:= plot(r^i*(g(x/r^i + x0) - y0), x=-1..1, axes=none, 
      title = sprintf("Zoom factor %7.1f",r^i))
od:
plots[display]([seq(frame[i],i=0..99)],insequence=true);
Related Question