---
tag: 01A0MK1730
kind: counterexample
name: Weierstrass function
msc: [26A27]
uses: [0NX5NWAFC9, 0R0MYT0BJD, 0A61B60B5R]
sources:
  - url: https://en.wikipedia.org/wiki/Weierstrass_function_(nowhere-differentiable_function)
    locator: Construction
same_as:
  wikidata: Q94491
  wikipedia: Weierstrass function (nowhere-differentiable function)
---

## Counterexample

Let $0 < a < 1$, and let $b$ be a positive odd integer with $a b > 1 + \frac{3}{2} \pi$. The Weierstrass function is
$$W(x) = \sum_{n=0}^{\infty} a^n \cos(b^n \pi x).$$
The function $W$ is continuous on $\mathbb{R}$, but it is not [[differentiable|0A61B60B5R]] at any point.
So a continuous function need not have a derivative anywhere.

## Remarks

The terms satisfy $|a^n \cos(b^n \pi x)| \le a^n$. The [[M-test|0NX5NWAFC9]] and the [[continuity of uniform sums|0R0MYT0BJD]] give continuity.
G. H. Hardy later showed that the conclusion holds under the weaker condition $a b \ge 1$.
Karl Weierstrass presented the function to the Prussian Academy of Sciences on 18 July 1872.
Bernard Bolzano had constructed such a function around 1831, but it was not published until 1922.

## Explanations

### L1 human

The graph of the Weierstrass function wiggles at every scale.
Zooming in never shows a straight piece, so there is no tangent line at any point.
