The Weierstrass Function

W(x)=∑n=0∞ancos⁡(bnπx)W(x) = \sum_{n=0}^{\infty} a^n\cos(b^n\pi x) — continuous everywhere yet differentiable nowhere. The M-test scene powers the continuity argument, and the graph turns thornier as partial sums grow. The full nowhere-differentiability proof is idea-level only.

W(x)=∑n=0∞ancos⁡(bnπx),0<a<1<b, ab>1+3π2W(x) = \sum_{n=0}^{\infty} a^n\cos(b^n\pi x),\quad 0 < a < 1 < b,\ ab > 1 + \frac{3\pi}{2}
∣ancos⁡(bnπx)∣≤an,∑an<∞ ⇒ W continuous|a^n\cos(b^n\pi x)| \le a^n,\quad \sum a^n < \infty\ \Rightarrow\ W \text{ continuous}

Part of these learning paths

Examples & Exercises

Prove via the Weierstrass M-test that the Weierstrass function W(x)=∑n=0∞ancos⁡(bnπx)W(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x) (a=12a = \frac12, b=13b = 13) is continuous on all of R\mathbb{R}. (Hint: the m-test scene in the series chapter.)

un(x)=ancos⁡(bnπx),∣un(x)∣≤(12)n=:Mnu_n(x) = a^n \cos(b^n \pi x), \qquad |u_n(x)| \le \left(\tfrac12\right)^n =: M_n
∑n=0∞Mn=2<∞  →M-test  ∑un converges uniformly on R\sum_{n=0}^{\infty} M_n = 2 < \infty \;\xrightarrow{\text{M-test}}\; \sum u_n \text{ converges uniformly on } \mathbb{R}
∣W(x)−WN(x)∣≤∑n=N+1∞Mn=(12)Nfor every x|W(x) - W_N(x)| \le \sum_{n=N+1}^{\infty} M_n = \left(\tfrac12\right)^N \quad \text{for every } x
n=6n = 6: tail bound (1/2)6=0.015625(1/2)^6 = 0.015625 — this curve sits within 0.016 of the true WW at every xx (W6(0)=1.984375W_6(0) = 1.984375).
Show proof
  1. Each term un(x)=ancos⁡(bnπx)u_n(x) = a^n \cos(b^n \pi x) is continuous. Since ∣cos⁡∣≤1|\cos| \le 1, ∣un(x)∣≤an=(12)n=:Mn|u_n(x)| \le a^n = \left(\frac12\right)^n =: M_n for every xx, and ∑n=0∞Mn=∑n=0∞(12)n=2<∞\sum_{n=0}^{\infty} M_n = \sum_{n=0}^{\infty} \left(\frac12\right)^n = 2 < \infty. By the Weierstrass M-test (the m-test scene in the series chapter), ∑un\sum u_n converges uniformly on R\mathbb{R}.
  2. A uniform limit of continuous functions is continuous: fix x0x_0; then ∣W(x)−W(x0)∣≤∣W(x)−WN(x)∣+∣WN(x)−WN(x0)∣+∣WN(x0)−W(x0)∣|W(x) - W(x_0)| \le |W(x) - W_N(x)| + |W_N(x) - W_N(x_0)| + |W_N(x_0) - W(x_0)|. The first and last terms are small by the tail bound (1/2)N(1/2)^N, the middle one by the continuity of the finite sum WNW_N. Hence WW is continuous at x0x_0, and x0x_0 was arbitrary, so WW is continuous on all of R\mathbb{R}.
  3. Check the numbers: at N=6N = 6, ∣W(x)−W6(x)∣≤(1/2)6=0.015625|W(x) - W_6(x)| \le (1/2)^6 = 0.015625 for every xx — the curve on screen sits within 0.016 of the true WW. Raising NN drives the tail bound (1/2)N(1/2)^N to 0, so the on-screen WNW_N approaches WW uniformly.

State the theorem: if bb is odd and ab>1+3π2ab > 1 + \frac{3\pi}{2}, then the Weierstrass function WW is differentiable at no point (our a=12a = \frac12, b=13b = 13 satisfy ab=6.5>5.712ab = 6.5 > 5.712). The argument below is an idea-level sketch — it conveys the mechanism faithfully but does not reproduce the classical proof's constant-tracking line by line.

