Continuous, Nowhere Differentiable Functions

1. Construction of Weierstrass-type Nowhere Differentiable Functions

We will restrict attention to functions of the form
\[ f(x) := \sum_{n=0}^\infty a^n \cos (2\pi b^n x) \]
For some positive real numbers \(a\) and \(b\).
Theorem
If \(f\) is as defined above, \(ab > 1 + \frac{\pi}{2}\), \(a \in (0,1)\), and \(b\) is an integer multiple of \(4\), then \(f\) is a continuous function on \({\mathbb R}\) which is not differentiable at any point.
Highlight
The following plot shows the function
\[ f(x) := \sum_{n=0}^\infty \left( \frac{2}{3} \right)^n \cos (2 \pi 4^n x). \]
Figure. Image: Plot of a Weierstrass nowhere differentiable function

The argument below establishes that it is continuous and nowhere differentiable.
Important
Don't read too much into the hypotheses on \(a\) and \(b\) (e.g., that \(b\) is a multiple of 4). These have been included to simplify the proof but can be relaxed in various ways at the cost of a more involved proof.
Meta (Strategy of Proof)
First note that the Weierstrass \(M\)-test implies continuity of \(f\) whenever \(a \in (0,1)\). The proof shows directly that the difference quotient
\[ \frac{f(x+h) - f(x)}{h}\]
does not have a limit as \(h \rightarrow 0\) at any point \(x\).
  1. It is useful to restrict attention to the case when \(h = \pm b^{-N}/4\) for positive integers \(N\). Because of the periodicity of cosine, when we substitute the series definition of \(f\) into the difference quotient, all the terms \(n > N\) cancel and we are left with only a finite sum.
  2. The \(n = N\) term turns out to be the most significant one. The proof involves showing that the difference quotient of this specific term is large.
  3. The remaining terms are treated like error terms and the proof establishes an upper bound for the size of their difference quotients (by comparing to a geometric series.
  4. The criterion \(ab > 1 + \frac{\pi}{2}\) will allow us to show that the main term is so large that even when the other terms are included in the sum, the difference quotient must be large and have unbounded magnitude as \(N \rightarrow \infty\).
Proof Step 1: Writing the Difference Quotient
\[{}4 b^N{}\]
\[{}\left[ f\left(x \pm \frac{1}{4} b^{-N} \right) - f(x) \right] = {}\]
\[{}4 b^N \sum_{n=0}^{N} a^n \Bigg[ \cos 2 \pi \left(b^n x \pm \frac{1}{4} b^{n-N} \right){}\]
\[{}- \cos (2 \pi b^n x ) \Bigg]. {}\]
The left-hand side is the difference quotient at \(x\) with \(h = \pm \frac{1}{4}b^{-N}\). The series is finite because
\[ \cos 2 \pi \left(b^n x \pm \frac{1}{4} b^{n-N} \right) = \cos (2 \pi b^n x ) \]
when \(n > N\) by virtue of the fact that \(b^{n-N}/4\) is an integer and \(\cos 2 \pi \theta\) is \(1\)-periodic.

Proof Step 2: Analysis of the Leading Term
First we compute the term \(n = N\). It is
\[ 4 (ab)^N \left[ \cos \left(2 \pi b^N x \pm \frac{\pi}{2}\right) - \cos \left(2 \pi b^N x \right) \right]. \]
For at least one choice of sign, the magnitude of this difference is greater than or equal to \(4 (ab)^N\), thanks to the following lemma.
Lemma
For any real number \(u\), at least one of the two quantities
\[ \cos \left(u + \frac{\pi}{2}\right) - \cos u = - \sin u - \cos u \]
\[ \cos \left(u - \frac{\pi}{2}\right) - \cos u = \sin u - \cos u \]
has absolute value greater than or equal to \(1\).
Proof
Meta (Main Idea)
Square each quantity and add the results. Mixed terms cancel, and the result is that the sum of squares must equal \(2\). This would not be possible if both numbers were less than one in magnitude.
Proof Step 3: Bounding the Remaining Terms
By the Mean Value Theorem (and because \(ab > 1\)),
\[ \left| \cos 2 \pi \left(b^n x \pm \frac{1}{4} b^{n-N} \right) - \cos (2 \pi b^n x ) \right|\]
is at most \(\pi b^{n-N}/2\).
\[{}\Bigg| 4 b^N \sum_{n=0}^{N-1} a^n \Big[ \cos 2 \pi \Big(b^n x \pm \frac{1}{4} b^{n-N} \Big){}\]
\[{}- \cos (2 \pi b^n x ) \Big] \Bigg|{}\]
\[{}\leq 4 b^N \sum_{n=0}^{N-1} a^n \frac{b^{n-N} \pi}{2}{}\]
\[{}\leq 2 \pi \frac{(ab)^{N-1}}{1 - (ab)^{-1}} = 2 \pi \frac{(ab)^N}{ab-1}.{}\]
Proof Step 4: Conclusion Combining the lower bound for the main term and the upper bound for the sum of remaining terms gives that every \(N\) admits a choice of \(h_N = \pm b^{-N}/4\) such that
\[{}\left| \frac{f(x+h_N)-f(x)}{h_N} \right|{}\]
\[{}\geq 4 (ab)^N - 2 \pi \frac{(ab)^N}{ab-1}{}\]
\[{} = 4 (ab)^N \left[1 - \frac{\pi}{2(ab-1)} \right].{}\]
Because \(ab > 1 + \frac{\pi}{2}\), the quantity in brackets on the right-hand side is strictly positive. As \(N \rightarrow \infty\), \(h_N \rightarrow 0\) but \(4 (ab)^N \left[1 - \frac{\pi}{2(ab-1)} \right] \rightarrow \infty\), so the sequential characterization of limits implies that the limit of the difference quotient as \(h \rightarrow 0\) does not exist.

2. A Refined Argument

To improve the result, some cleverness is necessary to reduce to a situation in which the leading term is actually the only term which contributes to the estimate. This can be accomplished by looking at averages of the difference quotient rather than evaluating it on a subsequence. We'll specifically look at convolutions. Fix a real-valued \(C^3\) function \(\eta\) which is nonnegative, equals \(0\) outside \((-1,1)\), is bounded above by \(1\), and equals \(1\) at \(0\). For each \(N\), we'll consider the function
\[{}\psi_N(x) := \sum_{|n| \leq N-1} \eta\left(\frac{n}{N} \right) e^{2 \pi i n x}.{}\]
Based on the criteria by which we chose \(\eta\), the triangle inequality gives that
\[{}|\psi_N(x)| \leq 2N-1{}\]
for all \(x\) and each natural number \(N\). We'll also need to see that \(\psi_n\) is highly concentrated near the integers. To see this, note that
\[{}(e^{2 \pi i x} - 1) \sum_{n=-N+1}^{N-1} a_n e^{2 \pi i n x}{}\]
\[{}= \sum_{n=-N+1}^{N} (a_{n-1} - a_n) e^{2 \pi i n x}{}\]
(if we defined \(a_{-N} = 0\)) and
\[{}(e^{2 \pi i x} - 1)^2 \sum_{n=-N+1}^{N-1} a_n e^{2 \pi i n x}{}\]
\[{}= \sum_{n=-N+1}^{N+1} (a_{n-2} + 2 a_{n-1} + a_n) e^{2 \pi i n x}{}\]
(if we defined \(a_{-N-1} = 0\) as well).
Then
\[{}\left| (e^{2 \pi i x}-1) \psi_N(x) \right|{}\]
\[{}= \sum_{n=-N+1}^N \left| \eta \left(\frac{n-1}{N} \right) - \eta \left( \frac{n}{N} \right) \right|. {}\]
Each term can be estimated using the Mean Value Theorem, and the conclusion is that
\[{}\left| (e^{2 \pi i x}-1) \psi_N(x) \right|{}\]
\[{}\leq 2N \max_{n=-N+1\ldots,N} \left| \eta \left(\frac{n-1}{N} \right) - \eta \left( \frac{n}{N} \right) \right|{}\]
\[{}\leq 2 \sup_{\xi} |\eta'(\xi)|.{}\]
Similarly
\[{}\left| (e^{2 \pi i x}-1)^2 \psi_N(x) \right|{}\]
\[{}\leq (2N+1) \frac{\sup_{\xi} |\eta''(\xi)|}{N^2}{}\]
and
\[{}\left| (e^{2 \pi i x}-1)^3 \psi_N(x) \right|{}\]
\[{}\leq (2N+2) \frac{\sup_{\xi} |\eta'''(\xi)|}{N^3}.{}\]
Using these estimates, we can establish that there is some constant \(C\) independent of \(N\) such that
\[ |(e^{2 \pi i x}-1) \psi_N(x)| \leq \frac{C N}{1 + |N x|^2}\]
for all \(N \geq 1\) and all \(x \in [-1/2,1/2]\). (The idea is to use the lower bound \(|e^{2 \pi i x}-1| \geq c |x|^2\) and prove the inequality first for \(|x| \leq 1/N\) and then for \(1/N < |x| \leq 1/2\).)
Now consider the convolution of a function \(f\) with \(e^{2 \pi i k x} \psi_{N}(x)\). Convolutions have the effect of multiplying Fourier coefficients, so
\[{}f * (e^{2 \pi i k \cdot} \psi_N)(x){}\]
\[{}= \sum_{n=k-N+1}^{n+N-1} \hat{f}(n) \eta\left(\frac{n-k}{N} \right) e^{2 \pi i n x}.{}\]
If \(N\) is chosen so that \(\hat{f}(n) = 0\) when \(0 < |k-n| < N\), then the convolution will consist of only a single term:
\[{}f * (e^{2 \pi i k \cdot} \psi_N)(x){}\]
\[{}= \hat f(k) e^{2 \pi i k x}.{}\]
On the other hand,
\[{}f * (e^{2 \pi i k \cdot} \psi_N)(x){}\]
\[{}= \int_{-\frac{1}{2}}^{\frac{1}{2}} f(x-y) e^{2 \pi i k y} \psi_N(y) dy{}\]
If \(f\) is differentiable at \(x\), then
\[{}f(x-y) = f(x) - y f'(x) + o(y){}\]
as \(y \rightarrow 0\). Moreover, \(y - (e^{2 \pi i y}-1)/{2 \pi i} = o(y)\) as \(y \rightarrow 0^+\). Therefore
\[{}f * (e^{2 \pi i k \cdot} \psi_N)(x){}\]
\[{}= f(x) \int_{-\frac{1}{2}}^{\frac{1}{2}} e^{2 \pi i k y} \psi_N(y) dy {}\]
\[{}+ \frac{f'(x)}{2 \pi i} \int_{-\frac{1}{2}}^{\frac{1}{2}} (e^{2 \pi i y} - 1)e^{2 \pi i k y} \psi_N(y) dy {}\]
\[{}+ \int_{-\frac{1}{2}}^{\frac{1}{2}} o(y) e^{2 \pi i ky} \psi_N(y) dy.{}\]
The first two integrals happen to be identically zero when \(k \geq N\) (since we know that the zeroth Fourier coefficient of the function being integrated is zero). By using our usual approximate identity arguments, we can see that the last integral will be \(o(N^{-1})\) as \(N \rightarrow \infty\). When we put all the pieces together (namely, this estimate for the magnitude of the convolution and the fact that we know the convolution consists of a single term), we have established the following:
Lemma
Suppose \(\{n_k\}_{k=1}^\infty\) is a strictly increasing sequence of positive integers. For each \(k\), let \(N_k := \min\{|n_k - n_{k-1}|,|n_k-n_{k+1}|\}\). If \(f\) is a function for which \(\hat f(n) = 0\) whenever \(n\) is positive and not equal to \(n_k\) for some \(k\), then \(f\) being differentiable at any point \(x\) implies that \(|\hat f(n_k)| = o(N_k^{-1})\) as \(k \rightarrow \infty\).
Corollary
If \(a \in (0,1)\), \(b \in \mathbb{N}\), and \(ab \geq 1\), then
\[ \sum_{n=0}^\infty a^n \cos (2 \pi b^n x) \]
and
\[ \sum_{n=0}^\infty a^n \sin (2 \pi b^n x) \]
are continuous but nowhere differentiable.
Note
The condition \(ab \geq 1\) is necessary (in the sense that \(a \in (0,1)\) and \(|ab|<1\) will necessarily yield a \(C^1\) function). It was first established by Hardy in a 1916 article in the Transactions of the American Mathematical Society.
Below are the graphs of
\[{}\sum_{n=0}^\infty 2^{-n} \cos (2 \pi 2^n x){}\]
\[{}\text{ and }{}\]
\[{}\sum_{n=0}^\infty 2^{-n} \sin (2 \pi 2^n x),{}\]
respectively.
Figure. More Nowhere Differentiable Functions