Mathwords logoMathwords

Weierstrass Function — Definition, Formula & Examples

The Weierstrass function is a famous example of a function that is continuous at every point but has no derivative at any point. It was introduced by Karl Weierstrass in 1872 to show that continuous functions need not be smooth or have tangent lines.

The Weierstrass function is defined as W(x)=n=0ancos(bnπx)W(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x), where 0<a<10 < a < 1, bb is a positive odd integer, and ab>1+32πab > 1 + \frac{3}{2}\pi. Under these conditions, the series converges uniformly to a continuous function that is nowhere differentiable.

Key Formula

W(x)=n=0ancos(bnπx)W(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x)
Where:
  • aa = Amplitude decay factor, with $0 < a < 1$
  • bb = Positive odd integer controlling frequency growth
  • nn = Summation index over non-negative integers
  • xx = Real-valued input variable

How It Works

Each term ancos(bnπx)a^n \cos(b^n \pi x) is a smooth cosine wave with shrinking amplitude ana^n and rapidly increasing frequency bnb^n. The shrinking amplitudes guarantee uniform convergence, which preserves continuity. However, the frequencies grow fast enough that the oscillations prevent a well-defined tangent line at every point. At any scale of magnification, the graph reveals new jagged detail — a fractal-like self-similarity that blocks differentiability everywhere.

Worked Example

Problem: Using a=0.5a = 0.5 and b=7b = 7, compute the first three terms of W(x)W(x) at x=0x = 0.
Step 1: Evaluate the n=0n = 0 term.
a0cos(70π0)=1cos(0)=1a^0 \cos(7^0 \cdot \pi \cdot 0) = 1 \cdot \cos(0) = 1
Step 2: Evaluate the n=1n = 1 term.
0.51cos(71π0)=0.5cos(0)=0.50.5^1 \cos(7^1 \cdot \pi \cdot 0) = 0.5 \cdot \cos(0) = 0.5
Step 3: Evaluate the n=2n = 2 term and form the partial sum.
0.52cos(72π0)=0.251=0.250.5^2 \cos(7^2 \cdot \pi \cdot 0) = 0.25 \cdot 1 = 0.25
Answer: The partial sum of the first three terms at x=0x = 0 is 1+0.5+0.25=1.751 + 0.5 + 0.25 = 1.75. In fact, at x=0x = 0 every cosine term equals 1, so W(0)=n=00.5n=2W(0) = \sum_{n=0}^{\infty} 0.5^n = 2.

Why It Matters

The Weierstrass function shattered the 19th-century belief that continuous functions must be differentiable "almost everywhere." It motivated rigorous foundations in real analysis, including the precise epsilon-delta definitions of limits and continuity. Today it appears in fractal geometry, the study of Brownian motion in probability, and as a standard counterexample in graduate analysis courses.

Common Mistakes

Mistake: Assuming that because the partial sums are smooth (each is a finite sum of cosines), the limit function must also be smooth.
Correction: Uniform convergence preserves continuity but does not preserve differentiability. The limit of differentiable functions can be nowhere differentiable.