Continuous everywhere, differentiable nowhere: the Weierstrass function

June 21, 2026 · math, analysis

Draw a continuous curve. Take your pen off the paper only where you have to. Chances are it looks smooth almost everywhere, maybe with a handful of sharp corners — the graph of x|x|, or a piecewise-linear zigzag. Through most of the 19th century, this was more than a drawing habit: it was close to a working assumption. Continuity was widely believed to imply differentiability at “most” points, or at least at all but a sparse set of exceptions, because every continuous function anyone could write down behaved that way. Even Ampère had offered a purported proof, decades earlier, that a continuous function must be differentiable except at isolated points.

It’s false. In the 1870s, Karl Weierstrass constructed a function that is continuous at every single real number and differentiable at none of them — not “differentiable except on some thin exceptional set,” but nowhere, full stop. No tangent line exists anywhere on its graph, despite the graph being a single unbroken curve you could in principle trace without lifting a pen. The construction is a Fourier-flavored infinite sum, and unwinding exactly why it survives as continuous while its differentiability dies completely is one of the cleanest case studies in real analysis for what “rigor” actually buys you over “it looks smooth in the picture.”

The construction

For 0<a<10 < a < 1, bb a positive odd integer, define

f(x)=k=0akcos(bkπx).f(x) = \sum_{k=0}^{\infty} a^k \cos(b^k \pi x).

Each term is a cosine wave: amplitude aka^k, frequency bkb^k (in the sense that cos(bkπx)\cos(b^k\pi x) completes bkb^k full oscillations as xx ranges over [0,2][0,2]). As kk grows, ak0a^k \to 0 geometrically — each successive wave is smaller — but bkb^k \to \infty geometrically too — each successive wave is packed tighter. The function is literally an infinite superposition of cosine waves at every dyadic-like scale b0,b1,b2,b^0, b^1, b^2, \ldots, each scaled down in height by a0,a1,a2,a^0, a^1, a^2, \ldots.

Weierstrass’s classical theorem adds one more condition beyond 0<a<10<a<1 and bb odd:

ab>1+3π25.712.ab > 1 + \frac{3\pi}{2} \approx 5.712.

It’s worth pausing on why a condition like this should be needed at all, before treating it as a black box. Differentiate the kk-th term formally: ddx[akcos(bkπx)]=akbkπsin(bkπx)\frac{d}{dx}\big[a^k\cos(b^k\pi x)\big] = -a^k b^k \pi \sin(b^k \pi x), which has amplitude π(ab)k\pi (ab)^k. The amplitude condition a<1a<1 was exactly what made the heights of the terms shrink, which is what continuity is going to need. But the slopes of the terms scale with (ab)k(ab)^k, not aka^k — and if ab>1ab>1, those slopes don’t shrink at all, they blow up geometrically as kk\to\infty. So term 00 contributes a gentle wave, term 11 a slightly steeper one, and by term 3030 or so you’re formally adding in a wave whose slope is enormous, riding on top of a curve that (because a<1a<1) is barely perturbed in height by that same term. Height under control, slope out of control, at every scale simultaneously — that tension is the entire mechanism of this function, and it’s why ab>1ab>1 is the qualitative threshold and the stronger constant 1+3π21+\tfrac{3\pi}{2} is what a fully rigorous proof of nowhere-differentiability actually needs (that stronger, sharp threshold comes from a careful classical estimate; I’ll say honestly below exactly where it enters, without re-deriving the precise constant).

Here’s a single low-frequency term by itself — nothing dramatic yet, just a cosine:

Throughout, I’ll use the concrete pair a=0.9a = 0.9, b=7b = 7 (bb odd, ab=6.3>1+3π25.712ab = 6.3 > 1+\tfrac{3\pi}{2} \approx 5.712, comfortably satisfying the classical condition).

Continuity: the easy half, done completely

This direction is genuinely clean, and there’s no reason to hand-wave any of it.

Let SN(x)=k=0N1akcos(bkπx)S_N(x) = \sum_{k=0}^{N-1} a^k \cos(b^k\pi x) denote the NN-th partial sum. Each SNS_N is a finite sum of continuous functions (cosines, scaled and composed with linear maps), hence continuous on all of R\mathbb{R}.

Uniform convergence, via the Weierstrass M-test. For every xRx \in \mathbb{R} and every kk, cos(bkπx)1|\cos(b^k\pi x)| \le 1, so

akcos(bkπx)ak=:Mk.\left|a^k \cos(b^k \pi x)\right| \le a^k =: M_k.

