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?