# The sum of the series $\cos(x)-\cos(2x)+\cos(3x)-...$

In the book "The spirit of mathematical analysis" of Martin Ohm, the author gives an example of differentiating an infinite series and obtaining an absurd result (page 2)

From the series

$$\frac{x}{2}=\sin(x)-\frac{1}{2}\sin2x+\frac{1}{3}\sin(3x)-...$$ (1)

If one differentiate terms by terms, one obtains this series

$$\frac{1}{2}=\cos(x)-\cos(2x)+\cos(3x)-...$$ (2)

The author said the last series is divergent, therefore this result is nonsensical.

My question is how does one obtain the first series? What transformation do you perform to obtain $$\frac{x}{2}$$ on the left hand side.

My second question how can we prove that the second series is divergent?

• Do you know hay Fourier series are.? Feb 2 '19 at 20:22
• Your second question is easy enough: $\cos(nx)$ does not tend to $0$ as $n \to \infty$, which means the series fails the divergence test. Feb 2 '19 at 20:24
• I haven't learnt Fourier series yet. But I am eager to learn, sir. Feb 2 '19 at 20:24
• @Theo Bendit Which test should you perform? Feb 2 '19 at 20:25
• @James Warthington, it is just a basic theorem about series. If $\sum a_n$ converges then $a_n\to 0$.
– Mark
Feb 2 '19 at 20:26

It might to better to first study the well known convergent series

$$\ln \cos \left(\frac{x}{2}\right)=-\ln 2 + \sum_{k=1}^\infty \frac{ (-1)^{k-1} \cos(kx)}{k}\tag{1}$$

You can then naively differentiate this to give the divergent series

$$\frac{1}{2}\tan\left(\frac{x}{2}\right)=\sum_{k=1}^\infty (-1)^{k-1}\sin(kx)$$

You can examine the nature of the divergences through looking at the partial sums. They appear to be correlated plus and minus going divergences. If you want to claim that this function can be integrated with rigour (which I've read somewhere is possible [possibly in a pamphlet by Hardy on Fourier Series] ) I think you must prove that these "correlated" plus and minus going divergences somehow cancel each other out in the integration process.

At $$x=\pi/2$$ you have the series.

$$\frac{1}{2}=1-1+1-1+...$$

A proof for series (1) is here and you should be able to prove your series in a similar fashion by changing to the exponential form.

• I have found these series in chapter 3 of Fourier's Analytical Theory of Heat:books.google.com/… Feb 2 '19 at 21:46

The first series is nothing more than the Fourier series of the $$2\pi$$-periodic odd function

$$y=\frac{x}{2},\quad\pi

Indeed the coefficients of the expansion $$\frac{x}{2}=\sum\limits_{n=1}^\infty b_n\sin nx$$ are: $$b_n=\frac{1}{\pi}\int_{-\pi}^\pi\frac{x}{2}\sin nx\;dx=\frac{1}{\pi}\left[-\frac{x}{2n}\cos nx\right]_{-\pi}^\pi=-\frac{1}{n\pi}\frac{\pi(-1)^n+\pi(-1)^n}{2}=\frac{(-1)^{n+1}}{n}.$$

The answer to the second question is most easily obtained through exponential representation of cosine and well-known expression for the partial sums of geometrical series: $$\begin {array}{} S_N(x)&=\sum_{n=1}^N (-1)^{n+1}\cos nx\\ &=\sum_{n=1}^N(-1)^{n+1}\frac {e^{inx}+e^{-inx}}{2}\\ &=\frac12\left [\frac {e^{ix}-(-1)^{N+2}e^{(N+1)ix}}{1+e^{ix}}+ \frac {e^{-ix}-(-1)^{N+2}e^{-(N+1)ix}}{1+e^{-ix}}\right]\\ &=\frac12\left [\frac {e^{ix/2}-(-1)^{N+2}e^{(N+1/2)ix}}{e^{-ix/2}+e^{ix/2}}+ \frac {e^{-ix/2}-(-1)^{N+2}e^{-(N+1/2)ix}}{e^{ix/2}+e^{-ix/2}}\right]\\ &=\frac12\left [1-(-1)^{N}\frac{\cos(N+1/2)x}{\cos (x/2)}\right]. \end {array}$$

From this one can conclude that $$S_N (x)$$ does not converge for any value of $$x$$.

For the first series, consider that you look for the imaginary part of $$\sum_{n=1}^\infty (-1)^{n-1} \frac {e^{i n x}} n=\sum_{n=1}^\infty (-1)^{n-1} \frac {\left( e^{i x}\right)^n} n=\log \left(1+e^{i x}\right)$$So $$\sum_{n=1}^\infty (-1)^{n-1} \frac {\sin(n x)} n=\frac{1}{2} i \left(\log \left(1+e^{-i x}\right)-\log \left(1+e^{i x}\right)\right)=\frac{1}{2} \left(\arg \left(1+e^{i x}\right)- \arg \left(1+e^{-i x}\right)\right)=\frac x 2$$ provided $$-\pi \leq x \leq \pi$$ .

• Do you know anyone to obtain this result without recoursing to complex analysis? I haven't studied complex analysis yet so I don't understand your answer. Feb 27 '19 at 1:30

The first equation's right-hand side is $$\Im\ln(1+\exp ix)$$. The second equation's right-hand side can only have convergent partial sums if $$\lim_{n\to\infty}\cos nx=0$$, but this clearly fails for $$x/\pi$$ rational. A famous but less obvious result is that other real $$x$$ also do not obtain such a limit.

• I have never seen $ln(1+expix)$ before, what is it? Feb 2 '19 at 20:46
• @JamesWharthington You may want to learn about complex exponentials and logarithms.
– J.G.
Feb 2 '19 at 20:48