Real Analysis

The Weierstrass Function: Continuous Everywhere, Differentiable Nowhere

The Weierstrass function is the infinite series W(x) = Σn≥0 an cos(bnπx), and when 0 < a < 1, b is an odd integer and ab > 1 + 3π/2 ≈ 5.7124, it is continuous at every real number and has a derivative at none of them. Karl Weierstrass presented it to the Royal Prussian Academy of Sciences in Berlin on 18 July 1872. Until then, working mathematicians had assumed that a curve you can draw in one unbroken stroke must have a tangent line at nearly every point — Ampère had even published an attempted proof. Weierstrass's series is unbroken everywhere and has a tangent nowhere, and it forced analysis to be rebuilt on ε–δ definitions rather than on pictures.

  • PresentedBerlin Academy, 18 July 1872
  • The seriesW(x) = Σ<sub>n≥0</sub> a<sup>n</sup> cos(b<sup>n</sup>πx)
  • Weierstrass's condition0 &lt; a &lt; 1, b an odd integer, ab &gt; 1 + 3π/2 ≈ 5.7124
  • Hardy's condition, 19160 &lt; a &lt; 1, b &gt; 1, ab ≥ 1 — b need not be an integer
  • Smoothness it does haveHölder exponent α = ln(1/a)/ln b when ab &gt; 1, and that exponent is sharp
  • Dimension of the graph2 + log<sub>b</sub> a for integer b ≥ 2 and 1/b &lt; a &lt; 1 (Hausdorff dimension, Shen 2018)

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

What the series says, term by term

Every term of W(x) = Σ an cos(bnπx) is an ordinary cosine wave. Term n has amplitude an and frequency bn, so as n grows each wave is shorter and faster than the one before by fixed ratios a and b. Take the values drawn in the video, a = 1/2 and b = 3. The heights run 1, 0.5, 0.25, 0.125, 0.0625, … and the number of ripples per unit of x runs 1, 3, 9, 27, 81, …

Two numbers decide everything, and they pull in opposite directions.

The heights add up to a finite total: Σ an = 1/(1 − a), which is exactly 2 for a = 1/2. That is why the curve stays inside a band of height 4 and never runs away.

The steepness does not. Differentiating term n gives −anbnπ sin(bnπx), whose largest magnitude is π(ab)n. For a = 1/2, b = 3 that is π(1.5)n: 3.14, 4.71, 7.07, 10.60, 15.90, 23.86, … Whenever ab > 1 these grow geometrically and without bound.

So the wrinkles get smaller in height faster than they get slower in frequency — the amplitude ratio a beats the frequency ratio b for size, but loses to it for slope. That single tension is the whole function.

Continuity is the easy half, and Weierstrass proved it with his own test

Each partial sum WN(x) = Σn<N an cos(bnπx) is a finite sum of cosines, so it is as smooth as anything in analysis. The question is whether the limit inherits continuity, and the answer comes from the Weierstrass M-test: since |an cos(bnπx)| ≤ an for every x, and Σ an converges, the series converges uniformly on the whole real line.

Uniformity is the load-bearing word. A uniform limit of continuous functions is continuous; a merely pointwise limit need not be. Concretely, everything WN leaves out is bounded by aN/(1 − a) at every x at once. For a = 1/2 and N = 20 that bound is 2 · 2−20 ≈ 1.9 × 10−6, so the twenty-term picture is already within two millionths of the true curve, uniformly. What you see plotted is not an approximation in spirit only; it is within a pixel everywhere.

W is also periodic with period 2, since every cos(bnπx) has period 2/bn, and 2 is a whole-number multiple of each. When b is an odd integer one also gets W(1 − x) = −W(x), because cos(bnπ − u) = −cos u for odd bn.

Why no point has a derivative

The derivative at x is the limit of difference quotients (W(y) − W(x))/(y − x) as y → x. To kill it you do not have to evaluate the limit; you only have to produce, for every x, a sequence of y approaching x along which the quotient misbehaves. Weierstrass's construction does exactly that, and it is the reason the odd-integer condition on b is there.

Fix x and fix a level m. Write bmx = αm + xm, where αm is the nearest integer and xm ∈ (−1/2, 1/2]. Now put ym = (αm − 1)/bm and zm = (αm + 1)/bm. These straddle x, they close in on it at rate b−m, and — crucially — they are points where the high-frequency cosines are pinned to ±1 with a predictable sign, because bn is odd for every n.

Split the series at n = m. For the low terms n < m, the crude bound |cos u − cos v| ≤ |u − v| turns the sum into a geometric series bounded by π(ab)m/(ab − 1). For the high terms n ≥ m, the pinned signs make every contribution push the same way, and the n = m term alone contributes at least (2/3)(ab)m in magnitude.

The high terms win provided 2/3 > π/(ab − 1), which rearranges to ab > 1 + 3π/2. That is where the strange-looking 5.7124 comes from: it is not an artefact of the function, it is the point at which the dominant block out-votes the error block. The two one-sided quotients then have opposite signs and both blow up like (ab)m, so no limit exists — not a finite one, and not an infinite one either.

