Example 4.38. Write the Fourier series for the function $f(x)$ defined by the equations

$$
\begin{gathered}
f(x)=\left\{\begin{array}{l}
-\frac{\pi}{4},-\pi<x<0 \\
0, x=0, x=-\pi \\
\frac{\pi}{4}, 0<x<\pi
\end{array}\right. \\
f(x)=f(x+2 \pi) .
\end{gathered}
$$
Solution. The considered function is odd and has discontinuities of the first kind at points $n \pi (n \in \mathbb{Z})$ with a jump of $\frac{\pi}{2}$. Further:

$$
\int_{-\pi}^{\pi} f^{2}(x) d x=2 \int_{0}^{\pi} f^{2}(x) d x=2 \cdot \frac{\pi^{2}}{16} \cdot \pi=\frac{\pi^{3}}{8}<+\infty
$$

We will calculate the Fourier coefficients of this function using formulas (4.11). Due to the oddness of $f(x)$, all coefficients $a_{k}$ for this function will be 0:

$$
\begin{aligned}
& b_{k}=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin k x d x=\frac{2}{\pi} \int_{0}^{\pi} \frac{\pi}{4} f(x) \sin k x d x= \\
= & \left.\frac{1}{2}\left(-\frac{\cos k x}{k}\right)\right|_{0} ^{\pi}=\frac{1}{2} \frac{1-(-1)^{k}}{k}=\left\{\begin{array}{l}
0, k-\text { even } \\
\frac{1}{k},- \text { odd }
\end{array}\right.
\end{aligned}
$$

Finally, we obtain the following result

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