<s>[INST] Sum of series with cosines I need to prove this:
$$
\sum_{n = 1}^{\infty}{8 \over \left(\,2n - 1\,\right)^{2}\pi^{2}}\,
\sin\left(\,\left[\,2n - 1\,\right]\,{\pi x \over 2}\,\right)
\sin\left(\,\left[\,2n - 1\,\right]\,{\pi z \over 2}\,\right) = \min\left\{x, z\right\}
$$
I got this: 
$$ \frac{8}{\pi ^ 2} \sum\limits_{n=1}^\infty \frac{1}{(2n-1)^2} \cos((2n -1)\frac{\pi (x - z)}{2}) - \frac{8}{\pi ^ 2} \sum\limits_{n=1}^\infty \frac{1}{(2n-1)^2} \cos((2n -1)\frac{\pi (x + z)}{2})$$
But now I'm completely stuck. Can anybody please help me?
Thanks a lot!!
 [/INST] Big Hint:
Integrating the negative of
$$
\begin{align}
\sum_{k=1}^\infty\frac{\sin(nx)}{n}
&=\mathrm{Im}\left(\sum_{k=1}^\infty\frac{e^{inx}}{n}\right)\\
&=-\mathrm{Im}\left(\log(1-e^{ix})\right)\\
&=\frac{x}{2|x|}(\pi-|x|)\tag{1}
\end{align}
$$
we get
$$
\sum_{n=1}^\infty\frac{\cos(nx)}{n^2}=\frac{2\pi^2-6\pi|x|+3x^2}{12}\tag{2}
$$
and subtracting $\frac14$ of $(2)$ at $2x$, which is the even terms of $(2)$,
$$
\sum_{n=1}^\infty\frac{\cos(2nx)}{4n^2}=\frac{\pi^2-6\pi|x|+6x^2}{24}\tag{3}
$$
we get
$$
\sum_{n=1}^\infty\frac{\cos((2n-1)x)}{(2n-1)^2}=\frac{\pi^2-2\pi|x|}8\tag{4}
$$
for $x\in(-\pi,\pi)$.
Next, recall that $\min(x,y)=\dfrac{x+y-|x-y|}2$.
</s>