30.4. Compute the sum of the series \(\sum_{n=1}^{\infty} \frac{1}{n} \sin n x\).

## 30.2. Computation of infinite products
30.4. Answer: 0 when $x=2 k \pi$ and $\frac{\pi-x}{2}+\left[\frac{x}{2 \pi}\right] \pi$ in other cases.

When $x$ is replaced by $x+2 k \pi$, the considered sum and the proposed answer do not change. Therefore, it is sufficient to consider

## Chapter 30. Series

the case when $0<x<2 \pi$. Recall that

$$
\cos x+\cos 2 x+\cos 3 x+\ldots+\cos n x=\frac{\sin \frac{(2 n+1) x}{2}}{2 \sin \frac{x}{2}}-\frac{1}{2}
$$

(problem 11.28). Therefore, the function

$$
f_{n}(x)=\sin x+\frac{1}{2} \sin 2 x+\ldots+\frac{1}{n} \sin n x+\frac{\cos \frac{2 n+1}{2} x}{(2 n+1) \sin \frac{x}{2}}+\frac{x}{2}
$$

is differentiable on the interval $(0,2 \pi)$ and

$$
f_{n}^{\prime}(x)=-\frac{\cos \frac{x}{2} \cos \frac{2 n+1}{2} x}{(4 n+2) \sin ^{2} \frac{x}{2}} \rightarrow 0
$$

Applying Lagrange's theorem to the function $f_{n}(y)$ on the interval between $x$ and $\pi$, we get $f_{n}(x)-f_{n}(\pi)=f_{n}^{\prime}(\xi)(x-\pi)$. As $n \rightarrow \infty$, this equality takes the form $\sum_{n=1}^{\infty} \frac{1}{n} \sin n x+\frac{x}{2}-\frac{\pi}{2}=0$.