Since 0<a<10 < a < 1, k=0Mk=k=0ak=11a\sum_{k=0}^\infty M_k = \sum_{k=0}^\infty a^k = \frac{1}{1-a} converges (geometric series). The M-test says: if gk(x)Mk|g_k(x)| \le M_k for all xx in some domain, with Mk<\sum M_k < \infty, then gk\sum g_k converges uniformly on that domain. The proof of the M-test itself is just the Cauchy criterion applied uniformly — for m>nm > n,

Sm(x)Sn(x)=k=n+1makcos(bkπx)k=n+1makk=n+1ak=an+11a,\left|S_m(x) - S_n(x)\right| = \left|\sum_{k=n+1}^{m} a^k\cos(b^k\pi x)\right| \le \sum_{k=n+1}^{m} a^k \le \sum_{k=n+1}^{\infty} a^k = \frac{a^{n+1}}{1-a},

and this bound doesn’t depend on xx or mm at all — it only depends on nn, and it 0\to 0 as nn\to\infty. So (SN)(S_N) is uniformly Cauchy, hence converges uniformly to some limit function, which is by definition ff.

A uniform limit of continuous functions is continuous. This is the other half, and it’s worth actually running the ε/3\varepsilon/3 argument rather than citing it. Fix x0Rx_0 \in \mathbb{R} and ε>0\varepsilon > 0. By uniform convergence, choose NN so that supxf(x)SN(x)<ε/3\sup_x |f(x) - S_N(x)| < \varepsilon/3 (in particular this bounds f(x0)SN(x0)|f(x_0)-S_N(x_0)| and f(x)SN(x)|f(x)-S_N(x)| for every xx, with the same NN). Since SNS_N is continuous at x0x_0, choose δ>0\delta>0 so that xx0<δ    SN(x)SN(x0)<ε/3|x-x_0|<\delta \implies |S_N(x)-S_N(x_0)| < \varepsilon/3. Then for xx0<δ|x-x_0|<\delta,

f(x)f(x0)f(x)SN(x)+SN(x)SN(x0)+SN(x0)f(x0)<ε3+ε3+ε3=ε.|f(x)-f(x_0)| \le |f(x)-S_N(x)| + |S_N(x)-S_N(x_0)| + |S_N(x_0)-f(x_0)| < \frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3} = \varepsilon.

So ff is continuous at x0x_0, and since x0x_0 was arbitrary, ff is continuous on all of R\mathbb{R}. \blacksquare

Nothing about this argument cares how large bb is, or whether abab exceeds 1+3π21+\tfrac{3\pi}{2} — continuity only ever used 0<a<10<a<1. That asymmetry (continuity is cheap; differentiability, next, is expensive and needs the extra hypothesis) is the whole point of the post.

Two more terms already show the roughening, even though every one of these partial sums is, individually, a perfectly smooth, differentiable finite trigonometric sum:

By four terms the curve is visibly ragged. But finite sums of smooth functions are always smooth — S4S_4 has a well-defined derivative everywhere, and so does SNS_N for every finite NN. Differentiability only breaks in the limit NN\to\infty, and it breaks completely. That’s the part that needs a real argument, because “it looks jagged in the picture” is not a proof — a function can look rough at the resolution of a plot and still be differentiable (its derivative could just be large, or oscillate a lot, without failing to exist).

Non-differentiability: the real mechanism

Fix any point x0Rx_0 \in \mathbb{R} — the argument has to work at every point, which is the entire content of “nowhere differentiable.” The strategy is to exhibit a specific sequence of points marching in on x0x_0 along which the difference quotient fails to settle down to any finite limit.

Choosing the approach. For each positive integer mm, let αm\alpha_m be the integer nearest to bmx0b^m x_0, and write

bmx0=αm+θm,θm[12,12].b^m x_0 = \alpha_m + \theta_m, \qquad \theta_m \in \left[-\tfrac12, \tfrac12\right].

Define

δm=1θmbm,so thatbm(x0+δm)=αm+1,\delta_m = \frac{1-\theta_m}{b^m}, \qquad \text{so that} \qquad b^m(x_0+\delta_m) = \alpha_m + 1,

an exact integer. This is the key trick: δm\delta_m is chosen so that at exactly the k=mk=m scale, the argument of the cosine lands exactly on a multiple of π\pi, where cos\cos takes its extreme value ±1\pm1. Since θm[12,12]\theta_m \in [-\tfrac12,\tfrac12], δm[12bm,32bm]\delta_m \in \big[\tfrac{1}{2b^m}, \tfrac{3}{2b^m}\big] — in particular δm>0\delta_m > 0 and δm0\delta_m \to 0 as mm \to \infty, so x0+δmx0x_0 + \delta_m \to x_0.

