# 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})$$

Thanks a lot!!

• I think the index of the sums should be $n$ instead of $i$? – Harto Saarinen Sep 19 '14 at 20:09
• are $x,z\ge0$ ? – robjohn Sep 19 '14 at 20:58
• Yes, they are. $x$ and $z$ are defined in [0, 1] – Maria Sep 19 '14 at 21:30

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$.
• Thank you so much!! I am trying to figure out the expression for $\operatorname{Im}(\log(1-\exp(ix)))$ I have to solve $\arctan(\frac{-\sin(x)}{1 - \cos(x)})$, right? I obtain $\frac{\pi - x}{2}$. Could you please explain to me why you add the sign of x to the $\pi$ term? Thanks again, this is so helpful!! – Maria Sep 19 '14 at 21:25
• Note that $\displaystyle\sum_{k=1}^\infty\frac{\sin(nx)}{n}$ is an odd function of $x$. The sign trickery is there simply to make the result an odd function. – robjohn Sep 19 '14 at 21:32