TITLE: Why isn't the Weierstrass function $\sum_{n=0}^\infty a^n \cos(b^n\pi x)$ differentiable?
QUESTION [39 upvotes]: There is a famous example of a function that has no derivative: the Weierstrass function:

But just by looking at this equation - I can't seem to understand why exactly the Weierstrass Function does not have a derivative?
I tried looking at a few articles online (e.g. https://www.quora.com/Why-isnt-the-Weierstrass-function-differentiable), but I still can't seem to understand what prevents this function from having a derivative?
For example, if you expand the summation term for some very large (finite) value of $n$:
$$
f(x) = a \cos(b\pi x) + a^2\cos(b^2\pi x) + a^3\cos(b^3\pi x) + ... + a^{100}\cos(b^{100}\pi x)
$$
What is preventing us from taking the derivative of $f(x)$? Is the Weierstrass function non-differentiable only because it has "infinite terms" - and no function with infinite terms can be differentiated?
For a finite value of $n$, is the Weierstrass function differentiable?
Thank you!

REPLY [5 votes]: The basic concept used in constructing the Weierstrass function is that when you have $\sum r^n$, this converges for $|r|<1$ and diverges for $|r|\ge1$. So if you can get a function that involves $\sum r^n$ with $|r|<1$, and whose derivative increases $|r|$ above $1$, then the derivative will diverge.
When we take the derivative of $a^n\cos(b^n\pi x)$, we get $-a^nb^n\pi\sin(b^n\pi x)$, or $-(ab)^n\pi\sin(b^n\pi x)$. So before the derivative, our $r$ is $a$, but after the derivative it's $ab$. So ignoring the trigonometric functions, if $|a|<1$ and $|ab|\ge1$, the function converges and the derivative diverges. The trigonometric functions complicate it somewhat, making us need $|ab|$ to be greater than $1+\frac 32 \pi$, but the basic idea survives.
Merely having a function defined in terms of an infinite series doesn't mean that we can't take the derivative, it simply introduces the issue that the derivative might not converge. There are plenty of these functions that we can take the derivative of; if you've seen Taylor or Fourier series, you'll see plenty of examples of functions with well-defined derivatives. For instance, the derivative of $e^{2x}=\sum_{n=0}^{\infty}\frac{(2x)^n}{n!}$ is $\sum_{n=0}^{\infty}\frac{2(2x)^n}{n!}=2e^{2x}$.
If you take the derivative of a sawtooth wave, you get a square wave. Both of these waves have Fourier series, but the Fourier series for the square wave has repeated discontinuities. Each of these discontinuities are just points, and the derivative is still well-defined in the intervals between them. You can think of the Weierstrass  function as being similar to a sum of an infinite number sawtooth waves, so that each interval, no matter how small, contains a point where the at least one of the sawtooth waves has a derivative that doesn't converge, and thus the derivative doesn't exist anywhere.