Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Weierstrass' function is an example of a function that is continuous, but nowhere differentiable, and can be visualized as being "infinitely wrinkled". I'm having trouble, however, imagining how the integral of such a function would appear. All the techniques that I know of for approximating functions (Taylor series, etc.) would fail on this one. How can this be visualized?

share|improve this question
Well, it's a continuous and everywhere once-differentiable function, right? More or less, it looks something like $f(x) = \begin{cases}x^2 + ax + b & x \ge 0 \\ -x^2 + ax + b &x \le 0 \end{cases}$ at every single point. –  John Hughes Jun 11 '14 at 1:07
Look up the definition of the Weistrauss function. It's integral is well defined –  TylerHG Jun 11 '14 at 1:11
@TylerHG He's asking for what it looks like visually, not that it exists. –  Mike Miller Jun 11 '14 at 1:15
Was trying to get him to look it up and see that it's integrable and then go from there. But I see what you mean. –  TylerHG Jun 11 '14 at 1:20

3 Answers 3

up vote 14 down vote accepted

I plotted the Weierstrass function $f(x) = \displaystyle\sum_{n = 0}^{\infty}\dfrac{1}{2^n}\cos(3^n\pi x)$ and its antiderivative $F(x) = \displaystyle\sum_{n = 0}^{\infty}\dfrac{1}{6^n\pi}\sin(3^n\pi x)$. Here is what they look like:

Weierstrass Function

enter image description here

The antiderivative of the Weierstrass function is fairly smooth, i.e. not too many sharp changes in slope. This just means that the Weierstrass function doesn't rapidly change values (except in a few places).

share|improve this answer
What did you use to plot these? –  Mike Miller Jun 11 '14 at 1:46
MATLAB. It took me a bit of playing around to figure out what values of $a$ and $b$ were used to generate the picture on Wikipedia. –  JimmyK4542 Jun 11 '14 at 1:52
Neat. What specifically did you run to get your second picture? I might try and run a longer computation to get an even better picture. –  Mike Miller Jun 11 '14 at 1:53
I computed the sum of the first 25 terms in the series for values of x ranging from -2 to 2 in increments of 10^-5. It ran in about 6 seconds (MATLAB is slower than other languages). With 25 terms, we get a maximum error of ~6.0x10^-8 for the function and ~1.3x10^-20 for the antiderivative. –  JimmyK4542 Jun 11 '14 at 2:07

integrals, unlike derivatives, are highly insensitive to small changes in the function. Since any continuous function on a closed interval can be approximated as well as you like by a polynomials (i.e., there is a sequence of polynomials converging uniformly to the function), and since the integral commutes with uniform limits (this is the precise statements that the integral is insensitive to small changes), it follows that the integral of the Weierstrass function looks very much like the integral of a polynomial. As for the anti-derivative, when you ask what does it look like, what kind of answer are you expecting? It will be a continuous function, and it would be quite smooth (but, of course, not very smooth).

share|improve this answer
"any continuous function on a closed interval can be approximated as well as you like by a polynomials"- but, I thought that nowhere differentiability meant that it $can't$ be approximated by a sequence of polynomials- i.e., not analytic –  silvascientist Jun 11 '14 at 1:27
every real-valued continuous function on a closed interval is the uniform limit of a sequence of polynomials (Weierstrass Theorem). –  Ittay Weiss Jun 11 '14 at 1:28
As far as what kind of answer I was expecting, I'm trying to understand what that not-quite-smoothness would entail. –  silvascientist Jun 11 '14 at 1:37
@silvascientist: Unlike with Taylor series, it isn't required that all polynomials in the sequence be prefixes of all polynomials that come later. We can have sequences like $1, 2-x, 1-2x+x^2, .5-1.5x+3x^2, 1-x+x^2-x^3, \ldots$ (Don't bother figuring out what that converges to; I just picked arbitrary numbers to use as coefficients.) –  user2357112 Jun 11 '14 at 5:32

The answer with the pictures is a great one, but there are some ways you can approach this without plotting tools. You should remember throughout that the process of integration takes you from a less smooth function to a smoother function, and differentiation does the opposite.

It's easy to make a function which behaves at a single point the way that the Weierstrass function does at every point. A standard example such as $f(x) = x \sin(\frac{1}{x})$ has gradients between $(0, f(0))$ and $(h, f(h))$ oscillating between $1$ and $-1$ for arbitrarily small $h$. What does the integral of this function look like, close to $0$? You will see that, whereas for the original function the value of the function approaches $0$ and the first derivative is wild, for the indefinite integral the value of the first derivative approaches $0$ and the second derivative is wild.

It's not clear what a 'wild' second derivative does to a function. Intuitively there are points where the gradient of the curve changes very fast. However, these are very 'localized' - the gradient changes drastically, but then changes back in the opposite direction before the value of the function can move too far. To get a handle on this you can think about an even simpler example - the function $f(x) = sgn(x) \sqrt{|x|}$. This is continuous, but non-differentiable at 0. Its indefinite integral looks like a parabola, but has a point of non-smoothness at 0, where its second derivative jumps. Mathematically the behavior here is very different from $f(x) = x^2$, which is a proper parabola, smooth at $0$, but visually it is not very obvious. If you imagine what is happening close to zero - the gradient is 'settling down' to $0$, as it should, but not quite as fast as it should, to avoid needing to turn faster and faster. [Imagine someone parking a car in a bay, but having to turn the wheel further and further to get the car straight before reaching the end of the space.]

You can also use term-by-term integration to see what the coefficients of the $\sin$ components look like. Quite trivially you will see that they tend to $0$ very fast, and you can imagine how much these quickly vanishing perturbations affect the graph. Since the function is Lipschitz, the fractal dimension of the curve is $1$, unlike the graph of the Weiestrass function.

A final observation which might be helpful to those who have some measure theory (but don't worry about it if you don't). In $L^1$, analytic functions are dense. This means that all functions are very close to analytic functions in integral. So the integral of even the most pathological function doesn't have much to distinguish it from something which is as 'nice' as possible.

The two last paragraphs can perhaps augment the picture of the graph of the integral in @JimmyK4542's answer. There is some small-scale detail missing from the graph (of course) but it is very small and unimportant to the geometry of the graph. Nice question btw.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.