ab=6.5>1+3π2≈5.712,b=13 oddab = 6.5 > 1 + \frac{3\pi}{2} \approx 5.712, \qquad b = 13 \text{ odd}
at scale b−n: the n-th harmonic completes a full spike, so some xn→x0 has\text{at scale } b^{-n}\text{: the } n\text{-th harmonic completes a full spike, so some } x_n \to x_0 \text{ has}
∣W(xn)−W(x0)xn−x0∣≳(ab)n→∞(idea sketch, not the full proof)\left|\frac{W(x_n) - W(x_0)}{x_n - x_0}\right| \gtrsim (ab)^n \to \infty \quad \text{(idea sketch, not the full proof)}
n=8n = 8: tail bound (1/2)8=0.00390625(1/2)^8 = 0.00390625 — eight smooth terms added, yet the curve is jagged at every scale (W8(0)=1.99609375W_8(0) = 1.99609375, W8(1)=−1.99609375W_8(1) = -1.99609375).
Show proof
  1. Theorem (Weierstrass–Hardy): if bb is an odd integer and ab>1+3π2ab > 1 + \frac{3\pi}{2}, then W(x)=∑n=0∞ancos⁡(bnπx)W(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x) is differentiable at no point. We use a=12a = \frac12, b=13b = 13, so ab=6.5>1+3π2≈5.712ab = 6.5 > 1 + \frac{3\pi}{2} \approx 5.712 — the condition holds.
  2. The mechanism — zooming in at scale b−nb^{-n}: the nn-th harmonic cos⁡(bnπx)\cos(b^n \pi x) completes a full period over every interval of length about b−nb^{-n}, so near any point x0x_0 there is a spike point xnx_n with ∣xn−x0∣≲b−n|x_n - x_0| \lesssim b^{-n} where the nn-th cosine swings nearly trough-to-peak (about 22). Across this spike, the nn-th term's difference quotient is an⋅(≈2)/(≈b−n)≈2(ab)n=2⋅6.5n→∞a^n \cdot (\approx 2) / (\approx b^{-n}) \approx 2(ab)^n = 2 \cdot 6.5^n \to \infty (about 6.37×1066.37 \times 10^6 at n=8n = 8).
  3. The remaining terms cannot beat the spike: the terms with k<nk < n are nearly flat at this scale (differentiating brings out akbkπa^k b^k \pi, a geometric sum with ratio abab and a strictly smaller constant than the spike's), and the terms with k>nk > n are uniformly tiny by the tail bound 2an+1/(1−a)2a^{n+1}/(1-a). The classical proof chooses the spike points delicately, tracks all three constants, and shows that ab>1+3π2ab > 1 + \frac{3\pi}{2} is exactly the inequality saying "the spike's constant wins."
  4. Honest label: this is an idea-level sketch. The full proof is the classical Weierstrass–Hardy construction — building the spike points and tracking all three constants to the end — which we do not reproduce line by line here. The takeaway it conveys is this: the difference quotient blows up to infinity along the spike sequence xn→x0x_n \to x_0, so no finite number can serve as W′(x0)W'(x_0); x0x_0 was arbitrary, so WW is differentiable nowhere.

Each partial sum WNW_N is a finite sum of cosines, hence smoothly (infinitely) differentiable on R\mathbb{R}. Yet WN→WW_N \to W uniformly (problem 1) while WW is differentiable nowhere (problem 2). Conclude that a uniform limit of differentiable functions need not be differentiable.

WN(x)=∑n=0Nancos⁡(bnπx)smooth on RW_N(x) = \sum_{n=0}^{N} a^n \cos(b^n \pi x) \quad \text{smooth on } \mathbb{R}
WN→uniformlyW,∣W−WN∣≤(12)N→0W_N \xrightarrow{\text{uniformly}} W, \qquad |W - W_N| \le \left(\tfrac12\right)^N \to 0
W differentiable nowhere (problem 2)W \text{ differentiable nowhere (problem 2)}
n=2n = 2: a sum of three smooth terms (W2(0)=1.75W_2(0) = 1.75, tail bound (1/2)2=0.25(1/2)^2 = 0.25) — a uniform limit of such smooth things can fail to be differentiable.
Show proof
  1. Each WNW_N is a finite sum, so termwise differentiation is legitimate: WN′(x)=−∑n=0Nanbnπsin⁡(bnπx)W_N'(x) = -\sum_{n=0}^{N} a^n b^n \pi \sin(b^n \pi x) exists at every xx. For instance W2′(x)=−πsin⁡(πx)−13π2sin⁡(13πx)−169π4sin⁡(169πx)W_2'(x) = -\pi\sin(\pi x) - \frac{13\pi}{2}\sin(13\pi x) - \frac{169\pi}{4}\sin(169\pi x) (since a1b1π=13π2a^1 b^1 \pi = \frac{13\pi}{2} and a2b2π=169π4a^2 b^2 \pi = \frac{169\pi}{4}). Every curve on screen is a smooth function.
  2. But by problem 1's tail bound ∣W−WN∣≤(1/2)N→0|W - W_N| \le (1/2)^N \to 0, we have WN→WW_N \to W uniformly on R\mathbb{R}. And by problem 2, the limit WW is differentiable at no point.
  3. Hence a uniform limit of differentiable functions need not be differentiable — continuity is preserved under uniform limits (problem 1's argument), but differentiability is not. This is why analysis demands stronger convergence (e.g. uniform convergence of the derivatives) before differentiating termwise.

9. Differentiation