Now look at the difference quotient, split by frequency band:

Qm:=f(x0+δm)f(x0)δm=k=0m1()Am, low+()k=mBm, the hinge+k=m+1()Cm, high tail.Q_m := \frac{f(x_0+\delta_m)-f(x_0)}{\delta_m} = \underbrace{\sum_{k=0}^{m-1}(\cdots)}_{A_m,\ \text{low}} + \underbrace{(\cdots)_{k=m}}_{B_m,\ \text{the hinge}} + \underbrace{\sum_{k=m+1}^{\infty}(\cdots)}_{C_m,\ \text{high tail}}.

Low frequencies (AmA_m, k<mk<m): bounded by the mean value theorem. For fixed kk, cos(bkπx)\cos(b^k\pi x) has derivative bounded by bkπb^k\pi in magnitude, so by the MVT,

cos(bkπ(x0+δm))cos(bkπx0)bkπδm.\left|\cos(b^k\pi(x_0+\delta_m)) - \cos(b^k\pi x_0)\right| \le b^k \pi\, \delta_m.

Summing,

Amk=0m1akbkπδm=πδmk=0m1(ab)k=πδm(ab)m1ab1<πab1(ab)mδm,|A_m| \le \sum_{k=0}^{m-1} a^k b^k \pi\, \delta_m = \pi\delta_m\sum_{k=0}^{m-1}(ab)^k = \pi\delta_m\cdot\frac{(ab)^m-1}{ab-1} < \frac{\pi}{ab-1}(ab)^m\delta_m,

so Am/δm<πab1(ab)m|A_m|/\delta_m < \dfrac{\pi}{ab-1}(ab)^m — this is exactly the finitely-many-smooth-terms piece, and it grows no faster than (ab)m(ab)^m.

The hinge term (BmB_m, k=mk=m): where the specific choice of δm\delta_m pays off. By construction bm(x0+δm)=αm+1b^m(x_0+\delta_m)=\alpha_m+1, so cos(bmπ(x0+δm))=cos((αm+1)π)=(1)αm+1\cos(b^m\pi(x_0+\delta_m)) = \cos((\alpha_m+1)\pi) = (-1)^{\alpha_m+1}. And cos(bmπx0)=cos((αm+θm)π)=(1)αmcos(θmπ)\cos(b^m\pi x_0) = \cos((\alpha_m+\theta_m)\pi) = (-1)^{\alpha_m}\cos(\theta_m\pi) (using sin(αmπ)=0\sin(\alpha_m\pi)=0 since αmZ\alpha_m\in\mathbb{Z}). So the numerator of the k=mk=m term is

(1)αm+1(1)αmcos(θmπ)=(1)αm[1+cos(θmπ)].(-1)^{\alpha_m+1} - (-1)^{\alpha_m}\cos(\theta_m\pi) = -(-1)^{\alpha_m}\big[1+\cos(\theta_m\pi)\big].

Since θm[12,12]\theta_m \in [-\tfrac12,\tfrac12], cos(θmπ)[0,1]\cos(\theta_m\pi) \in [0,1], so the bracket lies in [1,2][1,2] — it is bounded away from zero, uniformly in mm. Dividing by δm32bm\delta_m \le \tfrac{3}{2b^m} gives

Bm=am1+cos(θmπ)δmam13/(2bm)=23(ab)m.|B_m| = a^m\cdot\frac{1+\cos(\theta_m\pi)}{\delta_m} \ge a^m \cdot \frac{1}{3/(2b^m)} = \frac{2}{3}(ab)^m.

This is the whole engine of the proof: one single term, isolated by the specific choice of δm\delta_m, contributes a difference quotient of size at least a fixed constant times (ab)m(ab)^m — genuinely unbounded, since ab>1ab>1.

The high tail (CmC_m, k>mk>m): crudely bounded. Using cosucosv2|\cos u - \cos v|\le 2 and δm12bm\delta_m \ge \tfrac{1}{2b^m},

Cmk=m+1ak2δm2δmam+11a4bmam+11a=4a1a(ab)m.|C_m| \le \sum_{k=m+1}^\infty a^k \cdot \frac{2}{\delta_m} \le \frac{2}{\delta_m}\cdot\frac{a^{m+1}}{1-a} \le 4b^m \cdot \frac{a^{m+1}}{1-a} = \frac{4a}{1-a}(ab)^m.

