Differentiabliliy of $f(x) = \sum_{n=1}^\infty \frac{\cos(nx)}{n^2}$ Given
$$f(x) = \sum_{n=1}^\infty \frac{\cos(nx)}{n^2}$$
By plotting graph, it seems to be that this function is not differentiable at $x=0$, two sided limits are not equal with each other but I cannot show how. Also it seems that $f'(x)$ is not uniformly convergent however I cannot see how I can use that. 
 A: $$f(x)=\sum_{n=1}^\infty\frac{\cos(nx)}{n^2}$$
$$f'(x)=-\sum_{n=1}^\infty\frac{\sin(nx)}{n}$$
so maybe the problem with $f'(0)$ is the term as ${n\to\infty}$
$$f'(0)=-\lim_{x\to 0}\sum_{n=1}^\infty\frac{\sin(nx)}{n}=-\lim_{x\to 0}\sum_{n=1}^\infty\sum_{k=1}^\infty\frac{(-1)^k}{(2k+1)!}x^{2k+1}n^{2k}$$
this could be a way of evaluating it, but the term I think is the problem is:
$$\lim_{(x,n)\to(0,\infty)}\frac{\sin(nx)}{n}$$
A: You can prove (see e.g. here) that
$$
f(x) = \frac{x^2}{4}-\frac{\pi x}{2}+\frac{\pi^2}{6},
\qquad
\forall x \in [0,2\pi].
$$
Since $f$ is $2\pi$-periodic, you can conclude that
$$
f'_+(0) = -\frac{\pi}{2},\qquad
f'_-(0) = \frac{\pi}{2},
$$
so $f$ is not differentiable at the origin.
A: Begin with
$$
f ( x ) = \frac { x ^ { 2 } } { 4 } - \frac { \pi x } { 2 } + \frac { \pi ^ { 2 } } { 6 }
$$
for $x \in [0,2\pi]$, and the corresponding
$$
f ( x ) = \frac { x ^ { 2 } } { 4 } + \frac { \pi x } { 2 } + \frac { \pi ^ { 2 } } { 6 }
$$
for $x \in [-2\pi,0]$.  So
$$
\lim_{h \to 0^+}\frac{f(h)-f(0)}{h} = \lim_{h\to 0^+}\frac{h^2/4+\pi h/2}{h} = \frac{\pi}{2}
$$
and
$$
\lim_{h \to 0^-}\frac{f(h)-f(0)}{h} = \lim_{h\to 0^-}\frac{h^2/4-\pi h/2}{h} = -\frac{\pi}{2}
$$
Therefore,
$$
\lim_{h \to 0}\frac{f(h)-f(0)}{h}
$$
does not exist.
Picture of the graph of $f$, showing the non-differentiable point.

