Does this series of functions converge I am looking at 

$$ g(x) = \sum_{k=1}^\infty {\cos (kx) \over k^2}$$

I know I can't apply the M-test in this case. Is this function differentiable?

Context: Previously I proved that $$ f(x) = \sum_{k=1}^\infty {\sin (kx) \over k^3}$$

is differentiable and that $f'$ is continuous on $\mathbb R$ by using the Weierstrass M-test.
If you look at the partial sums

$$g_n(x) = \sum_{k=1}^n \frac{\cos (kx)}{k^2},$$

it is clear that these are differentiable, with derivative

$$g_n'(x) = - \sum_{k=1}^n \frac{\sin (kx)}{k}.$$

Then you look at the (for the moment only formal) series

$$h(x) = -\sum_{k=1}^\infty \frac{\sin (kx)}{k}.$$

You know that if that series converged uniformly, then $g$ would be differentiable with derivative $h$. But alas, not only can we not apply Weierstraß' $M$-test to the series $h$, the series actually does not converge uniformly.

However, the series converges in $L^2([0,2\pi])$: the $\sin (kx)$ are mutually orthogonal and $\int_0^{2\pi} \sin^2(kx)\,dx = \pi$ for all $k \in \mathbb{Z}^+$, so

$$\lVert g_n' - g_m'\rVert_{L^2([0,2\pi])}^2 = \sum_{k=m+1}^n \frac{1}{k^2} \int_0^{2\pi} \sin^2(kx)\,dx &lt; \frac{\pi}{m}$$

for $1 \leqslant m &lt; n$, which shows that $(g_n')$ is a Cauchy sequence in $L^2([0,2\pi])$. From that and the periodicity it follows that $g$ is the integral of $h$,

$$\begin{align}
g(y) - g(x) &amp;= \lim_{n\to\infty} g_n(y) - g_n(x) \\
&amp;= \lim_{n\to \infty} \int_x^y g_n'(t)\,dt\\
&amp;= \int_x^y \lim_{n\to\infty} g_n'(t)\,dt\\
&amp;= \int_x^y h(t)\,dt,
\end{align}$$

where the legitimacy of the interchange of limit and integral follows from the Cauchy-Bun'akovskij-Schwarz inequality,

$$\int_x^y 1\cdot\lvert u(t) - v(t)\rvert\,dt \leqslant \sqrt{\int_x^y 1^2\,dt}\cdot\sqrt{\int_x^y \lvert u(t)-v(t)\rvert^2\,dt} \leqslant \sqrt{y-x}\cdot \lVert u-v\rVert_{L^2}.$$

Thus $g$ is differentiable with derivative $h(x)$ in all points where $h$ is continuous, but $g$ is not differentiable in points where $h$ has jump discontinuities - in such points, $g$ has left and right derivatives, but they differ. (Other discontinuities of $h$ would not allow such an easy conclusion, but luckily, $h$ is very well-behaved, continuous except for jump discontinuities in multiples of $2\pi$, so the differentiability of $g$ is easy to determine knowing $h$.)

So it remains to see that $h$ indeed has the properties mentioned. In fact,

$$h(x) = \frac{x-\pi}{2}$$

for $0 &lt; x &lt; 2\pi$, $h(0) = 0$, and $h$ is periodic with period $2\pi$ (the latter is immediate from the periodicity of the sine, and $h(0) = 0$ also is easy to see). If you know the theory of Fourier series, it is probably easiest to see that this function has the indicated Fourier series. Otherwise, note that

$$-\frac{\sin (kx)}{k} = \int_x^\pi \cos (kt)\,dt,$$

whence

$$\begin{align}
g_n'(x) &amp;= - \sum_{k=1}^n \frac{\sin (kx)}{k}\\
&amp;= \int_x^\pi \sum_{k=1}^n \cos (kt)\,dt\\
&amp;= \int_x^\pi \frac{\sin \left(n+\frac{1}{2}\right)t}{2\sin\frac{t}{2}} - \frac{1}{2}\,dt\\
&amp;= \frac{x-\pi}{2} + \int_x^\pi \frac{1}{2\sin \frac{t}{2}}\cdot \sin \left(n+\tfrac{1}{2}\right)t\,dt.
\end{align}$$

The function $\varphi(t) = \frac{1}{2\sin (t/2)}$ is continuously differentiable on $(0,2\pi)$, hence for $0 &lt; x &lt; 2\pi$

$$\int_x^\pi \varphi(t)\sin (ct)\,dt = -\left.\frac{\varphi(t)\cos (ct)}{c}\right\rvert_{x}^\pi + \frac{1}{c} \int_x^\pi \varphi'(t)\cos(ct)\,dt,$$

so we have

$$\left\lvert \int_x^\pi \frac{\sin \left(n+\frac{1}{2}\right)t}{2\sin \frac{t}{2}}\,dt\right\rvert \leqslant \frac{K(x)}{n+\frac{1}{2}},$$

where $K(x)$ depends on the values of $\varphi$ on $[x,\pi]$ resp. $[\pi,x]$. This shows that the series

$$-\sum_{k=1}^\infty \frac{\sin (kx)}{k}$$

converges uniformly on every interval $[\delta, 2\pi - \delta]$ for $0 &lt; \delta &lt; \pi$, but since the limit function has discontinuities in multiples of $2\pi$, the convergence is not uniform on $[0,2\pi]$.
Weierstrass M-test gives us that $f(x)$ converges uniformly, so it also converges pointwise, for $M_k=1/k^3$.