Putting it together. By the triangle inequality,

QmBmAmCm(ab)m[23πab14a1a].\begin{aligned} |Q_m| &\ge |B_m| - |A_m| - |C_m| \\ &\ge (ab)^m\left[\frac{2}{3} - \frac{\pi}{ab-1} - \frac{4a}{1-a}\right]. \end{aligned}

If the bracketed constant is positive, Qm|Q_m| \to \infty as mm\to\infty along the sequence x0+δmx0x_0+\delta_m \to x_0, so the difference quotient is unbounded — no finite derivative f(x0)f'(x_0) can exist. And crucially, none of this argument depended on which x0x_0 we started with, so it applies at every point simultaneously.

I want to be straightforward about what’s rigorous here and what isn’t. The three bounds on AmA_m, BmB_m, CmC_m above are genuine, checkable estimates — this is the actual shape of the classical proof (essentially the version in Rudin’s Principles of Mathematical Analysis), not a hand-wave. What I’m not doing is the careful optimization that turns “make the bracket positive” into the sharp, general classical constant ab>1+3π2ab > 1+\tfrac{3\pi}{2} — my bracket above, evaluated crudely, is a looser sufficient condition than the sharp one, and pinning down exactly how loose (and tightening it to the textbook constant) is real, somewhat tedious bookkeeping that I’m not reproducing line by line. The concrete pair used in this post, a=0.9, b=7a=0.9,\ b=7, satisfies the sharp classical condition with room to spare, so the theorem applies to it regardless.

This is exactly where the low/high split in the charts matters. Zoom into ff near any point, at any scale, and you’re looking at a superposition where finitely many “slow” terms behave like a smooth background (the AmA_m piece — tame, bounded by the MVT) while there is always some band of terms whose frequency is comparable to your zoom level, contributing slope on the order of (ab)m(ab)^m at that scale (the BmB_m/CmC_m pieces) — and that contribution never shrinks away no matter how far in you zoom, because ab>1ab>1. Eight terms, still on the original scale:

That’s the same eight-term partial sum S8S_8, but plotted on a window of width 0.0010.001 around 00 — about two thousand times narrower than the earlier plots. It’s exactly as jagged, at this microscopic scale, as S4S_4 was on the original scale. Nothing smooths out under magnification, because the high-frequency terms that dominate at this zoom level (kk around 6677, with wavelength comparable to the window) are still there, still contributing slope of order (ab)k(ab)^k.

Push to sixteen terms and zoom in by another factor of roughly 101010^{10}, down to a window about 101010^{-10} wide, and the same thing happens again — the newly-added high-kk terms (wavelength comparable to this tiny window) take over and the curve is, once again, exactly as rough as it was at every previous scale:

This is not a coincidence of the specific window sizes I picked — it’s forced by the structure of the proof. At every scale bmb^{-m}, there is a term of the series (the one with kmk\approx m) whose amplitude has shrunk just enough to keep the function continuous, but whose slope, (ab)m(ab)^m, has grown, and grown by exactly the same geometric factor at every scale. There is no scale at which the roughness runs out.

Why this mattered, and where it echoes

Weierstrass presented this construction in 1872, in a paper read to the Berlin Academy of Sciences, at a moment when analysis was in the middle of being rebuilt on epsilon-delta foundations rather than geometric intuition about curves — Cauchy, Bolzano, and Weierstrass himself had spent decades replacing “obviously true from the picture” with statements that could actually be checked from the definitions of limit, continuity, and derivative. The Weierstrass function is the sharpest possible demonstration of why that program mattered: it is a legitimate counterexample to a claim that had been treated as geometrically self-evident, constructed from tools (an infinite series, term-by-term estimates, the M-test) that only work because the definitions were made precise enough to apply them. It’s usually counted among the first of the “pathological” or “monster” functions and sets that forced 19th- and early 20th-century mathematicians to stop trusting pictures as proofs — a lineage that continues through nowhere-differentiable and self-similar constructions in what became fractal geometry, and, later, through probability theory: it’s a theorem that the sample paths of Brownian motion are, with probability 11, continuous everywhere and differentiable nowhere, by a mechanism that — roughly, not literally the same estimates — has the same flavor as this one, fine-scale randomness whose amplitude shrinks fast enough for continuity but whose local slope never settles down. The picture changed permanently: “continuous” and “smooth” were never really synonyms, but after 1872 nobody could pretend the gap between them was small.