G. H. Hardy (Weierstrass's non-differentiable function, Transactions of the AMS 17, 1916, 301–325) replaced this bookkeeping with a Fourier-analytic argument and reduced the hypotheses to the sharp ones: 0 < a < 1, b > 1 and ab ≥ 1, with b no longer required to be an integer, let alone odd. Hardy also showed the condition is sharp in the sense that ab < 1 makes the function continuously differentiable.

What the zoom really shows — and what it does not

The video magnifies a smooth parabola and the Weierstrass curve in two stacked windows, by the same factor, in both directions at once. The parabola flattens: after ×64 its sliding secant slope has locked onto +0.20, which is 2x at x = 0.10, and the picture is a straight line. The Weierstrass window keeps producing wrinkles and its secant slope keeps changing sign and magnitude.

This is an illustration, not a proof. Any rendered picture has finite resolution, so it can only ever show finitely many levels of the series; the claim being made is about all of them. Two things stop the picture from being empty rhetoric, though.

The first is that the curve satisfies an exact self-similarity relation, straight from the definition: W(x) = cos(πx) + a·W(bx). Magnifying by b horizontally and 1/a vertically returns the same function plus one smooth cosine. There is no scale at which the structure changes character, because the structure at every scale is a copy of the whole.

The second is the caution the history supplies. Divergence of the term-by-term derivative series Σ π(ab)n is not by itself a proof of non-differentiability. Riemann's function Σ sin(n2πx)/n2 also has a divergent differentiated series, and was long believed to be nowhere differentiable — yet Joseph Gerver proved in 1969–70 that it is differentiable, with derivative exactly −1/2, at every rational point x = (2p+1)/(2q+1). The picture and the divergent series both suggested the right answer for Weierstrass and the wrong one for Riemann. Only the inequality decides.

Hölder exponent, and the dimension of the graph

W is not differentiable, but it is not arbitrarily wild either. It satisfies a Hölder condition: there is a constant C with |W(x) − W(y)| ≤ C|x − y|α, where α = ln(1/a)/ln b = −logb a. For a = 1/2, b = 3 that is α = 0.6309. The exponent is sharp: W is not Hölder for any exponent larger than α, and α = 1 would be Lipschitz continuity, which by Rademacher's theorem would force differentiability almost everywhere. Nowhere differentiability lives in the gap 0 < α < 1.

That same exponent fixes how much of the plane the graph fills. The box-counting dimension of the graph is D = 2 + logb a = 2 − α, computed for this family by Kaplan, Mallet-Paret and Yorke in 1984; Besicovitch and Ursell had established the pattern for related self-affine graphs in 1937. For a = 1/2, b = 3 that gives D = 1.3691: strictly more than a rectifiable curve, strictly less than an area.

Whether the Hausdorff dimension also equals D was open for decades. Mandelbrot conjectured it; Barański, Bárány and Romanowska proved it in 2014 for a large range of parameters, and Weixiao Shen closed the classical cosine case in 2018 (Mathematische Zeitschrift 289), covering every integer b ≥ 2 and every a with 1/b < a < 1. A related consequence: W has unbounded variation on every interval, so its graph has infinite length over any interval, however short.

1872, and the people who got there first

Weierstrass read the function to the Berlin Academy on 18 July 1872. He did not publish it himself; it reached print in 1875 when Paul du Bois-Reymond included it in a paper in Crelle's Journal für die reine und angewandte Mathematik (volume 79, pages 21–37), and it appears in Weierstrass's collected Mathematische Werke II of 1895.

He was not first, only first to be heard. Bernard Bolzano had built a continuous nowhere-differentiable function around 1830 in his manuscript Functionenlehre; the manuscript was identified by Martin Jašek in 1921, published by Karel Rychlík in 1930, and Vojtěch Jarník supplied the non-differentiability proof in 1922 — a century of invisibility. Charles Cellérier, in Geneva, wrote down Σ a−n sin(anx) with a large integer a around 1860; it was published posthumously in the Bulletin des Sciences Mathématiques in 1890.

The reaction to Weierstrass was not admiration. Charles Hermite wrote to Stieltjes on 20 May 1893 that he turned away “with fear and horror from this lamentable plague of functions which have no derivatives”. Poincaré grouped such constructions with monsters invented to embarrass the reasoning of earlier masters. The objection had force, because Ampère had published an argument in 1806 that a continuous function must be differentiable except at isolated points, and textbooks had leaned on it for two generations.

What survived was the method rather than the mood. If a picture can be this misleading, then continuity, limits and derivatives have to be defined by inequalities rather than by drawing — which is precisely the ε–δ programme Cauchy began and Weierstrass finished. Later examples made the construction cheap: Teiji Takagi's blancmange function of 1901, Σ 2−n dist(2nx, ℤ), needs no trigonometry at all, and van der Waerden gave a base-10 version in 1930.

Where nowhere-differentiable curves actually turn up

The sharpest reversal came in 1931, when Stefan Banach and Stefan Mazurkiewicz independently proved that in the space C[0,1] of continuous functions with the supremum norm, the nowhere-differentiable functions form a residual set — the complement of a meagre set, in the sense of the Baire category theorem. In that topological sense, a “typical” continuous function is nowhere differentiable, and the smooth ones are the exceptions. Weierstrass had not found a freak; he had found an ordinary member of a class nobody had looked at.

Probability says the same thing with a different measure. Paley, Wiener and Zygmund showed in 1933 that the sample paths of Brownian motion are almost surely nowhere differentiable — which is the mathematical content of the physical statement that a pollen grain in water has no well-defined instantaneous velocity. Brownian paths are Hölder continuous for every exponent below 1/2, the direct analogue of W's exponent α.

Applied work uses the construction directly. The Weierstrass–Mandelbrot function, the complex version analysed by Berry and Lewis in 1980 (Proceedings of the Royal Society A 370, 459–484), is a standard model for rough surfaces: it lets an engineer dial in a roughness exponent and get a profile with a prescribed fractal dimension, which is used in contact mechanics, in tribology, and in modelling radar scattering from terrain. Fractal interpolation functions, used to compress and reconstruct rough data, are built the same way. The object that horrified Hermite is now a modelling primitive.

Five choices of a and b, and what each one actually gives
ParametersabWhich theorem covers itHölder exponent α / dimension of the graph
a = 1/2, b = 3 (the curve drawn in the video)1.5Hardy 1916, which needs only ab ≥ 1. Too small for Weierstrass's own proof, which needs ab &gt; 5.7124.α = ln 2 / ln 3 = 0.6309 / dimension 1.3691
a = 1/2, b = 136.5Weierstrass 1872 — with a = 1/2, thirteen is the smallest odd b that clears 1 + 3π/2 (b = 11 gives only 5.5).α = ln 2 / ln 13 = 0.2702 / dimension 1.7298
a = 1/2, b = 73.5Hardy 1916 only. Seven is odd, but 3.5 falls short of 5.7124, so the 1872 argument does not reach it.α = ln 2 / ln 7 = 0.3562 / dimension 1.6438
a = 0.9, b = 21.8Hardy 1916. Two is even, which Weierstrass's proof excluded outright; Hardy's does not care.α = ln(10/9) / ln 2 = 0.1520 / dimension 1.8480
a = 1/4, b = 20.5Neither. With ab &lt; 1 the term-by-term derivative series Σ π(ab)<sup>n</sup> converges uniformly, so W is continuously differentiable.the α formula returns 2, which is meaningless here / dimension 1

Frequently asked questions

Is the Weierstrass function really continuous at every point?

Yes, and the proof is three lines. Each term satisfies |aⁿ cos(bⁿπx)| ≤ aⁿ, and Σ aⁿ = 1/(1 − a) converges because 0 &lt; a &lt; 1. By the Weierstrass M-test the series converges uniformly on all of ℝ, and a uniform limit of continuous functions is continuous. Nothing in that argument uses b, which is exactly why continuity is the easy half.

Does zooming into the graph prove there is no derivative?

No. A rendered picture has finite resolution, so it can only display finitely many terms, while the claim is about all of them. What the zoom honestly shows is the self-similarity W(x) = cos(πx) + a·W(bx), which says the structure at every scale is a copy of the whole. The proof itself is an inequality: for every x you exhibit points closing in on x from both sides whose secant slopes grow like (ab)ᵐ with opposite signs.

Which values of a and b actually work?

Weierstrass's own 1872 proof required 0 &lt; a &lt; 1, b an odd integer, and ab &gt; 1 + 3π/2 ≈ 5.7124 — so with a = 1/2 the smallest admissible b is 13. G. H. Hardy weakened this in 1916 to 0 &lt; a &lt; 1, b &gt; 1 and ab ≥ 1, dropping the requirement that b be an odd integer. When ab &lt; 1 the differentiated series converges uniformly and W is continuously differentiable, so Hardy's condition is sharp.

Who found the first continuous nowhere-differentiable function?

Bolzano did, around 1830, in an unpublished manuscript; it was rediscovered in 1921, published in 1930, and proved nowhere differentiable by Jarník in 1922. Charles Cellérier wrote one down around 1860, published posthumously in 1890. Weierstrass's 1872 example was the first that the mathematical community actually saw and had to reckon with, which is why the class of functions carries his name.

What is the fractal dimension of the graph?

The box-counting dimension is D = 2 + log_b a = 2 − α, where α = ln(1/a)/ln b is the Hölder exponent — so a = 1/2, b = 3 gives D = 1.3691, and a = 1/2, b = 13 gives 1.7298. The Hausdorff dimension was conjectured by Mandelbrot to be the same number; Barański, Bárány and Romanowska proved it in 2014 for a wide parameter range, and Weixiao Shen settled the classical cosine case for all integers b ≥ 2 in 2018.

Are functions like this rare?

The opposite. Banach and Mazurkiewicz proved in 1931 that the nowhere-differentiable functions are residual in C[0,1] with the supremum norm — topologically speaking, almost all continuous functions are nowhere differentiable, and the smooth ones form a meagre exception. Brownian motion paths are nowhere differentiable with probability one. Weierstrass's monster is the norm; the smooth curves of calculus textbooks are the special case.