Everywhere Continuous, Nowhere Differentiable: The Weierstrass Function and Why It Matters
On July 18, 1872, Karl Weierstrass stood before the Royal Prussian Academy of Sciences and presented something that shouldn’t exist. A function that’s continuous everywhere but differentiable nowhere. Not at a few points. Not at most points. At no points whatsoever.
The reaction was something close to horror. Charles Hermite wrote to Thomas Stieltjes in 1893: “I turn away with fright and horror from this lamentable evil of functions which do not have derivatives.” Henri Poincare called such functions a “gallery of monsters.” These weren’t fringe mathematicians. They were among the greatest minds of the era, and they found Weierstrass’s construction genuinely disturbing.
Why? Because before 1872, virtually every mathematician assumed that continuous functions were “smooth” except at isolated trouble spots. Corners, cusps, isolated kinks, sure. But a function that was jagged everywhere, at every scale, with no tangent line at any point? That violated deep geometric intuition. Andre-Marie Ampere had even published a “proof” in 1806 that continuous functions must be differentiable almost everywhere. It went unchallenged for decades. Weierstrass proved it wrong with a concrete counterexample.
And here’s the deeper shock: Weierstrass’s “monster” isn’t the exception. It’s the rule. The Baire category theorem (Rene Baire, 1899) shows that in a precise topological sense, “most” continuous functions are nowhere differentiable. The smooth, differentiable functions we learn about in calculus courses are the freaks. The monsters are normal.
The Weierstrass Function
The function is defined as an infinite series:
$$f(x) = \sum_{n=0}^{\infty} b^n \cos(a^n \pi x) \tag{1}$$
Written out explicitly:
$$f(x) = \cos(\pi x) + b\cos(a\pi x) + b^2\cos(a^2\pi x) + b^3\cos(a^3\pi x) + \ldots$$
The parameters must satisfy three conditions:
- \( a \) is an odd positive integer
- \( 0 < b < 1 \)
- \( ab > 1 + \frac{3}{2}\pi \)
Under these conditions, \( f(x) \) is continuous for all \( x \) but has no finite derivative at any point.
A common example uses \( a = 21 \) and \( b = 0.5 \). The resulting function looks like a jagged, self-similar fractal curve.
Why the Function Is Continuous
The continuity proof is straightforward. Each term in the series is bounded:
$$|b^n \cos(a^n \pi x)| \leq b^n$$
Since \( 0 < b < 1 \), the series \( \sum b^n \) is a convergent geometric series.
By the Weierstrass M-Test for uniform convergence, the series in equation (1) converges uniformly on every interval. A uniformly convergent series of continuous functions is itself continuous.
So \( f(x) \) is continuous everywhere. No surprises here.
Why the Function Is Nowhere Differentiable
This is the hard part. We need to show that the difference quotient
$$\frac{f(x+h) – f(x)}{h}$$
has no finite limit as \( h \to 0 \) for any value of \( x \).
The difference quotient expands to:
$$\frac{f(x+h) – f(x)}{h} = \sum_{n=0}^{\infty} b^n \frac{\cos[a^n\pi(x+h)] – \cos(a^n\pi x)}{h} \tag{2}$$
We split this into two parts. Let \( S_m \) be the sum of the first \( m \) terms. Let \( R_m \) be the remainder after \( m \) terms.
Bounding the First m Terms
Using the Mean Value Theorem on each cosine term:
$$\frac{|\cos[a^n\pi(x+h)] – \cos(a^n\pi x)|}{|h|} \leq a^n\pi$$
So the partial sum satisfies:
$$|S_m| \leq \sum_{n=0}^{m-1} b^n a^n \pi = \pi \frac{(ab)^m – 1}{ab – 1} < \frac{\pi(ab)^m}{ab – 1}$$
This gives us an upper bound on \( |S_m| \).
The Remainder Term Blows Up
Here’s the clever part. We choose \( h \) strategically to make \( R_m \) large.
Write \( a^m x = \alpha_m + \xi_m \), where \( \alpha_m \) is the nearest integer to \( a^m x \) and \( -\frac{1}{2} \leq \xi_m < \frac{1}{2} \).
Choose \( h \) so that:
$$h = \frac{1 – \xi_m}{a^m} \tag{3}$$
As \( m \to \infty \), this \( h \to 0 \). But with this specific choice, the remainder term satisfies:
$$|R_m| > \frac{2(ab)^m}{3} \tag{4}$$
The Punchline
Combining our bounds on \( S_m \) and \( R_m \):
$$\left|\frac{f(x+h) – f(x)}{h}\right| = |R_m + S_m| \geq |R_m| – |S_m| > \left(\frac{2}{3} – \frac{\pi}{ab-1}\right)(ab)^m$$
Since \( ab > 1 + \frac{3}{2}\pi \), the coefficient \( \left(\frac{2}{3} – \frac{\pi}{ab-1}\right) \) is positive.
As \( m \to \infty \), the term \( (ab)^m \to \infty \).
So the difference quotient grows without bound. The limit doesn’t exist. The derivative \( f'(x) \) doesn’t exist at any point \( x \). ∎
Key Takeaways
- The Weierstrass function is continuous everywhere but differentiable nowhere. It’s the canonical example of a “pathological” function.
- Uniform convergence guarantees continuity. But the high-frequency oscillations (controlled by \( a^n \)) prevent any tangent line from existing.
- G.H. Hardy later proved that non-differentiability holds for the weaker condition \( ab \geq 1 \), not just \( ab > 1 + \frac{3}{2}\pi \).
- The function is fractal-like. Its Hausdorff dimension is \( D = 2 + \frac{\ln a}{\ln b} \), confirmed by Shen (2018).
- The Baire category theorem shows “most” continuous functions are nowhere differentiable. Differentiable functions are the exception.
- Bolzano constructed an earlier example (~1830) unpublished until 1922. Takagi (1903), van der Waerden (1930), and Brownian motion provide other constructions.
Before Weierstrass: Bolzano’s lost discovery
Weierstrass wasn’t the first. Bernard Bolzano built a continuous, nowhere-differentiable function around 1830, roughly 40 years earlier. But Bolzano’s manuscript remained unpublished until Karel Rychlik discovered it in 1922.
Other examples followed. Teiji Takagi constructed the Blancmange function in 1903. Van der Waerden gave a simpler construction in 1930. And Norbert Wiener proved in 1923 that sample paths of Brownian motion are almost surely continuous but nowhere differentiable. The jagged behavior Weierstrass discovered turned out to describe real physical processes.
The fractal connection

The Weierstrass function’s graph is a fractal with Hausdorff dimension \( D = 2 + \frac{\ln a}{\ln b} \), conjectured by Mandelbrot and confirmed by Weixiao Shen in 2018. At every scale of magnification, new oscillations appear. The fractal self-similarity is why no tangent line can ever “catch” it.
Applications are surprisingly practical: financial time series, coastline measurements, rough surfaces in physics. Understanding Weierstrass’s “monster” helps mathematicians handle the irregular processes that actually show up in the real world. If this is your first encounter with analysis at this level, the proofs above are standard fare in any real analysis course. And if nowhere-differentiable functions feel strange, consider the Collatz conjecture: another problem where simple rules produce behavior that defies every intuition.
Frequently Asked Questions
What is the Weierstrass function?
The Weierstrass function is an infinite series f(x) = Σ bⁿcos(aⁿπx) where a is an odd integer, 0 < b 1 + 3π/2. It’s the first published example of a function that is continuous everywhere but differentiable nowhere. Karl Weierstrass presented it in 1872.
How can a function be continuous but not differentiable?
Continuity only requires that small changes in x produce small changes in f(x). Differentiability requires a well-defined tangent line, meaning the function must be “smooth” at that point. The Weierstrass function oscillates infinitely fast at every scale, so while nearby points stay close (continuous), no tangent line can ever approximate the curve.
Why was the Weierstrass function controversial?
Before 1872, mathematicians assumed continuous functions were differentiable except at isolated “corner” points. The Weierstrass function shattered this intuition. Some mathematicians, including Charles Hermite, called it a “monster.” It forced a complete rethinking of what functions could look like and led to more rigorous foundations for analysis.
What is the Weierstrass M-test?
The M-test provides a sufficient condition for uniform convergence. If |fₙ(x)| ≤ Mₙ for all x, and ΣMₙ converges, then Σfₙ(x) converges uniformly. In the Weierstrass function, each term is bounded by bⁿ, and Σbⁿ converges since b < 1. This proves uniform convergence and hence continuity.
What values of a and b actually work?
The original conditions require a to be an odd integer, 0 < b 1 + 3π/2 ≈ 5.71. So a = 7 and b = 0.9 works (ab = 6.3). Hardy later showed that ab ≥ 1 is sufficient for non-differentiability, expanding the valid parameter range significantly.
Is the Weierstrass function a fractal?
Yes, in a sense. The Weierstrass function exhibits self-similarity: zooming in on any portion reveals the same jagged structure at smaller scales. The graph has a fractal dimension between 1 and 2. This self-similarity at all scales is precisely what prevents any tangent line from existing.
Who was Karl Weierstrass?
Karl Weierstrass (1815-1897) was a German mathematician often called the “father of modern analysis.” He brought unprecedented rigor to calculus, formalizing limits, continuity, and convergence. Beyond the nowhere-differentiable function, he’s known for the Weierstrass approximation theorem and foundational work on elliptic functions.
Are there other nowhere-differentiable continuous functions?
Yes, infinitely many. The Blancmange curve, the Takagi function, and sample paths of Brownian motion are all continuous but nowhere differentiable. In fact, “most” continuous functions are nowhere differentiable in a precise mathematical sense (the differentiable ones form a meager set in the space of continuous functions).
Why does the parameter a need to be odd?
The oddness of a is used in the proof when analyzing how cosine terms behave at carefully chosen points. When a is odd, certain cosine expressions simplify to ±1 in predictable ways. Later generalizations relaxed this requirement, but Weierstrass’s original proof specifically exploited this property.
Does the Weierstrass function have any practical applications?
The function itself is mainly a theoretical tool. But the mathematics behind it applies to real phenomena: Brownian motion (stock prices, particle diffusion), coastline measurements, and rough surfaces all exhibit similar “nowhere smooth” behavior. Understanding pathological functions helps mathematicians handle irregular real-world processes.