Example 4.41. Consider the function $f(x)$ defined by the conditions:

$$
\begin{gathered}
f(x)=f(x+2 \pi) \text{ (2$\pi$-periodicity) } \\
f(x)=-f(-x) \text{ (oddness) } \\
f(x)=\pi-x, 0<x \leqslant \pi, f(0)=0
\end{gathered}
$$
Solution. This function has a piecewise continuous derivative, and therefore satisfies the Dirichlet condition by default. Let's write its Fourier series (due to the oddness of $f(x)$, the coefficients $a_{k}$ are 0). The coefficients $b_{k}$ are calculated using formulas (4.11):

$$
\begin{gathered}
b_{k}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin k x d x=\frac{2}{\pi} \int_{0}^{\pi}(\pi-x) \sin k x d x= \\
=\frac{2}{\pi}\left(\left.(\pi-x)\left(-\frac{\cos k x}{k}\right)\right|_{0} ^{\pi}-\left.(-1)\left(-\frac{\sin k x}{k^{2}}\right)\right|_{0} ^{\pi}\right)=\frac{2}{k}
\end{gathered}
$$

According to Theorem 4.30, for $x \neq 2 \pi n (n \in Z)$, we have the equality

$$
f(x)=2 \sum_{k=1}^{\infty} \frac{\sin k x}{k}
$$

At $x=2 \pi$ and each harmonic of the Fourier series becomes 0, so the entire sum is 0 at these points. This is consistent with the results of Theorem 4.30, because at $x=2 \pi n$

$$
\begin{gathered}
f(2 \pi n-0)=-\pi \\
f(2 \pi n+0)=\pi \\
\frac{1}{2}(f(2 \pi n-0)+f(2 \pi n+0))=0
\end{gathered}
$$