Find the sum of the series $\sum_{k=1}^\infty \frac{\cos 2kx}{k^2}$ 
Find $S_1(x)$:
  $$
S_1(x)=\sum_{k=1}^\infty \frac{\cos 2kx}{k^2}
$$

My attempt:
$$
\begin{aligned}
&\text{Let } S_2=\sum_{k=1}^\infty \frac{\sin 2kx}{k^2}\\
&S_1+i\cdot S_2=\sum_{k=1}^\infty\frac{(\cos x+i\sin x)^{2k}}{k^2}=[z=\cos x+i\sin x]=\\
&=\sum_{k=1}^\infty\frac{z^{2k}}{k^2}=S\\
&\left(\frac{z^{2k}}{k^2}\right)'_z=\frac{2z^{2k-1}}{k}\\
&\sum_{k=1}^\infty\frac{2z^{2k-1}}{k}=\frac{2}{z}\sum_{k=1}^\infty
\frac{(z^2)^k}{k}=-\frac{2\ln(1-z^2)}{z}=T\ \ \ \ \ \ (|z|<1)
\end{aligned}
$$
Then I tried to integrate $T$ (from $0$ to $z$) in order to get sum $S$. But this integral seems to get me back to the polylogarithm I was trying to avoid. So, I don't see how I can write $S_1$ with the finite number of terms (without the polylogarithm function).
 A: You were on the right track.  Let $S(x)$ be given by the series $S(x)=\sum_{k=1}^\infty \frac{\cos(2kx)}{k^2}$.  Then, we see that for $x\in(0,\pi)$
$$\begin{align}
S(x)&=\sum_{k=1}^\infty \frac{\cos(2kx)}{k^2}\\\\
&=\text{Re}\left(\sum_{k=1}^\infty \frac{e^{i2kx}}{k^2}\right)\\\\
&=\text{Re}\left(\text{Li}_2(e^{i2x})\right)\\\\
&=\frac12 \left(\text{Li}_2(e^{i2x})+\text{Li}_2(e^{-i2x})\right)\\\\
&=\frac12\left(-\frac{\pi^2}6-\frac12\log^2(-e^{i2x})\right)\\\\
&=-\frac{\pi^2}{12}+\frac14\left(2x-\pi\right)^2\\\\
&=\frac{\pi^2}{6}+x^2-\pi x
\end{align}$$
And we are done!
A: By "guessing" the appropriate function, we can find this sum with Fourier series.
First guess:
$$x^2 \sim \frac{\pi^2}{3} +\sum_{k=1}^\infty (-1)^k \frac{\cos k x}{k^2}.$$
After guessing that the function is a parabola (quadratic in $x$), found the cosine series for:
$$f(x)=(x-a)^2, \textrm{ on the interval } \left(0, \frac{\pi}{2}\right).$$
It became apparent that $a=\frac{\pi}{2}$ works.

$$f(x) \sim \frac{a_0}{2} + \sum_{k=1}^\infty a_k \cos 2 k x$$
$$a_0 = \frac{4}{\pi} \int_0^{\frac{\pi}{2}} \left(x-\frac{\pi}{2}\right)^2  \, dx = \frac{\pi^2}{6}$$
$$a_k = \frac{4}{\pi} \int_0^{\frac{\pi}{2}} \left(x-\frac{\pi}{2}\right)^2 \cos 2kx \, dx = \frac{1}{k^2}$$
$$\left(x-\frac{\pi}{2}\right)^2 \sim \frac{\pi^2}{12} + \sum_{k=1}^\infty \frac{\cos 2 k x}{k^2}.$$
So 
$$ \sum_{k=1}^\infty \frac{\cos 2 k x}{k^2} \sim \left(x-\frac{\pi}{2}\right)^2 - \frac{\pi^2}{12} .$$
The series is equal to the function on the right hand side in the interval $x \in (0,\pi)$, and its periodic extension, with period $\pi$.
Of course, this is the answer @Gary came up with in the comments.
