The Weierstrass Function

Pieter de Jong
3 min readMay 3, 2023

Continuous everywhere — differentiable nowhere

The Weierstrass function is a fascinating example of a function that is continuous everywhere but differentiable nowhere. It was discovered by the German mathematician Karl Weierstrass in 1872, and it has since become an important example in the study of real analysis.

The Weierstrass function is defined as follows:

where 𝑎 and 𝑏 are constants that satisfy 0<𝑎<1 and 𝑏 is an odd integer larger than 1.

The Weierstrass function is a continuous function on the real line, but it is not differentiable anywhere. This is a surprising result, since we usually think of continuity and differentiability as being closely related, and the function above looks quite innocent! However, the Weierstrass function shows that this is not always the case.

The reason why the Weierstrass function is not differentiable is that its rate of change is extremely erratic. The function oscillates rapidly at all scales, so it has no well-defined tangent lines at any point. In fact, the graph of the function looks like a fractal, with self-similar patterns appearing at all levels of magnification.

Here is an example of the Weierstrass function with 𝑎=0.5 and 𝑏=3 plotted using Python and Matplotlib:

--

--

Pieter de Jong

Physicist & Curious Mind, Husband & Father | Trying to live a good life